/* ============================================================
   GLOBAL STYLES - PDFCraft
   Shared across all pages
   ============================================================ */

/* -----------------------------------------------------------
   1. GOOGLE FONTS IMPORT
   ----------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* -----------------------------------------------------------
   2. CSS VARIABLES — THEME SYSTEM
   ----------------------------------------------------------- */
:root {
  /* Background */
  --bg-primary:    #F7F5F2;
  --bg-secondary:  #EDEAE5;
  --bg-card:       #FFFFFF;
  --bg-dropzone:   #FAF9F7;

  /* Border */
  --border:        #d7d2dd;
  --border-hover:  #ab9ab8;

  /* Text */
  --text-primary:  #17141a;
  --text-secondary:#66606b;
  --text-muted:    #9990a0;

  /* Accent */
  --accent:        #9239df;
  --accent-hover:  #7b2cbe;
  --accent-light:  #f7eeff;
  --accent-muted:  #e1d0f0;

  /* Status */
  --success:       #2E7D52;
  --success-light: #E3F3EB;
  --error:         #C0392B;
  --error-light:   #FDECEA;

  /* Effects */
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:     0 12px 32px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  /* Layout */
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --transition:    all .22s cubic-bezier(.4,0,.2,1);

  /* Typography */
  --font-display:  "Inter", sans-serif;
  --font-body:     'DM Sans', 'Segoe UI', sans-serif;
  --font-mono:     "DM Mono", monospace;
}

[data-theme="dark"] {
  /* Background */
  --bg-primary:    #121014;
  --bg-secondary:  #1b181e;
  --bg-card:       #222025;
  --bg-dropzone:   #17141a;

  /* Border */
  --border:        #332e36;
  --border-hover:  #534c5a;

  /* Text */
  --text-primary:  #ebe6f0;
  --text-secondary:#9488a0;
  --text-muted:    #62586b;

  /* Accent */
  --accent:        #9239df;
  --accent-hover:  #7b2cbe;
  --accent-light:  #1f122a;
  /* --accent-muted:  #29183a; */ /* OG */
  --accent-muted:  #351c4f;


  /* Status */
  --success:       #4CAF80;
  --success-light: #0E2018;
  --error:         #E05450;
  --error-light:   #200E0E;

  /* Effects - Dark */
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:     0 4px 12px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.2);
  --shadow-lg:     0 12px 32px rgba(0,0,0,.45), 0 4px 8px rgba(0,0,0,.25);
}

/* -----------------------------------------------------------
   3. RESET & BASE
   ----------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background .3s ease, color .3s ease;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* -----------------------------------------------------------
   4. LAYOUT
   ----------------------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px 120px;
}

/* -----------------------------------------------------------
   5. DROPZONE
   ----------------------------------------------------------- */
.dropzone {
  background: var(--bg-dropzone);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 4px var(--accent-muted);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* -----------------------------------------------------------
   6. BOTTOM BAR
   ----------------------------------------------------------- */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: none;
  backdrop-filter: blur(16px);
  transition: var(--transition);
}

.bottom-bar.visible {
  display: block;
}

.bottom-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.process-btn {
  flex: 1;
  height: 52px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(212,82,42,.3);
}

.process-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(212,82,42,.4);
}

.process-btn:active {
  transform: scale(.98);
}

.process-btn:disabled {
  background: var(--bg-secondary);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* -----------------------------------------------------------
   7. TOAST / NOTIFICATIONS
   ----------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideIn .3s ease;
  pointer-events: all;
}

.toast.success {
  border-color: var(--success);
}

.toast.error {
  border-color: var(--error);
}

.t-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .t-icon {
  color: var(--success);
}

.toast.error .t-icon {
  color: var(--error);
}

.t-title {
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.t-msg {
  font-size: .78rem;
  color: var(--text-secondary);
}

@keyframes slideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* -----------------------------------------------------------
   8. PROGRESS OVERLAY
   ----------------------------------------------------------- */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}

.progress-overlay.active {
  display: flex;
}

.progress-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  text-align: center;
  width: 280px;
  box-shadow: var(--shadow-lg);
}

.progress-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.progress-sub {
  font-size: .82rem;
  color: var(--text-secondary);
}

.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
  width: 0%;
}

/* -----------------------------------------------------------
   9. RESULT BANNER
   ----------------------------------------------------------- */
.result-banner {
  background: var(--success-light);
  border: 1.5px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: none;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.result-banner.visible {
  display: flex;
}

.result-icon {
  width: 44px;
  height: 44px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-icon i {
  font-size: 22px;
  color: #fff;
}

.result-info {
  flex: 1;
}

.result-info strong {
  font-size: .9rem;
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.result-info span {
  font-size: .78rem;
  color: var(--text-secondary);
}

.download-btn {
  background: var(--success);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  white-space: nowrap;
}

.download-btn:hover {
  filter: brightness(1.1);
}

.download-btn i {
  font-size: 15px;
}

/* -----------------------------------------------------------
   9. TRUST ROW
   ----------------------------------------------------------- */
.trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .76rem;
  color: var(--success);
  margin-top: 10px;
  font-weight: 500;
}

.trust-row i {
  font-size: 12px;
}

/* -----------------------------------------------------------
   10. RESPONSIVE
   ----------------------------------------------------------- */
@media (max-width: 600px) {
  main {
    padding: 20px 16px 110px;
  }

  .result-banner {
    flex-wrap: wrap;
  }
}

@media (max-width: 360px) {
  main {
    padding: 16px 12px 110px;
  }
}
