:root {
  --primary-color: #2c3e50; /* Dark Blue - Classic/Corporate Main */
  --secondary-color: #34495e; /* Deep Gray - Modern Sidebar */
  --accent-color: #3498db; /* Soft Blue - Creative Accent */
  --text-color: #333;
  --bg-color: #f4f4f4;
  --elegant-color: #4A4E69; /* Muted Navy/Gray for Elegant */
  --light-gray: #e9ecef; /* Neutral background/border color */
}

.bg-accent-color {
  background-color: var(--accent-color);
}
#generated-cv-container {
    padding: 20px;
    background-color: #f0f2f5; /* Light gray background for the page */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
}
/* -------------------------------------- */
/* TEMPLATE STYLES - Optimized Sections   */
/* -------------------------------------- */

/* --- GLOBAL CV CONTAINER BASE --- */
/* -------------------------------------- */
/* TEMPLATE STYLES - Optimized Sections   */
/* -------------------------------------- */

/* --- GLOBAL CV CONTAINER BASE --- */


/* -------------------------------------- */
/* PROGRESS BAR & GENERAL UI (Kept)       */
/* -------------------------------------- */

.progress-bar-container {
    max-width: 100%;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.step-icon-container {
    position: relative;
    width: 40px;
    height: 40px;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #9e9e9e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
    position: absolute;
}

.step-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4caf50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: #9e9e9e;
    transition: all 0.3s ease;
    font-weight: 500;
}

.progress-connector {
    flex-grow: 1;
    height: 2px;
    background-color: #e0e0e0;
    margin: 0 -10px;
    position: relative;
    top: -20px;
    transition: background-color 0.3s ease;
}

/* Active state */
.progress-step.active .step-icon {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.progress-step.active .step-label {
    color: var(--accent-color);
    font-weight: bold;
}

/* Completed state */
.progress-step.completed .step-icon {
    opacity: 0;
    transform: scale(0);
}

.progress-step.completed .step-check {
    opacity: 1;
    transform: scale(1);
}

.progress-step.completed .step-label {
    color: #4caf50;
}

.progress-step.completed + .progress-connector {
    background-color: #4caf50;
}

/* Accordion Styles */
.accordion-toggle.active i {
    transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .progress-bar-container .flex {
        flex-wrap: wrap;
        justify-content: center;
    }

    .progress-step {
        margin: 10px;
    }

    .step-label {
        display: none;
    }

    .progress-connector {
        display: none;
    }
/* Testimonials Section Fix */
.testimonials-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
}
@media (min-width: 768px) {
    .testimonials-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .testimonials-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

.testimonials-container .bg-white {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: fit-content;
    min-height: 280px;
}

.testimonials-container .bg-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Remove the old testimonial-slider styles that might be causing issues */
.testimonial-slider {
    display: none;
}

/* Ensure proper spacing */
.testimonials-container .flex-grow {
    flex-grow: 1;
}

/* Star rating alignment */
.testimonials-container .flex.text-yellow-400 {
    margin-top: auto;
}
/* Why Choose Us Section Styles */
.why-choose-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.why-choose-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    transition: left 0.3s ease;
}

.why-choose-card:hover::before {
    left: 0;
}

.why-choose-card .icon-container {
    position: relative;
    transition: all 0.3s ease;
}

.why-choose-card:hover .icon-container {
    transform: scale(1.1);
}

.why-choose-card .icon-container::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.why-choose-card:hover .icon-container::after {
    opacity: 1;
}

/* Enhanced hover effects */
.why-choose-card:hover {
    border-color: var(--accent-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .why-choose-card {
        margin-bottom: 1rem;
    }
    
    .why-choose-card:hover {
        transform: translateY(-5px) !important;
    }
}

/* Optional: Add a subtle pulse animation on hover */
@keyframes subtlePulse {
    0% { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 10px 25px rgba(52, 152, 219, 0.15); }
    100% { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
}

.why-choose-card:hover {
    animation: subtlePulse 2s infinite;
}


/* updated css code */
/* ============================================= */
/* ROOT VARIABLES & GLOBAL STYLES                */
/* ============================================= */
:root {
  /* Modern Color Palette */
  --primary-blue: #2563eb;
  --primary-purple: #7c3aed;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --secondary-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  
  /* Neutral Colors */
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --text-light: #9ca3af;
  --bg-white: #ffffff;
  --bg-gray: #f8fafc;
  --bg-blue: #eff6ff;
  --bg-purple: #faf5ff;
  
  /* Accent Colors */
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================= */
/* GLOBAL RESET & BASE STYLES                    */
/* ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  overflow-x: hidden;
}

/* ============================================= */
/* TYPOGRAPHY & TEXT STYLES                      */
/* ============================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

p {
  margin-bottom: 1rem;
  color: var(--text-gray);
}

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

/* ============================================= */
/* LAYOUT & CONTAINER STYLES                     */
/* ============================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-padding {
  padding: 5rem 0;
}

@media (max-width: 768px) {
  .section-padding {
    padding: 3rem 0;
  }
}

/* ============================================= */
/* BUTTON & CTA STYLES                           */
/* ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--secondary-gradient);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* ============================================= */
/* CARD COMPONENTS                               */
/* ============================================= */
.feature-card {
  background: var(--bg-white);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
  border-color: rgba(99, 102, 241, 0.2);
}

.step-card {
  position: relative;
  padding: 2rem 1rem;
}

.testimonial-card {
  background: var(--bg-white);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  transition: all var(--transition-normal);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ============================================= */
/* NAVIGATION & HEADER STYLES                    */
/* ============================================= */
.header-scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-gray);
  transition: all var(--transition-normal);
  border-radius: var(--radius-md);
}

.nav-link:hover {
  color: var(--primary-blue);
  background: rgba(37, 99, 235, 0.05);
}

.nav-link.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--primary-blue);
  border-radius: 2px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--text-gray);
  transition: all var(--transition-normal);
  border-radius: var(--radius-lg);
  border-left: 4px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-blue);
  border-left-color: var(--primary-blue);
}

