/* ============================================
   3D Print Section Styles
   Distinct visual theme from main store
   ============================================ */

/* Page-specific body styles */
.page-3d-print {
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-color: #667eea;
  --accent-dark: #5a67d8;
}

/* Allow sticky positioning by preventing overflow clipping on ancestors */
/* Allow sticky positioning by preventing overflow clipping on ancestors */
/* Allow sticky positioning by preventing overflow clipping on ancestors */
html,
.page-3d-print {
  overflow: visible !important;
  overflow-x: inherit !important; /* Try to respect x hidden if possible, but visible is safest for sticky */
}

/* Explicitly override for this page to ensure sticky works */
html.page-3d-print-html {
  overflow: visible !important;
}

.page-3d-print {
  overflow: visible !important;
}


.page-3d-print #app,
.page-3d-print main {
  overflow: visible !important;
}

@media (min-width: 901px) {
  html.page-3d-print-html,
  body.page-3d-print.page-3d-print-studio {
    height: auto;
    overflow: visible !important;
    margin: 0;
    padding-top: 0 !important; /* Override style.css default */
  }

  .page-3d-print.page-3d-print-studio #app {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    padding-top: 70px; /* Account for fixed header */
    box-sizing: border-box; /* Ensure padding is included in height */
  }

  .page-3d-print.page-3d-print-studio main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    min-height: 0; /* Required for nested flex scrolling */
  }

  .page-3d-print.page-3d-print-studio .site-footer {
     /* Optional: Stick footer to bottom or hide it if not needed in "app mode" */
     /* For now, let it be naturally at the bottom, likely pushed out if main takes 100% */
     flex-shrink: 0;
  }
}

/* When logged in, remove body padding and handle header overlap */
.page-3d-print.logged-in {
  padding-top: 0 !important;
}

/* Reduce footer height for studio layout */
.page-3d-print .site-footer {
  padding: 0.5rem 0;
  border-top: 1px solid #eee;
}

/* Hero Section */
.print-hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 6rem 0 4rem;
  text-align: center;
  margin-top: 70px;
}

.print-hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.print-hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Alerts */
.alert {
  padding: 1rem 0;
  text-align: center;
}

.alert-success {
  background: #d4edda;
  color: #155724;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
}

.alert .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.alert-close:hover {
  opacity: 1;
}

/* Subscription Status Banner */
.subscription-status {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e7ff;
}

/* When hero is hidden (logged in), extend background to top and add margin for content */
.page-3d-print.logged-in .subscription-status {
  margin-top: -69px;
  padding-top: calc(70px + 0.5rem);
  padding-bottom: 0.5rem;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}

.status-badge.active {
  background: #10b981;
  color: #fff;
}

.status-badge.trialing {
  background: #6366f1;
  color: #fff;
}

.plan-name {
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 0.5rem; /* Visual alignment adjustment with badge */
}

.usage-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
}

.usage-text {
  font-size: 0.9rem;
  color: #64748b;
  white-space: nowrap;
}

.usage-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Plans Section */
.plans-section {
  padding: 4rem 0;
  background: #fff;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: #64748b;
  margin-bottom: 3rem;
}


/* Custom Instant Tooltip */
.custom-tooltip-container {
  position: relative;
  display: inline-flex;
}


.custom-tooltip-text {
  visibility: hidden;
  background-color: #333;
  color: #fff !important;
  text-align: center;
  border-radius: 6px;
  padding: 6px 10px;
  position: absolute;
  z-index: 1000;
  top: 50%;
  bottom: auto;
  left: auto;
  right: calc(100% + 10px);
  transform: translateY(-50%);
  margin-right: 0;
  opacity: 0;
  /* Removed transition for immediate effect */
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: normal;
  width: max-content;
  max-width: 200px;
  pointer-events: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-tooltip-text::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -5px;
  margin-left: 0;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent #333;
}

