/* Dark Yellow, White, Black, Dark Gray Theme */
:root {
    --primary: #b91c1c;           /* Dark Yellow */
    --primary-dark: #991b1b;      /* Darker Yellow Hover */
    --bg-dark: #f9fafb;           /* Deep Black background */
    --bg-card: #ffffff;           /* Dark Gray card surface */
    --bg-card-hover: #f3f4f6;     /* Slightly lighter Dark Gray */
    --bg-light: #ffffff;          /* Dark Gray editor/preview bg */
    --text-primary: #111827;      /* White text */
    --text-muted: #4b5563;        /* Light muted gray text */
    --border-muted: #e5e7eb;      /* Dark gray borders */
    --radius: 0.5rem;
    --transition: all 0.25s ease;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --shadow-card: 0 4px 14px rgba(0,0,0,0.5);
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.4);
    /* Resume-specific tokens */
    --resume-primary: #b91c1c;
    --paper-aspect: 8.5/13; /* Long bond (8.5" x 13") aspect ratio */

    --resume-primary-light: #ef4444;
    --resume-border: #e5e7eb;
}

/* Mobile mini preview scaling */
.preview-glass-mobile {
    width: 100%;
    max-width: 100% !important;
    padding: 10mm;
    overflow: visible;
    margin: 0 auto;
}




* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

body {
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
    font-size: 1rem;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 1.5rem;
    background: linear-gradient(135deg, #09090B 0%, #18181B 50%, #27272A 100%);
    border-bottom: 1px solid var(--border-muted);
    color: white;
}
.hero h1 { font-size: 2.75rem; margin-bottom: 1rem; color: var(--text-primary); font-weight: 800; }
.hero p { font-size: 1.125rem; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; color: var(--text-muted); }

/* Wizard Layout */
.builder {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: #f9fafb;
}

.steps-progress {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-muted);
}
.steps-progress button {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.steps-progress button:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}
.steps-progress button.active { background: var(--primary); color: #ffffff;
    font-weight: 700;
    border-color: var(--primary);
}

.editor-panel {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-right: 1px solid var(--border-muted);
}

/* Resume Document Visibility & Highlighted Name */
.resume-preview {
    color: #1e293b !important;
    background-color: #ffffff !important;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 0;
    width: 816px !important;
    min-height: 1248px;
    margin: 0 auto;
    text-align: left;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
    transition: transform 0.25s ease;
}

.resume-preview h1 {
    color: #0f172a !important;
    font-size: 2.25rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.025em !important;
    margin-bottom: 0.35rem !important;
    line-height: 1.15 !important;
}

.resume-preview p,
.resume-preview span,
.resume-preview div,
.resume-preview li,
.resume-preview td {
    color: inherit;
}

.preview-glass {
    width: 100%;
    max-width: 850px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.input-group label { font-weight: 600; color: var(--text-primary); font-size: 0.875rem; }
.input-group input,
.input-group textarea,
.input-group select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-muted);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-primary);
    background: #ffffff;
    transition: var(--transition);
}
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.3);
}
.helper-text { font-size: 0.875rem; color: var(--text-muted); }

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.template-card {
    border: 2px solid var(--border-muted);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: var(--transition);
}
.template-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}
.template-card.active {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 12px rgba(185, 28, 28, 0.4);
}

.nav-buttons { 
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--border-muted);
    padding: 1rem 0;
    z-index: 30;
    display: flex; 
    justify-content: space-between; 
    margin-top: auto; 
}
.btn-primary { background: var(--primary); color: #000000; border: none; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 700; cursor: pointer; transition: var(--transition); }
.btn-primary:hover { background: var(--primary-dark); color: var(--text-primary); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.main-footer {
    background-color: #09090B;
    border-top: 1px solid var(--border-muted);
    color: var(--text-muted);
}

/* Mobile & Tablet Responsive Mini Preview */
@media (max-width: 1024px) {
  .builder { flex-direction: column; }
  .editor-panel, .preview-panel { width: 100%; border-right: none; }
  .steps-progress { justify-content: flex-start; }

  .preview-panel {
    padding: 0.75rem 0.25rem;
    overflow-x: hidden;
  }

  .preview-glass {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
}

/* Print settings */
@media print {
  @page {
    margin: 0;
  }
  body, html {
    background: #ffffff !important;
    width: 100% !important;
    min-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide non-essential UI elements */
  .no-print,
  header,
  nav,
  footer,
  .main-footer,
  .hero,
  .editor-panel,
  .nav-buttons,
  .steps-progress,
  #steps-progress-mobile,
  #download-pdf-btn,
  .p-4.bg-gray-100:has(p),
  .preview-panel > .no-print,
  .preview-panel > span {
    display: none !important;
  }

  /* Show the builder and preview panel */
  .builder {
    display: block !important;
    border: none !important;
    background: transparent !important;
  }
  .builder > * {
    border: none !important;
  }
  .preview-panel {
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: none !important;
  }

  /* Ensure preview glass is visible and unstyled */
  .preview-glass,
  .preview-glass-mobile {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    transform: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Resume preview: fixed width to preserve layout on mobile print, no decorative styling */
  .resume-preview {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    aspect-ratio: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    page-break-inside: avoid !important;
  }

  /* Ensure generated template inner divs fill the full width */
  .resume-preview > [class^="template-"] {
    width: 100% !important;
    box-shadow: none !important;
  }

  /* Hide the SEO content section below the builder */
  section.no-print {
    display: none !important;
  }
}

/* ========================================================
   Theme Utility Fallbacks & UI Element Styling
   Ensures buttons, colors, and headers always render perfectly
   ======================================================== */
.bg-dark-yellow { background-color: #b91c1c !important; color: #ffffff !important; }
.bg-dark-yellow:hover,
.hover\:bg-dark-yellow-hover:hover {
  background-color: #991b1b !important;
  color: #FFFFFF !important;
}
.text-dark-yellow {
  color: #b91c1c !important;
}
.bg-dark-gray {
  background-color: #f9fafb !important;
}
.bg-dark-gray-light {
  background-color: #f3f4f6 !important;
}
.border-dark-gray-light {
  border-color: #e5e7eb !important;
}
.bg-theme-black {
  background-color: #ffffff !important;
}

/* Force Download / Save PDF button visibility and styling */
#download-pdf-btn { background-color: #b91c1c !important; color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border: none !important;
  outline: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#download-pdf-btn:hover {
  background-color: #991b1b !important;
  color: #FFFFFF !important;
  transform: scale(1.04) !important;
}

#download-pdf-btn svg {
  width: 1rem !important;
  height: 1rem !important;
  color: currentColor !important;
  stroke: currentColor !important;
}
