/* ═══════════════════════════════════════
   76 PDF Suite — Complete Stylesheet
   Modern, responsive PDF toolkit UI
   Glassmorphism + smooth animations
   Mobile-first · DM Sans / Space Grotesk
════════════════════════════════════════ */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-dark: rgba(255, 255, 255, 0.95);
  --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══ SIDEBAR ═════════════════════════════ */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  transform: translateX(-100%);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

#sidebar.open {
  transform: translateX(0);
}

.sidebar-logo {
  padding: 2rem 1.5rem 1.5rem;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.brand span {
  background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 400;
}

.sidebar-section-label {
  padding: 1rem 1.5rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0 0 0 var(--radius);
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(255,255,255,0.2);
  color: white;
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 0 var(--radius) 0 0;
}

.nav-icon {
  font-size: 1.1em;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 1rem 0;
}

.hamburger {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  background: var(--sidebar-bg);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  backdrop-filter: blur(20px);
}

.hamburger:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* ═══ MAIN LAYOUT ═════════════════════════ */
#main {
  flex: 1;
  margin-left: 0;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 72px;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 1024px) {
  #main { margin-left: 280px; padding-left: 2rem; padding-right: 2rem; }
  .hamburger { display: none; }
  #sidebar { transform: translateX(0); position: relative; }
}

/* ═══ TOPBAR ═════════════════════════════ */
#topbar {
  position: fixed;
  top: 0;
  left: 60px;
  right: 1rem;
  height: 72px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  #topbar { left: 320px; }
}

.topbar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.privacy-pill {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

/* ═══ CONTENT ════════════════════════════ */
#content-area {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 0;
}

.panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ PANEL HEADER ═══════════════════════ */
.panel-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.panel-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.panel-header p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ═══ HOME PAGE ══════════════════════════ */
.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 4rem;
}

.hero-badge {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.hero-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.tool-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.tool-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-card-desc {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ═══ CARDS & FORMS ═════════════════════ */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.editor-launch-card {
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.editor-launch-icon {
  font-size: 6rem;
  margin-bottom: 2rem;
}

.editor-launch-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.editor-launch-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.form-label {
  font-weight: 500;
  min-width: 80px;
  color: var(--text-primary);
}

.form-input {
  flex: 1;
  min-width: 200px;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.form-input--wide { min-width: 100%; }

.form-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.option-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.option-pill {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

.option-pill:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.option-pill.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ═══ DROP ZONES ═════════════════════════ */
.drop-zone {
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.02);
}

.drop-zone-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.drop-zone-label {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.drop-zone-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.drop-zone-sub span {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.drop-zone input[type=file] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* ═══ FILE LISTS ═════════════════════════ */
.file-list {
  list-style: none;
  margin-bottom: 2rem;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.file-list li:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.drag-handle {
  cursor: grab;
  font-size: 1.2rem;
  opacity: 0.6;
  min-width: 24px;
}

.drag-handle:active { cursor: grabbing; }

.fn {
  flex: 1;
  font-weight: 500;
}

.fs {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.rm {
  background: var(--error);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  transition: var(--transition);
}

.rm:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* ═══ FILE INFO BAR ═════════════════════ */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(16,185,129,0.1));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

.file-info-bar.visible {
  opacity: 1;
  transform: translateY(0);
}

.file-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.file-remove {
  background: var(--error);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* ═══ PROGRESS ═══════════════════════════ */
.progress-wrap {
  margin: 2rem 0;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

.progress-wrap.visible {
  opacity: 1;
  transform: translateY(0);
}

.progress-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  width: 0;
  transition: width 0.4s ease;
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.progress-label {
  text-align: center;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ═══ BUTTONS ════════════════════════════ */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-primary:active {
  transform: translateY(0);
}

.editor-tool-btn {
  background: var(--bg-glass);
  border: 2px solid var(--border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  margin-right: 0.5rem;
}

.editor-tool-btn:hover:not(.active) {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.editor-tool-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.editor-tool-btn--delete {
  background: #fee2e2;
  color: var(--error);
  border-color: #fecaca;
}

.editor-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.editor-save-btn {
  width: auto !important;
  margin-right: 1rem;
}

/* ═══ TOAST ══════════════════════════════ */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translateX(400px);
  opacity: 0;
  transition: var(--transition);
  z-index: 2000;
  font-weight: 500;
  max-width: 350px;
}

#toast.show {
  transform: translateX(0);
  opacity: 1;
}

#toast.success { background: linear-gradient(135deg, var(--success), #059669); }
#toast.error { background: linear-gradient(135deg, var(--error), #dc2626); }

/* ═══ PRIVACY PAGE ═══════════════════════ */
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.privacy-item {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.privacy-item-icon {
  font-size: 2.5rem;
  float: left;
  margin-right: 1rem;
  margin-top: 0.25rem;
}

.privacy-item h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  margin-top: 0.25rem;
}

.privacy-item p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.policy-footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* ═══ CONTACT PAGE ═══════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.contact-info-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.contact-info-icon {
  font-size: 1.75rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.contact-info-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.contact-info-value {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ═══ PDF EDITOR ═════════════════════════ */
#editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#editor-modal.open {
  display: flex;
}

.editor-shell {
  width: 100%;
  max-width: 1400px;
  max-height: 90vh;
  height: 90vh;
  background: var(--bg-glass-dark);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(40px);
}

.editor-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(20px);
}

.editor-spacer {
  flex: 1;
}

.editor-canvas-area {
  flex: 1;
  overflow: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.page-canvas-wrapper {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 100%;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
}

.page-ctrl-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
}

.page-ctrl-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.page-ctrl-btn--del {
  background: #fee2e2;
  color: var(--error);
  border-color: #fecaca;
}

.page-ctrl-btn--del:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* ═══ RESPONSIVE ═════════════════════════ */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .card { padding: 2rem 1.5rem; }
  
  .panel-header h1 { font-size: 2rem; }
  
  #topbar { left: 60px; }
  
  .privacy-grid { grid-template-columns: 1fr; }
  
  .form-row { flex-direction: column; align-items: stretch; }
  
  .form-label { min-width: auto; }
  
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  #topbar { left: 0; right: 0; padding: 0 1rem; }
  
  .topbar-title { font-size: 1.25rem; }
  
  #content-area { padding: 1rem 0; }
  
  .card { padding: 1.5rem 1rem; margin-bottom: 1.5rem; }
  
  .drop-zone { padding: 3rem 1.5rem; }
}

/* ═══ UTILITIES ══════════════════════════ */
.editor-launch-label {
  cursor: pointer;
}

.file-list:empty {
  display: none;
}

.progress-wrap:empty {
  display: none;
}