.custom-tooltip-container:hover .custom-tooltip-text {
  visibility: visible;
  opacity: 1;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.plan-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  border-radius: 16px;
  padding: 2rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.plan-btn {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-outline {
  border: 2px solid #e2e8f0;
  background: transparent;
  color: #334155;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
}

.plan-card.popular {
  border-color: var(--accent-color);
}

.plan-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.25rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.plan-description {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  min-height: 40px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 700;
}

.price-period {
  color: #64748b;
  font-size: 0.9rem;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: #475569;
}

.plan-features li::before {
  content: '✓';
  color: #10b981;
  font-weight: 600;
}

.plan-features li.unlimited::before {
  content: '∞';
  color: var(--accent-color);
}

.plan-features li.limited::before {
  content: '○';
  color: #94a3b8;
}

.plan-features li.premium::before {
  content: '★';
  color: #eab308;
}

.plan-features li.premium {
  color: #334155;
  font-weight: 500;
}

.price-amount.contact-sales {
  font-size: 1.5rem;
  color: var(--accent-color);
  font-weight: 700;
}

.btn-subscribe {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-subscribe.primary {
  background: var(--accent-gradient);
  color: #fff;
}

.btn-subscribe.primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-subscribe.secondary {
  background: #f1f5f9;
  color: #334155;
}

.btn-subscribe.secondary:hover {
  background: #e2e8f0;
}

/* Generator Section */
.generator-section {
  padding: 0;
  background: #f8fafc;
  flex: 1; /* Take remaining space in main */
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible; /* Allow sticky */
}

.generator-section .container {
  max-width: 100%;
  padding: 0;
  height: 100%; /* Fill parent */
}

@media (max-width: 900px) {
  .generator-section {
    padding: 0;
    overflow: visible !important;
  }

  .generator-section .container {
    max-width: 1200px;
    padding: 0 1rem;
  }
}

.generator-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
}

/* Responsive Layout - Desktop 2-column, Mobile single column */
.generator-layout-responsive {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Desktop: 2-column layout */
@media (min-width: 901px) {
  .generator-layout-responsive {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
    height: 100%;
    min-height: 0; /* Override previous min-height */
  }

  .preview-column-responsive {
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    overflow: hidden;
  }

  .preview-column-responsive .preview-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .preview-column-responsive .preview-canvas-container {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    overflow: hidden;
  }

  .preview-column-responsive .preview-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
  }

  .controls-column-responsive {
    padding: 0;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    height: 100%;
    position: relative; /* Changed from sticky */
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Container doesn't scroll, inner section does */
  }

  .controls-column-responsive::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }

  .controls-column-responsive .controls-section {
    padding: 2rem;
    padding-bottom: 2rem;
    flex: 1;
    overflow: visible;
  }

  .controls-column-responsive .controls-section > * {
    flex-shrink: 0;
  }

  .controls-column-responsive .controls-section::-webkit-scrollbar {
     width: 6px;
     background: transparent;
  }

  .controls-column-responsive .controls-section::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
  }

  .controls-footer {
    padding: 0;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    z-index: 10;
    flex-shrink: 0;
  }

  .controls-column-responsive .btn-download {
    position: static;
    width: 100%;
    margin: 0;
    border-radius: 0;
    padding: 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  }
}