/* ============================================= */
/* ANIMATIONS & KEYFRAMES                        */
/* ============================================= */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.05);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -15px, 0);
  }
  70% {
    transform: translate3d(0, -10px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* ============================================= */
/* UTILITY CLASSES                               */
/* ============================================= */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 2s infinite;
}

.animation-delay-2000 {
  animation-delay: 2s;
}

.animation-delay-4000 {
  animation-delay: 4s;
}

.backdrop-blur-glass {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-border {
  position: relative;
  background: linear-gradient(white, white) padding-box,
              var(--primary-gradient) border-box;
  border: 2px solid transparent;
}

/* ============================================= */
/* HERO SECTION SPECIFIC STYLES                  */
/* ============================================= */
.hero-background {
  position: relative;
  overflow: hidden;
}

.hero-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  animation: pulse-glow 8s ease-in-out infinite;
}

/* ============================================= */
/* FEATURE ICON STYLES                           */
/* ============================================= */
.feature-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  border-radius: inherit;
  z-index: 1;
}

.feature-icon i {
  position: relative;
  z-index: 2;
}

.feature-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

/* ============================================= */
/* STEP INDICATOR STYLES                         */
/* ============================================= */
.step-indicator {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--secondary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  position: absolute;
  top: -8px;
  right: -8px;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

/* ============================================= */
/* TESTIMONIAL AVATAR STYLES                     */
/* ============================================= */
.testimonial-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ============================================= */
/* RATING STARS STYLES                           */
/* ============================================= */
.rating-stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.rating-stars i {
  color: #fbbf24;
}

/* ============================================= */
/* PROGRESS BAR STYLES                           */
/* ============================================= */
.progress-container {
  width: 100%;
  background: rgba(229, 231, 235, 0.5);
  border-radius: 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 8px;
  background: var(--primary-gradient);
  border-radius: 1rem;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ============================================= */
/* FORM & INPUT STYLES                           */
/* ============================================= */
.form-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: all var(--transition-normal);
  background: var(--bg-white);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* ============================================= */
/* RESPONSIVE DESIGN                             */
/* ============================================= */
@media (max-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  h1 {
    font-size: clamp(2.25rem, 4vw, 3.5rem);
  }
  
  h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
  
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .feature-card,
  .testimonial-card {
    padding: 1.5rem;
  }
  
  .feature-icon {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  .section-padding {
    padding: 2rem 0;
  }
}

/* ============================================= */
/* ACCESSIBILITY & FOCUS STYLES                  */
/* ============================================= */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.focus-visible:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ============================================= */
/* PRINT STYLES                                  */
/* ============================================= */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .btn, .nav-link, .mobile-menu {
    display: none !important;
  }
}



/* ============================================= */
/* CUSTOM SCROLLBAR                              */
/* ============================================= */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* ============================================= */
/* LOADING ANIMATIONS                            */
/* ============================================= */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================= */
/* UTILITY CLASSES FOR MARGINS & PADDING         */
/* ============================================= */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* template file css */
:root {
  --primary-color: #2c3e50; /* Dark Blue - Classic/Corporate Main */
  --secondary-color: #34495e; /* Deep Gray - Modern Sidebar */
  --accent-color: #3498db; /* Soft Blue - Creative Accent */
  --text-color: #333;
  --bg-color: #f4f4f4;
  --elegant-color: #4A4E69; /* Muted Navy/Gray for Elegant */
  --light-gray: #e9ecef; /* Neutral background/border color */
}

.bg-accent-color {
  background-color: var(--accent-color);
}
#generated-cv-container {
    padding: 20px;
    background-color: #f0f2f5; /* Light gray background for the page */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align content to the top */
}
/* -------------------------------------- */
/* TEMPLATE STYLES - Optimized Sections   */
/* -------------------------------------- */

/* --- GLOBAL CV CONTAINER BASE --- */
#preview-content-wrapper {
    max-width: 8.5in; /* Standard CV width */
    min-height: 11in; /* Standard CV height */
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 0;
    line-height: 1.5;
    background-color: white; /* Ensure white background for PDF export */
}

