:root {
  --primary: #833ab4;
  --primary-light: #c13584;
  --accent: #fd1d1d;
  --bg-dark: #0f172a;
  --text-white: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
  padding: 0.75rem 0;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
  cursor: pointer;
}

.nav-link:hover {
  opacity: 0.7;
}

.nav-sign-in {
  color: var(--primary-light);
  border: 1px solid var(--primary-light);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.nav-sign-in:hover {
  background: var(--primary-light);
  color: white;
  opacity: 1;
}

/* ── Hamburger (mobile only) ─────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  order: -1; /* sits left of nav-links */
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-white);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Animate to ✕ when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid var(--glass-border);
    padding: 0.5rem 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links .nav-link {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 0;
  }

  .nav-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
  }
}

body {
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  padding: 2rem 1rem;
}

/* Background Blobs */
.background-blobs {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: blur(80px);
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  animation: move 20s infinite alternate;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 350px;
  height: 350px;
  background: var(--primary-light);
  bottom: -10%;
  right: -10%;
  animation-delay: -5s;
}

.blob-3 {
  display: none;
}

@keyframes move {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(100px, 100px) scale(1.1);
  }
}

main {
  width: 90%;
  max-width: 800px;
  text-align: center;
  z-index: 10;
}

header {
  margin-bottom: 1rem;
}

header h1 {
  font-size: 3.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
}

header h1 span {
  color: var(--accent);
}

header p {
  opacity: 0.7;
  margin-bottom: 1rem;
  font-weight: 300;
}


.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.tool-card {
  padding: 3rem;
  transition: transform 0.3s ease;
}

.upload-area {
  border: 2px dashed var(--glass-border);
  border-radius: 16px;
  padding: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: var(--primary-light);
  background: rgba(255, 255, 255, 0.02);
}

.upload-area.dragging {
  border-color: var(--accent);
  transform: scale(1.02);
}

.icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

h2 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hidden {
  display: none !important;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin: 2rem 0 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  margin: 1rem 0.5rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(131, 58, 180, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

footer {
  margin-top: 3rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

/* Tool Selector Tabs */
.tool-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  border-radius: 40px;
  overflow: visible;
  padding: 0.5rem;
  gap: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.3s;
  opacity: 0.7;
  flex: 1 1 auto;
}

.tab-btn:hover {
  opacity: 1;
}

.tab-btn.active {
  background: var(--primary);
  opacity: 1;
  box-shadow: 0 4px 15px rgba(131, 58, 180, 0.4);
}

/* Sub-upload area and inputs */
.settings-panel {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
}

.settings-panel h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.settings-desc {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.sub-upload {
  padding: 1rem !important;
  margin-bottom: 1rem;
  border-width: 1px !important;
}

/* Children must not intercept drag events — drops would silently cancel
   because the child has no dragover/preventDefault handler */
.sub-upload * {
  pointer-events: none;
}


.sub-upload p {
  margin: 0;
  font-size: 0.9rem;
}

.file-name {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  color: var(--accent);
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-group label {
  font-weight: 600;
  font-size: 0.9rem;
}

.glass-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem;
  border-radius: 8px;
  width: 80px;
  text-align: center;
  outline: none;
}

/* Ensure Dropdown Options have contrast */
select.glass-input {
  width: auto;
  min-width: 140px;
  cursor: pointer;
  text-align-last: center;
}

.glass-input option {
  background-color: var(--bg-dark);
  color: white;
  padding: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  body {
    padding: 1.5rem 0.75rem;
  }

  header h1 {
    font-size: 2.25rem;
  }

  header p {
    margin-bottom: 1.5rem;
  }

  .tool-card {
    padding: 1.25rem;
  }

  .upload-area {
    padding: 1.5rem 1rem;
  }

  .tab-btn {
    padding: 0.75rem 0.75rem;
    font-size: 0.85rem;
  }

  .btn-primary,
  .btn-secondary {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    text-align: center;
  }

  .glass-input {
    width: 100px;
  }

  select.glass-input {
    width: 100%;
    min-width: unset;
  }

  .swatchset-cmyk-row {
    gap: 0.75rem;
  }

  .swatchset-num {
    width: 52px !important;
  }

  .settings-panel {
    padding: 1rem;
  }
}

/* ── Swatch Set Creator ──────────────────────────────────────────────── */
.swatchset-subhead {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0;
  opacity: 0.9;
}

.swatchset-cmyk-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.swatchset-cmyk-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.swatchset-cmyk-field label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.swatchset-num {
  width: 60px !important;
  text-align: center;
}

.swatchset-radio-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.swatchset-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.swatchset-radio-label input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Pro CTA Section ──────────────────────────────────────────────────── */
.pro-cta {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  margin-bottom: 3rem;
  padding: 1.5rem 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(195, 53, 132, 0.2);
  cursor: pointer;
}

.pro-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(195, 53, 132, 0.3);
  opacity: 1;
}

.pro-cta-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: white;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.pro-cta-title span {
  color: var(--accent);
}

.pro-cta-sub {
  opacity: 0.95;
  font-weight: 300;
  font-size: 0.9rem;
  color: white;
}


/* ── Auth Modal ──────────────────────────────────────────────────────────── */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  border-radius: 24px;
  text-align: center;
}

.auth-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.auth-card p {
  opacity: 0.65;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  text-align: left;
  border-radius: 12px;
}

.auth-submit {
  margin: 0.25rem 0 0;
  width: 100%;
  padding: 0.9rem;
}

.auth-toggle-text {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: 0.25rem !important;
  margin-bottom: 0 !important;
}

.auth-toggle-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

.auth-error {
  color: var(--accent);
  font-size: 0.875rem;
  margin-top: 0.25rem !important;
  margin-bottom: 0 !important;
}

/* ── Sign-In Link ────────────────────────────────────────────────────────── */
.sign-in-bar {
  margin-top: 0.75rem;
  text-align: center;
}

.sign-in-link {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.sign-in-link:hover {
  color: white;
}

/* ── User Status Bar ─────────────────────────────────────────────────────── */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.user-info-text {
  font-size: 0.85rem;
  opacity: 0.7;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.3rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Outfit", sans-serif;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.1);
}

/* ── Pro Badge on Tabs ───────────────────────────────────────────────────── */
.pro-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.35rem;
  line-height: 1.4;
}

/* ── Pro Upgrade Prompt ──────────────────────────────────────────────────── */
.pro-lock-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

#pro-upgrade-prompt {
  text-align: center;
  padding: 2rem 1rem;
}