/* Mobile: Single column */
@media (max-width: 900px) {
  .preview-column-responsive {
    position: sticky;
    top: 70px;
    z-index: 50;
  }

  .controls-column-responsive {
    padding: 1rem;
  }

  .controls-column-responsive .controls-section {
    padding-bottom: 100px;
  }

  /* Reset button to fixed full-width on mobile */
  .controls-column-responsive .btn-download {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    padding: 1rem;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
}

/* Legacy Single Column Layout */
.generator-layout-single {
  display: block;
  margin-top: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.preview-sticky {
  position: sticky;
  top: 80px;
  z-index: 50;
  margin-bottom: 1.5rem;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.preview-panel {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  height: fit-content;
  /* Fix for Safari border-radius clipping with canvas */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  mask-image: -webkit-radial-gradient(white, black);
}

.preview-canvas-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  background: transparent;
}

/* Ensure the Three.js canvas fills its container */
.preview-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Advanced Options Panel (Below Preview) */
.advanced-options-panel {
  background: #fff;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.advanced-options-panel .advanced-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
  transition: background 0.2s;
}

.advanced-options-panel .advanced-toggle:hover {
  background: #f8fafc;
}

.advanced-options-panel .advanced-toggle.open {
  border-bottom: 1px solid #e2e8f0;
}

.advanced-options-panel .advanced-toggle .chevron {
  transition: transform 0.2s;
}

.advanced-options-panel .advanced-toggle.open .chevron {
  transform: rotate(180deg);
}

.advanced-options-panel .advanced-content {
  padding: 1.5rem;
  background: #f8fafc;
}

/* Collapsible Sections */
.collapsible-section {
  background: linear-gradient(180deg, #f1f5f9 0%, rgba(241, 245, 249, 0) 100%);
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid #e2e8f0;
  overflow: hidden;
  /* Full width background */
  margin-left: -2rem;
  margin-right: -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
}

@media (max-width: 900px) {
  .collapsible-section {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Corner radius specific fix */
#cornerRadiusGroup,
#cornerRadiusGroup input {
  width: 100% !important;
  max-width: 100% !important;
}

.collapsible-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.collapsible-header .collapsible-toggle {
  flex: 1;
  width: auto;
  min-width: 0;
}

.collapsible-toggle.compact {
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: 0.5rem;
}

.header-controls-right {
  margin-left: auto;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.reset-btn:hover {
  background: #f1f5f9;
  color: var(--accent-color);
}

.reset-btn:active {
  transform: scale(0.95);
}

.collapsible-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
  transition: color 0.2s;
}

.collapsible-toggle:hover {
  color: var(--accent-color);
}

.collapsible-toggle.open {
  border-bottom: none;
}

.collapsible-toggle .chevron {
  transition: transform 0.2s;
  color: #94a3b8;
}

.collapsible-toggle.open .chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  padding: 0 0 1rem 0;
  background: transparent;
}

/* Font Grid */
.font-grid-container {
  margin-bottom: 1rem;
}

.font-grid-container .section-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.font-grid-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 2px;
}

.font-card-loading {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

.font-card-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.font-card-compact:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.font-card-compact.active {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.font-card-compact .font-preview {
  font-size: 1.25rem;
  color: #1e293b;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-card-compact .font-name {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-left: 1rem;
}

/* Control group inline for shape toggle inside collapsible */
.control-group-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.control-group-inline > label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
}

.control-group-inline .shape-toggle {
  flex: 1;
  max-width: 200px;
}

.settings-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1rem 0;
}

/* Settings Sections */
.settings-section {
  margin-bottom: 2rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.section-heading {
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.slider-row label {
  font-size: 0.9rem;
  color: #64748b;
}

.slider-row span {
  font-family: monospace;
  font-weight: 600;
  color: #334155;
}

.auto-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auto-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.slider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.slider-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}

.slider-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shape-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #334155;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.shape-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

.advanced-options-panel input[type="range"],
.collapsible-content input[type="range"] {
  width: 100%;
  height: 6px;
  accent-color: var(--accent-color);
  background: #e2e8f0;
  border-radius: 3px;
  -webkit-appearance: none;
  appearance: none;
}

.advanced-options-panel input[type="range"]::-webkit-slider-thumb,
.collapsible-content input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.advanced-options-panel input[type="range"]::-moz-range-thumb,
.collapsible-content input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.preview-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #64748b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dimension-badges {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
}

.dim-badge {
  background: #4285f4;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.controls-panel {
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.control-group input[type="text"],
.control-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.control-group input[type="text"]:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--accent-color);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}





/* Shape Toggle Buttons */
.shape-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.size-toggle,
.shape-toggle {
  display: flex;
  gap: 0.5rem;
}

.size-btn,
.shape-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.size-btn:hover,
.shape-btn:hover {
  border-color: #cbd5e1;
}

.size-btn.active,
.shape-btn.active {
  border-color: var(--accent-color);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: var(--accent-dark);
}

.slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent-color);
}

/* Advanced Options */
.advanced-options {
  margin-top: 1rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.advanced-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #475569;
  transition: all 0.2s;
}

.advanced-toggle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.advanced-toggle.open {
  border-radius: 10px 10px 0 0;
  border-bottom: none;
}