/* General Layout Fixes for Readability and Consistency */
#preview-content-wrapper * {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

#preview-content-wrapper .mb-4 { margin-bottom: 0.8rem !important; }
#preview-content-wrapper .mb-6 { margin-bottom: 1.2rem !important; }
#preview-content-wrapper h3 { margin-bottom: 0.8rem !important; padding-bottom: 0.3rem !important; }
#preview-content-wrapper h2 { font-size: 18pt !important; }
#preview-content-wrapper h3 { font-size: 14pt !important; }
#preview-content-wrapper h4 { font-size: 12pt !important; }


/* Fix for two-column templates' flex basis/PDF printing */
.template-modern .md\:w-1\/3, .template-modern .md\:w-2\/3,
.template-creative .md\:w-2\/5, .template-creative .md\:w-3\/5,
.template-elegant .md\:w-2\/5, .template-elegant .md\:w-3\/5 {
    flex-basis: auto !important;
    width: 100% !important; 
}
@media (min-width: 768px) {
    .template-modern .md\:w-1\/3 { width: 33.333333% !important; flex-basis: 33.333333% !important; }
    .template-modern .md\:w-2\/3 { width: 66.666667% !important; flex-basis: 66.666667% !important; }
    .template-creative .md\:w-2\/5, .template-elegant .md\:w-2\/5 { width: 40% !important; flex-basis: 40% !important; }
    .template-creative .md\:w-3\/5, .template-elegant .md\:w-3\/5 { width: 60% !important; flex-basis: 60% !important; }
}


/* --- Classic Template --- */
.template-classic {
    font-family: 'Garamond', serif;
    padding: 30px;
}
.template-classic header {
    background-color: var(--primary-color);
}
/* This wrapper handles the full-bleed area on the web view */
.template-classic .header-wrapper {
    margin: -30px -30px 30px -30px;
}
.template-classic main h3 {
    color: var(--primary-color);
    font-variant: small-caps;
    letter-spacing: 1.5px;
    margin-top: 15px;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 0.3rem;
    margin: 1.2rem 0 0.8rem 0 !important;
    font-size: 1.3rem;
}