#pro-upgrade-prompt h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* ── Vectorizer Result ─────────────────────────────────────────────────── */
.vec-preview-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.vec-preview-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.vec-preview-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.vec-preview-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}

.vec-stats-bar {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
}

.vec-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.vec-stat-val {
  font-size: 1.1rem;
  font-weight: 700;
}

.vec-stat-lbl {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.vec-warnings {
  background: rgba(253, 29, 29, 0.08);
  border: 1px solid rgba(253, 29, 29, 0.2);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.vec-type-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vec-tweak-panel {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  text-align: left;
}

.vec-tweak-label {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.vec-tweak-panel .input-group {
  margin-bottom: 0.75rem;
}

.vec-actions {
  text-align: center;
}

.vec-advanced-toggle {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: rgba(255, 255, 255, 0.7);
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Outfit", sans-serif;
  margin-top: 0.75rem;
}

.vec-advanced-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.vec-advanced-panel {
  margin-top: 1rem;
}

.vec-slider-group {
  margin-bottom: 1rem;
}

.vec-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.vec-slider-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.vec-slider-value {
  font-size: 0.8rem;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.vec-slider-desc {
  font-size: 0.72rem;
  opacity: 0.45;
  margin-bottom: 0.35rem;
}

.vec-slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.vec-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-light);
  cursor: pointer;
  border: 2px solid white;
}

.vec-slider-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-light);
  cursor: pointer;
  border: 2px solid white;
}

@media (max-width: 500px) {
  .vec-preview-row {
    flex-direction: column;
  }
  .vec-stats-bar {
    gap: 1rem;
  }
}

/* ── PDF Shuffler ────────────────────────────────────────────────────────── */

.shuffler-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.shuffler-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  transition: background 0.2s;
}

.shuffler-file-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.shuffler-file-label {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.shuffler-file-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.shuffler-move-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-white);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shuffler-move-btn:hover {
  border-color: var(--primary-light);
  background: rgba(193, 53, 132, 0.15);
}

.shuffler-remove-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.shuffler-remove-btn:hover {
  border-color: var(--accent);
  background: rgba(253, 29, 29, 0.15);
}

/* Validation results */
.shuffler-page-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shuffler-validation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 0.9rem;
}

.shuffler-validation-error {
  border-left: 3px solid var(--accent);
}

.shuffler-val-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.shuffler-val-pages {
  color: rgba(248, 250, 252, 0.6);
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.shuffler-val-error {
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

/* Single-page nudge */
.shuffler-nudge {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: rgba(131, 58, 180, 0.1);
  border: 1px solid rgba(131, 58, 180, 0.25);
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(248, 250, 252, 0.8);
}

.shuffler-nudge-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
}

.shuffler-nudge-link:hover {
  text-decoration: underline;
}