.advanced-toggle .chevron {
  transition: transform 0.2s;
}

.advanced-toggle.open .chevron {
  transform: rotate(180deg);
}

.advanced-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 1rem;
}

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

.advanced-content .slider-group:last-child {
  margin-bottom: 0;
}

.advanced-content label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: #64748b;
}

.advanced-content label span {
  font-family: monospace;
  font-weight: 600;
  color: #475569;
}

.btn-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1rem;
}

.btn-download:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-download:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.modal-content p {
  color: #64748b;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-content input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-content input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-color);
}

.modal-content.error h3 {
  color: #dc2626;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.modal-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.modal-actions .btn-primary {
  background: var(--accent-gradient);
  color: #fff;
}

.modal-actions .btn-secondary {
  background: #f1f5f9;
  color: #334155;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Responsive */
@media (max-width: 640px) {
  .print-hero {
    padding: 4rem 0 3rem;
  }

  .plans-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .usage-info {
    width: 100%;
  }
}

/* Shape Grid UI */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.shape-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.shape-card:hover:not(.active):not(.locked) {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.shape-card.active {
  border-color: var(--accent-color);
  background: linear-gradient(to bottom right, #f8faff, #f0f7ff);
  box-shadow: 0 0 0 1px var(--accent-color), 0 4px 12px rgba(99, 102, 241, 0.15);
}

.shape-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f8fafc;
}

.shape-icon {
  width: 32px;
  height: 32px;
  color: #64748b;
  transition: color 0.2s;
}

.shape-card.active .shape-icon {
  color: var(--accent-color);
}

.shape-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.shape-card.active .shape-label {
  color: var(--accent-color);
}

@media (max-width: 640px) {
  .shape-grid {
      grid-template-columns: repeat(3, 1fr); /* Keep 3 on mobile or allow wrap? User said "scalable". */
       /* Actually, repeat(auto-fill, minmax(80px, 1fr)) is better for future proofs */
       grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
}

/* Restriction Locks */
.font-card-compact.locked,
.shape-btn.locked,
.size-btn.locked,
.auto-toggle.locked {
  opacity: 0.6;
  cursor: not-allowed !important;
  position: relative;
  background-color: #f1f5f9;
}

.font-card-compact.locked:hover,
.shape-btn.locked:hover,
.size-btn.locked:hover,
.auto-toggle.locked:hover {
  border-color: #e2e8f0;
  transform: none;
  box-shadow: none;
}

.font-card-compact.locked::after,
.shape-btn.locked::after,
.size-btn.locked::after,
.auto-toggle.locked::after {
  content: "🔒";
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 12px;
}

/* Color Picker Grid - Matching Customize Page Style */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 12px;
  padding: 0.5rem 0;
  width: 100%;
}

.color-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1); /* Subtle outline */
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: relative;
}

/* White border for active state to create "gap" */
.color-btn.active {
  transform: scale(1.1);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--accent-color), 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
}

.color-btn:hover:not(.active) {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  z-index: 5;
}

/* Specific styling for white/very light colors in general to be visible */
.color-btn[style*="rgb(255, 255, 255)"],
.color-btn[style*="#FFFFFF"],
.color-btn[style*="#ffffff"] {
  border: 1px solid #e2e8f0 !important;
}
.color-btn.active[style*="rgb(255, 255, 255)"],
.color-btn.active[style*="#FFFFFF"],
.color-btn.active[style*="#ffffff"] {
   border-color: #fff !important; /* Keep white gap */
}


/* Preview Warning Icon & Popover */
.preview-warning-container {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-warning-container.visible {
  opacity: 1;
}

.preview-warning-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  padding: 0;
}

.preview-warning-btn:hover {
  background: transparent;
  transform: scale(1.1);
}

.preview-warning-popover {
  position: absolute;
  top: 40px;
  right: 0;
  width: 250px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 16px;
  z-index: 30;
  animation: fadeIn 0.2s ease-out;
  display: none; /* Toggled via JS */
}

/* ... existing popover styles ... */
/* I need to make sure I don't overwrite too much or lose context */
/* Use replacing only changed blocks */