/* --- Modern Template --- */
.template-modern { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.template-modern .border-r { border-color: var(--light-gray); }
.template-modern h4.border-b-2 { border-color: var(--secondary-color); }
.template-modern .md-col-span-2 h3 { color: var(--secondary-color); font-weight: 600; }

/* --- Creative Template --- */
.template-creative { font-family: 'Montserrat', sans-serif; }
.template-creative .bg-accent-color { background-color: var(--accent-color); }
.template-creative .bg-accent-color h4 { border-bottom: 1px solid rgba(255,255,255,0.4); }

/* --- Professional Template --- */
.template-professional { font-family: 'Inter', sans-serif; padding: 40px; }
.template-professional header { border-color: var(--primary-color); }
.template-professional main h3 { color: var(--primary-color); font-weight: 700; }

/* --- Minimalist Template --- */
.template-minimalist { font-family: 'Helvetica Neue', Arial, sans-serif; box-shadow: none; padding: 40px; }
.template-minimalist h2 { font-weight: 300; }
.template-minimalist h3 { text-transform: uppercase; font-weight: 500; font-size: 1.3rem; }

/* --- Elegant Template --- */
.template-elegant { font-family: 'Playfair Display', Georgia, serif; padding: 30px; }
.template-elegant h2 { color: var(--elegant-color); }
.template-elegant h3 { color: var(--elegant-color); font-weight: 900; letter-spacing: 1px; }

/* --- Corporate Template --- */
.template-corporate { font-family: 'Times New Roman', Times, serif; padding: 40px; }
.template-corporate header { border-color: var(--primary-color); }
.template-corporate h3 { color: var(--primary-color); font-weight: 700; text-transform: uppercase; margin-top: 25px; margin-bottom: 15px !important; }

/* --- Bold Template (Full-Bleed header) --- */
.template-bold { font-family: 'Roboto', Arial, sans-serif; padding: 30px; }
/* This wrapper handles the full-bleed area on the web view */
.template-bold .header-wrapper { 
    padding: 15px 30px; 
    margin: -30px -30px 30px -30px; /* Extends header to edges */
}
.template-bold header h2 { font-size: 3rem; letter-spacing: 2px; text-transform: uppercase; }
.template-bold main h3 {
    color: var(--accent-color);
    border-bottom: 4px solid var(--accent-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

/* --- Simple Template --- */
.template-simple { font-family: 'Georgia', serif; padding: 40px; border: 1px dashed #ccc; }
.template-simple header { padding-bottom: 10px; border-bottom: 2px solid var(--text-color); }
.template-simple header h2 { font-size: 2.5rem; font-weight: 700; }
.template-simple main h3 {
    color: var(--text-color);
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 3px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}


/* ======================================================= */
/* --- CRITICAL GLOBAL PRINT OVERRIDE FOR PDF FLOW FIX --- */
/* ======================================================= */
@media print {
    /* 1. Global Reset for the CV container */
    #preview-content-wrapper {
        margin: 0 !important;
        box-shadow: none !important;
        /* Force page-break to happen only inside main flow */
        page-break-after: avoid !important;
    }
    
    /* 2. Fix for Classic/Bold (Negative Margin Headers) */
    .template-classic .header-wrapper, 
    .template-bold .header-wrapper {
        /* CRITICAL: Remove negative margins in print mode */
        margin: 0 !important; 
        
        /* Set a safe, predictable top margin for the header content itself */
        padding-top: 15px !important; 
        padding-bottom: 15px !important;
        
        /* Ensure it always stays with the next element */
        page-break-after: avoid !important;
    }
    
    .template-classic, .template-bold {
        /* Remove template-level padding that was conflicting with the negative margin */
        padding: 0 !important; 
    }

    .template-classic main, .template-bold main {
        /* Add back the side padding for content and remove top margin */
        padding-left: 30px !important;
        padding-right: 30px !important;
        padding-top: 15px !important; /* Small gap after header */
        margin-top: 0 !important; 
        page-break-before: avoid !important;
    }
    
    /* 3. General Fix for Single-Column Templates (Professional, Corporate, Simple, Minimalist) */
    /* These rely on the template's main padding, but need margin/break control */
    .template-professional header,
    .template-corporate header,
    .template-simple header,
    .template-minimalist header {
        margin-bottom: 0.5rem !important; /* Reduce space after header slightly */
        page-break-after: avoid !important;
    }
    
    .template-professional main,
    .template-corporate main,
    .template-simple main,
    .template-minimalist main {
        margin-top: 0 !important;
        padding-top: 0 !important;
        page-break-before: avoid !important;
    }
    
    /* 4. Fix for Two-Column Templates (Creative, Modern, Elegant) */
    .template-creative .md\:w-2\/5, .template-elegant .md\:w-2\/5 {
        page-break-after: avoid !important;
    }
    
    .page-break-avoid {
        page-break-inside: avoid !important;
    }

    /* Standard print resets */
    .fixed.bottom-4.right-4 { display: none !important; }
    body, #generated-cv-container { background: white !important; padding: 0 !important; margin: 0 !important; }
}