/**
 * CV Maker Styles
 */

:root {
  --header-h: 64px;
  --sidebar-w: 420px;
}

.builder-app {
  display: flex;
  background: #f1f5f9;
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* Sidebar */
.builder-sidebar {
  width: var(--sidebar-w);
  background: white;
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  z-index: 10;
}

.builder-sidebar__scroll {
  height: 100%;
  overflow-y: auto;
  padding: 32px;
}

.sidebar-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.template-btn {
  padding: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.template-btn:hover { border-color: var(--primary); background: #f0fdf4; }

.template-btn .mini-resume {
  width: 100%;
  aspect-ratio: 1 / 1.4;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.template-btn.active {
  background: #f0fdf4;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Input Styles */
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 12px; font-weight: 700; color: var(--gray-500); margin-bottom: 6px; }
.input-group input, .input-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input:focus, .input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.input-group textarea { height: 100px; resize: vertical; }

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Dynamic List Styles */
.dynamic-item {
  background: #ffffff;
  padding: 20px 16px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  position: relative;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dynamic-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}

.dynamic-item input, .dynamic-item textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #334155;
  outline: none;
  transition: all 0.2s;
}

.dynamic-item input:focus, .dynamic-item textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dynamic-item textarea {
  height: 80px;
  resize: vertical;
}

.btn-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #ef4444;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.2s;
  z-index: 2;
  line-height: 1;
}

.btn-remove:hover {
  background: #fee2e2;
  transform: scale(1.1);
}

.btn-add {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-add:hover {
  background: #dbeafe;
}
.btn-add:focus-visible {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}

/* ── Color Picker ── */
.color-picker-section {
  padding-bottom: 20px;
}

.color-swatches-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  outline: none;
  padding: 0;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
  transform: scale(1.12);
}

#custom-color-input {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  padding: 0;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  transition: transform 0.15s;
  overflow: hidden;
}
#custom-color-input:hover { transform: scale(1.15); }

/* Section header flex row */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-header .sidebar-title { margin-bottom: 0; }

/* Preview Area */
.builder-preview {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.preview-container {
  background: #f1f5f9; /* Gray background behind the 'page' */
  padding: 40px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.hidden { display: none !important; }

.step-view {
  min-height: calc(100vh - 80px);
  background: #f8fafc;
  display: block;
}

.cv-page {
  background: white;
  width: 210mm;
  min-height: 297mm;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  color: #334155;
  line-height: 1.5;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

/* ── CV TEMPLATES ── */

/* 1. Modern */
.cv-template-modern h1 { font-size: 32px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.cv-template-modern .title { font-size: 18px; color: var(--primary); font-weight: 600; margin-bottom: 20px; }
.cv-template-modern section { margin-bottom: 24px; }
.cv-template-modern h2 { font-size: 14px; font-weight: 800; text-transform: uppercase; border-bottom: 2px solid #e2e8f0; padding-bottom: 4px; margin-bottom: 12px; }

/* Template Filtering & Swatches */
.template-filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 50px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.filter-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.photo-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.template-badge-float {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    display: flex;
    gap: 5px;
}

.badge-pdf, .badge-docx {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.badge-pdf { background: #ef4444; }
.badge-docx { background: #3b82f6; }

.template-swatches {
    display: flex;
    gap: 8px;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.swatch.active {
    border-color: #fff;
    outline: 2px solid var(--primary);
    transform: scale(1.1);
}

.cat-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    text-transform: uppercase;
}

.cat-badge--pro { background: #e0e7ff; color: #4338ca; }
.cat-badge--modern { background: #dcfce7; color: #15803d; }
.cat-badge--ats { background: #fff7ed; color: #c2410c; }

.template-card__info {
    padding: 15px;
}

.info-top, .info-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-top { margin-bottom: 10px; }

/* Mini Resume Refinement - Making it look FULL and Professional */
.mini-resume-content {
    background: #fff;
    width: 100%;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
    overflow: hidden;
    pointer-events: none;
    --primary: #2563eb;
    display: flex;
    flex-direction: column;
}

.mini-name {
    font-size: 18px;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 2px;
    line-height: 1.2;
}

.mini-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.mini-section-title {
    font-size: 10px;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    border-bottom: 1.5px solid #f1f5f9;
    padding-bottom: 4px;
    margin-bottom: 10px;
    margin-top: 15px;
}

.mini-text {
    font-size: 10px;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 8px;
}

.mini-resume-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Template Card Animation */
.template-card {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.template-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.mini-contact-item {
    font-size: 8px;
    color: #94a3b8;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Skill Progress Bars for Previews */
.mini-skill-bar {
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
    margin-top: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.mini-skill-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

/* 2. Executive */
.cv-template-executive { font-family: 'Playfair Display', serif; }
.cv-template-executive h1 { text-align: center; font-size: 36px; border-bottom: 1px solid #000; padding-bottom: 10px; }
.cv-template-executive .contact-bar { text-align: center; font-size: 12px; margin: 10px 0 30px; font-family: 'Inter', sans-serif; }

/* 3. Tech */
.cv-template-tech { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.cv-template-tech h1 { background: #0f172a; color: white; padding: 10px; display: inline-block; }
.cv-template-tech h2 { color: #38bdf8; border-left: 4px solid #38bdf8; padding-left: 10px; }

/* General CV components */
.cv-item { margin-bottom: 16px; }
.cv-item-header { display: flex; justify-content: space-between; font-weight: 700; color: #0f172a; }
.cv-item-sub { font-size: 13px; color: #64748b; font-style: italic; margin-bottom: 4px; }
.cv-item-desc { font-size: 14px; color: #475569; }

.skills-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.skill-tag { background: #f1f5f9; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* Footer Action */
.preview-footer {
  position: sticky;
  bottom: 0;
  width: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 100;
  border-top: 1px solid var(--border);
}

/* ── TEMPLATE GALLERY (Landing Page) ── */
.template-section { padding: 100px 0; background: white; }

/* --- TEMPLATE SELECTION ENHANCEMENTS --- */
.template-filter-bar {
  background: white;
  padding: 12px 24px;
  border-radius: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0 auto 40px;
  width: max-content;
  max-width: 95%;
  flex-wrap: wrap;
  border: 1px solid #f1f5f9;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-item:hover, .filter-item.active {
  background: #f1f5f9;
  color: var(--primary);
}

.filter-item.active {
  background: #eff6ff;
  color: var(--primary);
}

.photo-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid #e2e8f0;
  margin-left: 10px;
}

/* Enhanced Template Card Grid */
.template-grid-visual {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  padding: 20px 0;
}

.template-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

.template-badge-float {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 6px;
  z-index: 5;
}

.badge-pdf, .badge-docx {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.template-overlay {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: all 0.3s ease;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.template-card:hover .template-overlay {
  opacity: 1;
}

.btn-start-template {
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
  background: var(--primary);
  color: white;
  cursor: pointer;
  border: none;
}

.template-card:hover .btn-start-template {
  transform: translateY(0);
}

/* Real-looking Mini Resume */
.mini-resume-content {
  padding: 20px;
  height: 100%;
  font-family: 'Inter', sans-serif;
}

.mini-name { font-size: 14px; font-weight: 800; color: #1e293b; margin-bottom: 2px; }
.mini-title { font-size: 10px; color: var(--primary); font-weight: 600; margin-bottom: 12px; }
.mini-section-title { font-size: 9px; font-weight: 700; color: #64748b; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #f1f5f9; padding-bottom: 2px; }
.mini-text-block { margin-bottom: 12px; }
.mini-text { font-size: 8px; color: #94a3b8; line-height: 1.5; margin-bottom: 4px; }

/* Color Swatches */
.template-swatches {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px #e2e8f0;
  transition: transform 0.2s;
}

.swatch:hover { transform: scale(1.2); }
.swatch.active { box-shadow: 0 0 0 1px var(--primary); }

/* Category Badges */
.cat-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}

.cat-badge--modern { background: #f0f9ff; color: #0ea5e9; }
.cat-badge--ats { background: #f0fdf4; color: #22c55e; }
.cat-badge--pro { background: #fef2f2; color: #ef4444; }

.template-card__info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.template-preview-box {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297; /* A4 aspect ratio */
  background: #f8fafc;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.dynamic-preview-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px; /* Standard A4 width in pixels at 96dpi */
  transform-origin: top left;
  pointer-events: none; /* Let clicks pass through to overlay */
  background: white;
}

/* --- Builder UI Scaling --- */
@media (max-width: 1024px) {
  .builder-app { flex-direction: column; height: auto; min-height: auto; }
  .builder-sidebar { width: 100%; height: auto; position: static; }
  .builder-preview { padding: 20px 10px; overflow-x: auto; width: 100%; }
  .preview-container { 
    transform: scale(0.35); 
    margin: -350px 0;
  }
  .preview-footer {
    position: fixed;
    bottom: 0;
    padding: 15px;
    background: var(--white);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 100;
  }
  .template-grid-visual { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .template-filter-bar { padding: 8px 12px; gap: 10px; }
  .photo-toggle { border: none; margin: 0; padding: 0; }
}

@media (max-width: 480px) {
  .preview-container { 
    transform: scale(0.28); 
    margin: -450px 0;
  }
}
/* Template Preview Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    height: 90vh;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: #f8fafc;
    display: flex;
    justify-content: center;
}

.modal-preview-canvas {
    background: white;
    width: 210mm;
    min-height: 297mm;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 20mm;
    transform: scale(0.85);
    transform-origin: top center;
}

.btn-close-modal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Template Card Preview Button */
.template-card-actions {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 15;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Mobile UI Helpers */
@media (max-width: 992px) {
  .builder-sidebar.hidden-mobile { display: none !important; }
  .builder-preview.visible-mobile { 
    display: block !important; 
    padding: 20px 10px !important;
  }
  .builder-preview.visible-mobile .preview-container {
    padding: 0 !important;
    transform: none !important;
  }
}

.photo-upload-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.photo-preview-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #f1f5f9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-controls {
  flex: 1;
}

.template-card:hover .template-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.btn-preview-trigger {
    background: white;
    color: #1e293b;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-preview-trigger:hover {
    background: #f8fafc;
    transform: scale(1.05);
}

.btn-select-trigger {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
    transition: all 0.2s;
}

.btn-select-trigger:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}

@media (max-width: 1024px) {
    .modal-content { height: 100vh; border-radius: 0; width: 100%; }
    .modal-preview-canvas { transform: scale(0.4); margin: -400px 0; }
    
    .mobile-bottom-nav {
      display: grid;
    }
    
    .mobile-floating-btn {
      display: flex;
    }
    
    /* Hide desktop sidebar/preview based on state */
    .builder-app {
      padding-bottom: 64px; /* Space for bottom nav */
    }
    
    .builder-sidebar {
      width: 100% !important;
      border-right: none !important;
    }
    
    .builder-preview {
      width: 100% !important;
      display: none; /* Initial state on mobile is edit */
    }
    
    .preview-footer {
      display: none !important;
    }
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: white;
  display: none; /* Hidden by default on desktop */
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  z-index: 1000;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.mobile-nav-btn.active {
  color: var(--primary);
}

/* --- Floating Download Button --- */
.mobile-floating-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--primary);
  color: white;
  border: none;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
  z-index: 999;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