/* When warning is active, move the pill left */
.dim-badge.has-warning {
  transform: translateX(-45px);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.popover-close:hover {
  background: #f5f5f5;
  color: #666;
}

.popover-title {
  font-weight: 600;
  color: #111;
  margin-bottom: 8px;
  font-size: 0.9rem;
  padding-right: 20px;
}

.popover-content {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.5;
}

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




/* Utility for smooth reveal after load */
.visible-fade {
  opacity: 1 !important;
  visibility: visible !important;
  transition: opacity 0.5s ease-in-out;
}

/* XY Pad Controls */
.xy-pad-container {
    width: 100%;
    aspect-ratio: 32/10;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    position: relative;
    touch-action: none;
    margin-bottom: 0.5rem;
    cursor: crosshair;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(203, 213, 225, 0.5) 1px, transparent 1px),
        linear-gradient(90deg, rgba(203, 213, 225, 0.5) 1px, transparent 1px);
    background-size: 20px 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.xy-axis-x {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: rgba(148, 163, 184, 0.8);
    transform: translateX(-50%);
    pointer-events: none;
}

.xy-axis-y {
    position: absolute;
    top: 57.14%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(148, 163, 184, 0.8);
    transform: translateY(-50%);
    pointer-events: none;
}

.xy-handle {
    width: 24px;
    height: 24px;
    background-color: var(--accent-color, #6366f1);
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 57.14%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    transition: transform 0.1s cubic-bezier(0,0,0.2,1);
}

.xy-pad-container:active .xy-handle {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: none;
}


/* Account Disabled Modal */
.modal-content.account-disabled {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 450px;
}

.account-disabled-icon {
  margin-bottom: 1.5rem;
  background: #fef2f2;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.account-disabled-icon img {
  width: 60px;
  height: 60px;
  opacity: 0.8;
}

.account-disabled-title {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1e293b;
}

.account-disabled-message {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #64748b;
}

.account-disabled-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.account-disabled-btn {
  padding: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Animation Toggle Button */
.preview-control-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: #4b5563;
}

.preview-control-btn:hover {
    background: #f9fafb;
    transform: scale(1.05);
    color: #111827;
}

.preview-control-btn.top-left {
    top: 16px;
    left: 16px;
}

/* FPS Counter */
#fpsCounter {
  position: absolute;
  top: 98px;
  left: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #64748b;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(4px);
}

#wasmVersion {
  position: absolute;
  top: 66px;
  left: 16px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #64748b;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* Hue Slider */
.hue-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
  outline: none;
  margin: 8px 0 16px 0;
  cursor: pointer;
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #fff; /* Inner white ring */
  box-shadow: 0 0 0 1px #cbd5e1, 0 2px 6px rgba(0,0,0,0.15); /* Ring border + shadow */
  cursor: grab;
}

.hue-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1, 0 2px 6px rgba(0,0,0,0.15);
  cursor: grab;
}

/* Education Banner */
.education-banner {
  max-width: 1000px;
  margin: 3rem auto 0;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  color: #0c4a6e;
}

.education-icon {
  flex-shrink: 0;
  color: #0284c7;
  padding-top: 2px;
}

.education-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0369a1;
}

.education-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
}

.education-content a {
  color: #0284c7;
  text-decoration: underline;
  font-weight: 500;
}

.education-content a:hover {
  color: #0369a1;
}

@media (max-width: 600px) {
  .education-banner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    align-items: center;
  }
}

/* Dark Mode */
body.dark-mode {
    background-color: #0f172a;
    color: #e2e8f0;
}

body.dark-mode .print-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.dark-mode .generator-section {
    background-color: #0f172a;
}

/* Controls Column */
body.dark-mode .controls-column-responsive {
    background-color: #1e293b;
    border-left-color: #334155;
}

/* Text Colors */
body.dark-mode label {
    color: #cbd5e1;
}

body.dark-mode .collapsible-toggle span {
    color: #f1f5f9;
}

body.dark-mode input[type="text"],
body.dark-mode select {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

body.dark-mode input[type="text"]:focus {
    border-color: #60a5fa;
}

body.dark-mode .reset-btn {
    color: #94a3b8;
}

body.dark-mode .reset-btn:hover {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.1);
}

/* Collapsible Sections */
body.dark-mode .collapsible-section {
    background: linear-gradient(180deg, #1e293b 0%, rgba(30, 41, 59, 0) 100%);
    border-top-color: #334155;
}

body.dark-mode .collapsible-toggle {
    color: #f1f5f9;
}

body.dark-mode .collapsible-toggle:hover {
    background-color: transparent;
    color: #60a5fa; /* Light Blue Accent */
}

/* Buttons and Toggles */
body.dark-mode .size-btn,
body.dark-mode .shape-btn,
body.dark-mode .shape-card,
body.dark-mode .font-card-compact,
body.dark-mode .color-btn {
    background-color: #334155;
    border-color: #475569;
    color: #f1f5f9; /* Increased contrast from e2e8f0 to f1f5f9 */
}

/* Ensure font size consistency in dark mode if specific overrides needed,
   but primarily rely on base class.
   User pointed out Size font vs Shape font.
   .size-btn usually has font-size: 0.9rem (line 1193).
   .shape-card doesn't have explicit font-size in base css (it inherits).
   Let's enforce it here to match size-btn if needed, or check base css.
*/
body.dark-mode .size-btn {
    font-size: 0.9rem; /* Match base */
}

body.dark-mode .shape-card {
    font-size: 0.9rem; /* Enforce match with size-btn */
    color: #94a3b8; /* Default text color for shape card label usually */
}

/* Shape card specific: The icon/text inside */
body.dark-mode .shape-card span {
    color: #f1f5f9; /* Make text inside shape card bright */
}

body.dark-mode .size-btn.active,
body.dark-mode .shape-card.active,
body.dark-mode .font-card-compact.active {
    background: #3b82f6; /* Accent color - Use 'background' to override gradients */
    color: white;
    border-color: #3b82f6;
}

body.dark-mode .shape-card.active span {
    color: white;
}

body.dark-mode .shape-card:hover:not(.active),
body.dark-mode .font-card-compact:hover:not(.active) {
    background-color: #475569;
    border-color: #64748b;
}

body.dark-mode .shape-card:hover:not(.active) span {
    color: white;
}

/* Preview Area */
body.dark-mode .preview-column-responsive {
    background-color: #0f172a;
}

/* Footer in controls */
body.dark-mode .controls-footer {
    background-color: #1e293b;
    border-top-color: #334155;
}

/* Modals */
body.dark-mode .modal-content {
    background-color: #1e293b;
    color: #f1f5f9;
}

body.dark-mode .modal-content h3 {
    color: #f1f5f9;
}

body.dark-mode .btn-secondary {
    background-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .btn-secondary:hover {
    background-color: #475569;
}

/* Sliders */
/* Specific override for the input background to keep rounded style */
body.dark-mode .advanced-options-panel input[type="range"],
body.dark-mode .collapsible-content input[type="range"] {
    background: #334155; /* Darker slate for track */
}

/* Ensure the webkit track track doesn't override the nice rounded input background style */
body.dark-mode input[type=range]::-webkit-slider-runnable-track {
    background: transparent;
}

/* Icons */
body.dark-mode .icon-sun {
    color: #fbbf24;
}

body.dark-mode .icon-moon {
    color: #94a3b8;
}

/* Lock icons in dark mode */
body.dark-mode .locked .lock-icon {
    filter: invert(1);
    opacity: 0.5;
}

/* Override locked state background */
body.dark-mode .locked {
    background-color: #1e293b !important;
    opacity: 0.6;
}

/* XY Pad */
body.dark-mode .xy-pad-container {
    background-color: #334155;
    border-color: #475569;
}

body.dark-mode .xy-axis-x,
body.dark-mode .xy-axis-y {
    background-color: #475569;
}

body.dark-mode .xy-handle {
    background-color: #60a5fa;
    box-shadow: 0 0 0 2px #1e293b;
}

/* Dark Mode Toggle Button Specifics */
#darkModeToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Contact / Outline Buttons in Dark Mode */
/* Reverted to previous state to fix broken header */
body.dark-mode .btn-outline {
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .btn-outline:hover {
    background-color: #334155;
    color: #fff;
    border-color: #64748b;
}

/* Footer fix for dark mode */
body.dark-mode .site-footer {
    background-color: #0f172a;
    border-top-color: #1e293b;
}

/* Header fix */
body.dark-mode .site-header {
    background-color: #1e293b !important; /* Force dark background */
    border-bottom-color: #334155;
}

body.dark-mode .site-header .logo {
    color: #f1f5f9;
}

/* Contact Link Styling - Restoring collapsing behavior but using "Add Eyes" style (Slate) */
body.dark-mode .contact-link {
    background: #334155 !important; /* Slate 700 - Matches Add Eyes button */
    border: 1px solid #475569 !important;
    color: white !important;
    box-shadow: none; /* Flatten to match Add Eyes style */
}

/* Let the text collapse again (remove forced visibility) */
body.dark-mode .contact-link .contact-text {
    color: white !important;
    /* Removed max-width/opacity overrides to restore animation */
}

body.dark-mode .contact-link svg {
    color: white !important;
}

body.dark-mode .contact-link:hover {
    background: #475569 !important; /* Slate 600 on hover */
    border-color: #64748b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .nav-links a {
    color: #cbd5e1;
}

body.dark-mode .nav-links a:hover {
    color: #60a5fa;
}

/* User Menu consistency */
body.dark-mode .user-menu-btn {
    color: #ffffff !important;
}

/* =========================================
   CONSISTENT HEADER BUTTONS (DARK MODE)
   Matching "Contact" / "Add Eyes" style
   ========================================= */

/* 1. Studio Link */
body.dark-mode .studio-link,
body.dark-mode .studio-nav-link {
    background: #334155 !important;
    border: 1px solid #475569 !important;
    color: white !important;
    box-shadow: none !important;
}
body.dark-mode .studio-link:hover,
body.dark-mode .studio-nav-link:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}
body.dark-mode .studio-link .studio-icon,
body.dark-mode .studio-nav-link .studio-icon {
    filter: brightness(0) invert(1); /* Make black icon white */
}
body.dark-mode .studio-link .studio-text,
body.dark-mode .studio-nav-link .studio-text {
    color: white !important;
}

/* 2. History Link */
body.dark-mode .history-link {
    background: #334155 !important;
    border: 1px solid #475569 !important; /* Add border to match others */
    color: white !important;
    box-shadow: none !important;
}
body.dark-mode .history-link:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    color: white !important;
}

/* 3. User Badge Icon Container */
/* The icon is inside a div within the anchor */
body.dark-mode .user-badge > div {
    background: #334155 !important;
    border: 1px solid #475569 !important;
    color: white !important;
}
body.dark-mode .user-badge:hover > div {
    background: #475569 !important;
    border-color: #64748b !important;
}
body.dark-mode .user-badge .user-email-text {
    color: #f1f5f9 !important;
}

/* 4. Cart Link */
body.dark-mode .cart-link {
    background: #334155 !important;
    border: 1px solid #475569 !important;
    color: white !important;
    box-shadow: none !important;
}
body.dark-mode .cart-link:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    transform: translateY(-2px);
}
body.dark-mode .cart-link .cart-icon {
    color: white !important;
}

/* 5. Auth/Login Link */
body.dark-mode .auth-link {
    background: #334155 !important;
    border: 1px solid #475569 !important;
    color: white !important;
    box-shadow: none !important;
}
body.dark-mode .auth-link:hover {
    background: #475569 !important;
    border-color: #64748b !important;
    transform: translateY(-2px);
}
body.dark-mode .auth-link .auth-icon,
body.dark-mode .auth-link .auth-text {
    color: white !important;
}

body.dark-mode .site-header .logo {
    color: #f1f5f9;
}

body.dark-mode .nav-links a {
    color: #cbd5e1;
}

body.dark-mode .nav-links a:hover {
    color: #60a5fa;
}

body.dark-mode .user-menu-btn {
    color: #cbd5e1;
}
