/* ==========================================================================
   Resume Builder MVP - Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Courier+Prime&display=swap');

:root {
    --bg-dark: #f9fafb;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --success: #10b981;
    --danger: #ef4444;
    --border: #e5e7eb;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --font-sans: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

input, textarea, select {
    font-family: inherit;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

button {
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Layout Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link:hover {
    color: var(--primary);
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: rgba(255,255,255,0.05);
    border-color: var(--text-muted);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}
.btn-danger:hover {
    opacity: 0.9;
}

/* Messages / Alerts */
.messages {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-col: column;
    gap: 12px;
    max-width: 380px;
}

.alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease forwards;
}
.alert-success { border-left-color: var(--success); }
.alert-error, .alert-danger { border-left-color: var(--danger); }
.alert-warning { border-left-color: #f59e0b; }
.alert-info { border-left-color: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Landing Page */
.hero {
    padding: 120px 0 80px 0;
    text-align: center;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 30%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 40px auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    padding: 60px 0;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 10px 30px -10px rgba(99,102,241,0.15);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-muted);
}

/* Authentication Page Styles */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 40px 24px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.1);
    backdrop-filter: blur(16px);
}

.auth-card h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.auth-form .btn-submit {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    font-size: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
}
.auth-footer a:hover {
    text-decoration: underline;
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    display: block;
}

/* Dashboard Styles */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 74px);
    background: #f9fafb;
}

.dashboard-sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.dashboard-main {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
}

.dashboard-header {
    padding: 40px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 36px;
    background: rgba(99,102,241,0.1);
    color: var(--primary);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info h4 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info p {
    font-size: 28px;
    font-weight: 700;
}

.resume-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.resume-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.resume-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.resume-card-preview {
    height: 180px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.resume-card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(99,102,241,0.2);
    border: 1px solid var(--primary);
    color: #a5b4fc;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: capitalize;
}

.resume-card-icon {
    font-size: 48px;
    color: var(--primary);
    opacity: 0.6;
    transition: var(--transition);
}
.resume-card:hover .resume-card-icon {
    transform: scale(1.1);
    opacity: 1;
}

.resume-card-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.resume-card-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.resume-card-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.resume-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: auto;
}

.resume-card-actions form {
    display: inline;
}

/* Builder Workspace Split-Screen */
.builder-layout {
    display: grid;
    grid-template-columns: 45% 55%;
    height: calc(100vh - 66px);
    overflow: hidden;
}

.builder-sidebar {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
    min-height: 0;
}

.builder-sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.builder-sidebar-header input {
    font-size: 18px;
    font-weight: 600;
    border-color: transparent;
    background: transparent;
    padding: 4px 8px;
    width: auto;
    flex-grow: 1;
}

.builder-sidebar-header input:focus {
    background: var(--bg-input);
    border-color: var(--primary);
}

.builder-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

.builder-tabs::-webkit-scrollbar {
    height: 4px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    background: transparent;
}
.tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.builder-form-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 32px 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}
.tab-content.active {
    display: block;
}

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

.section-title {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 700;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid-full {
    grid-column: span 2;
}

/* Dynamic List Items (Education, Experience) */
.list-records {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.record-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    transition: var(--transition);
}

.record-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.btn-remove-record {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-remove-record:hover {
    background: var(--danger);
    color: white;
}

.btn-add-record {
    width: 100%;
    padding: 12px;
    border: 1px dashed var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
}
.btn-add-record:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* Preview Area */
.builder-preview-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.builder-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.builder-preview {
    background: #f3f4f6;
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
}

.preview-container {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 1 / 1.414; /* Standard A4 Aspect Ratio */
    background: white;
    color: #1e293b;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    padding: 40px;
    overflow-y: auto;
    font-size: 14px;
    position: relative;
}

/* Template Customizer Styles */
.templates-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.template-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.template-option:hover {
    border-color: var(--text-muted);
}

.template-option.active {
    border-color: var(--primary);
    background: rgba(99,102,241,0.1);
}

.template-option-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.template-option.active .template-option-icon {
    color: var(--primary);
}

.template-option h5 {
    font-weight: 600;
}

/* ==========================================================================
   RESUME TEMPLATES PREVIEW (RENDERED IN A4 CANVAS)
   ========================================================================== */

/* General Resume Styling inside Container */
.resume-view {
    font-family: 'Outfit', sans-serif;
    color: #1e293b;
    height: 100%;
    /* Ensure long contiguous strings wrap instead of overflowing */
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.resume-view * {
    /* Apply to all children inside the resume view to prevent any specific element from overflowing */
    word-break: break-word;
    overflow-wrap: break-word;
}

.resume-view h2, .resume-view h3, .resume-view h4 {
    color: #0f172a;
}

.resume-view ul {
    list-style-position: inside;
    margin-left: 8px;
}

/* 1. MODERN TEMPLATE */
.template-modern {
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 24px;
    min-height: 100%;
    height: auto;
    margin: 0;
}

.template-modern .sidebar {
    background: #0f172a;
    color: #f8fafc;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.template-modern .sidebar h2 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.template-modern .sidebar h3 {
    color: #a5b4fc;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.template-modern .sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.template-modern .sidebar-contact-item {
    word-break: break-all;
}

.template-modern .main-content {
    padding: 40px 32px 40px 8px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.template-modern .section-header {
    font-size: 16px;
    text-transform: uppercase;
    font-weight: 700;
    color: #4f46e5;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.template-modern .summary-text {
    font-size: 13px;
    color: #475569;
}

.template-modern .timeline-item {
    margin-bottom: 16px;
}

.template-modern .timeline-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
}

.template-modern .timeline-sub {
    font-size: 12px;
    color: #4f46e5;
    margin-bottom: 4px;
}

.template-modern .timeline-desc {
    font-size: 12px;
    color: #475569;
}

.template-modern .skill-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    margin: 3px;
}

.template-modern .lang-item, .template-modern .skill-item {
    font-size: 12px;
}

/* 2. PROFESSIONAL TEMPLATE */
.template-professional {
    font-family: 'Playfair Display', serif;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.template-professional h1 {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: #111827;
    margin-bottom: 4px;
}

.template-professional .contact-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: #4b5563;
    flex-wrap: wrap;
    font-family: 'Outfit', sans-serif;
}

.template-professional .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #1e3a8a;
    border-bottom: 1px solid #1e3a8a;
    padding-bottom: 2px;
    margin-bottom: 12px;
    margin-top: 12px;
}

.template-professional .prof-summary {
    font-size: 12.5px;
    line-height: 1.5;
    color: #374151;
    font-family: 'Outfit', sans-serif;
}

.template-professional .prof-item {
    margin-bottom: 14px;
    font-family: 'Outfit', sans-serif;
}

.template-professional .prof-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13.5px;
    color: #111827;
}

.template-professional .prof-item-sub {
    font-style: italic;
    color: #4b5563;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.template-professional .prof-item-desc {
    font-size: 12px;
    color: #374151;
    white-space: pre-line;
}

.template-professional .skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
}

/* 3. MINIMAL TEMPLATE */
.template-minimal {
    font-family: 'Outfit', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.template-minimal .header-minimal {
    border-bottom: 2px solid #111827;
    padding-bottom: 16px;
}

.template-minimal .header-minimal h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.template-minimal .header-minimal p {
    font-size: 14px;
    color: #4b5563;
    margin-top: 4px;
}

.template-minimal .contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
}

.template-minimal .section-minimal {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 16px;
}

.template-minimal .section-min-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

.template-minimal .section-min-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-minimal .min-summary {
    font-size: 13px;
    line-height: 1.5;
}

.template-minimal .min-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 13.5px;
}

.template-minimal .min-item-sub {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.template-minimal .min-item-desc {
    font-size: 12px;
    color: #4b5563;
}

.template-minimal .min-skills-list {
    font-size: 12.5px;
}

/* 4. CREATIVE TEMPLATE */
.template-creative {
    background-color: #fdfbfb;
    min-height: 100%;
    height: auto;
}
.template-creative .creative-header {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: white;
    padding: 60px 40px;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}
.template-creative .creative-header h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -1px;
}
.template-creative .creative-contacts {
    font-size: 13px;
    opacity: 0.9;
}
.template-creative .creative-body {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 40px;
    padding: 20px 40px;
}
.template-creative .creative-title {
    color: #8b5cf6;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}
.template-creative .creative-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #ec4899;
    border-radius: 2px;
}
.template-creative .creative-section {
    margin-bottom: 32px;
}
.template-creative .creative-item {
    margin-bottom: 20px;
}
.template-creative .creative-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 16px;
    color: #1e293b;
}
.template-creative .creative-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}
.template-creative .creative-item-sub {
    font-size: 14px;
    color: #ec4899;
    font-weight: 600;
    margin-bottom: 6px;
}
.template-creative .creative-item-desc {
    font-size: 13px;
    color: #475569;
}
.template-creative .creative-skill {
    display: inline-block;
    padding: 6px 14px;
    background: #f1f5f9;
    color: #8b5cf6;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 6px 8px 0;
}

/* 5. EXECUTIVE TEMPLATE */
.template-executive {
    font-family: 'Playfair Display', serif;
    padding: 40px;
    color: #000;
    min-height: 100%;
    height: auto;
    background: white;
}
.template-executive .exec-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 24px;
    margin-bottom: 32px;
}
.template-executive .exec-header h1 {
    font-size: 38px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.template-executive .exec-contacts {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.template-executive .exec-section {
    margin-bottom: 28px;
}
.template-executive .exec-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 8px;
    margin-bottom: 16px;
}
.template-executive .exec-item {
    margin-bottom: 20px;
}
.template-executive .exec-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
}
.template-executive .exec-date {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #555;
}
.template-executive .exec-item-sub {
    font-size: 14px;
    font-style: italic;
    color: #333;
    margin-bottom: 6px;
}
.template-executive .exec-item-desc {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    color: #222;
    line-height: 1.6;
}
.template-executive .exec-summary {
    font-family: 'Outfit', sans-serif;
    font-size: 13.5px;
    color: #222;
    line-height: 1.6;
}

/* ==========================================================================
   Print Styles for PDF Generation
   ========================================================================== */
@media print {
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .preview-wrapper {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .resume-view {
        page-break-inside: avoid;
    }
    
    .template-modern {
        height: auto;
        min-height: 100vh;
    }
    
    /* Hide scrollbars during print */
    ::-webkit-scrollbar {
        display: none;
    }
}

/* ==========================================================================
   Template Thumbnail Previews (in selector grid)
   ========================================================================== */

/* Shared thumbnail base */
.tmpl-thumb {
    width: 100%;
    aspect-ratio: 1 / 1.3;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    background: white;
}

.tmpl-thumb .tt-line {
    height: 2px;
    background: #d1d5db;
    border-radius: 1px;
    margin-bottom: 4px;
    width: 100%;
}

/* Modern layout: sidebar + main */
.tmpl-thumb-modern {
    display: grid;
    grid-template-columns: 35% 65%;
}

.tmpl-thumb-modern .tt-sidebar {
    padding: 8px 5px;
}

.tmpl-thumb-modern .tt-main {
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Professional layout: centered name + divider + lines */
.tmpl-thumb-prof {
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tmpl-thumb-prof .tt-name {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tmpl-thumb-prof .tt-divider {
    height: 1px;
    width: 100%;
    margin-bottom: 6px;
}

/* Minimal layout: name + hr + label|content rows */
.tmpl-thumb-minimal {
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tmpl-thumb-minimal .tt-min-name {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.tmpl-thumb-minimal .tt-min-hr {
    height: 2px;
    width: 100%;
    margin-bottom: 6px;
}

.tmpl-thumb-minimal .tt-min-row {
    display: grid;
    grid-template-columns: 28% 72%;
    gap: 4px;
    margin-bottom: 4px;
}

.tmpl-thumb-minimal .tt-min-label {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tmpl-thumb-minimal .tt-min-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Creative layout: colored header + two-column body */
.tmpl-thumb-creative {
    display: flex;
    flex-direction: column;
}

.tmpl-thumb-creative .tt-creative-header {
    height: 30%;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
}

.tmpl-thumb-creative .tt-creative-body {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 6px;
    padding: 6px 8px;
    flex: 1;
}

.tmpl-thumb-creative .tt-creative-body > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Executive layout: centered, classic */
.tmpl-thumb-exec {
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tmpl-thumb-exec .tt-exec-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Playfair Display', serif;
}

.tmpl-thumb-exec .tt-exec-hr {
    height: 2px;
    background: #000;
    margin-bottom: 4px;
}


/* --- Premium Templates Styles --- */

.template-modern2 .sidebar { background: #1e3a8a !important; }
.template-modern2 .sidebar h3 { color: #93c5fd !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern2 .section-header { border-bottom: 2px solid #3b82f6 !important; }
.template-modern2 .timeline-header strong { color: #1e3a8a !important; }

.template-modern3 .sidebar { background: #064e3b !important; }
.template-modern3 .sidebar h3 { color: #6ee7b7 !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern3 .section-header { border-bottom: 2px solid #10b981 !important; }
.template-modern3 .timeline-header strong { color: #064e3b !important; }

.template-modern4 .sidebar { background: #4c1d95 !important; }
.template-modern4 .sidebar h3 { color: #c4b5fd !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern4 .section-header { border-bottom: 2px solid #8b5cf6 !important; }
.template-modern4 .timeline-header strong { color: #4c1d95 !important; }

.template-modern5 .sidebar { background: #7f1d1d !important; }
.template-modern5 .sidebar h3 { color: #fca5a5 !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern5 .section-header { border-bottom: 2px solid #ef4444 !important; }
.template-modern5 .timeline-header strong { color: #7f1d1d !important; }

.template-professional2 h1 { color: #1e3a8a !important;  }
.template-professional2 .section-title { color: #1e3a8a !important; border-bottom-color: #bfdbfe !important;  }
.template-professional2 .prof-item-header strong { color: #1e3a8a !important; }
.template-professional2 { background-color: #eff6ff !important; padding: 20px; }

.template-professional3 h1 { color: #064e3b !important;  }
.template-professional3 .section-title { color: #064e3b !important; border-bottom-color: #a7f3d0 !important;  }
.template-professional3 .prof-item-header strong { color: #064e3b !important; }
.template-professional3 { background-color: #ecfdf5 !important; padding: 20px; }

.template-professional4 h1 { color: #4c1d95 !important;  }
.template-professional4 .section-title { color: #4c1d95 !important; border-bottom-color: #ddd6fe !important;  }
.template-professional4 .prof-item-header strong { color: #4c1d95 !important; }
.template-professional4 { background-color: #f5f3ff !important; padding: 20px; }

.template-professional5 h1 { color: #333333 !important; font-family: 'Playfair Display', serif !important; }
.template-professional5 .section-title { color: #333333 !important; border-bottom-color: #e5e7eb !important; font-family: 'Playfair Display', serif !important; }
.template-professional5 .prof-item-header strong { color: #333333 !important; }
.template-professional5 { background-color: #f9fafb !important; padding: 20px; }

.template-minimal2 h1 { color: #2563eb !important; letter-spacing: 2px !important; }
.template-minimal2 .section-min-title { color: #2563eb !important; border-left: 3px solid #bfdbfe !important; }
.template-minimal2 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal3 h1 { color: #059669 !important; letter-spacing: 2px !important; }
.template-minimal3 .section-min-title { color: #059669 !important; border-left: 3px solid #a7f3d0 !important; }
.template-minimal3 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal4 h1 { color: #7c3aed !important; letter-spacing: 2px !important; }
.template-minimal4 .section-min-title { color: #7c3aed !important; border-left: 3px solid #ddd6fe !important; }
.template-minimal4 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal5 h1 { color: #dc2626 !important; letter-spacing: 2px !important; }
.template-minimal5 .section-min-title { color: #dc2626 !important; border-left: 3px solid #fecaca !important; }
.template-minimal5 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-creative2 .creative-header { background: #3b82f6 !important; border-radius: 0 0 40px 0 !important; }
.template-creative2 .creative-title { color: #1d4ed8 !important; border-bottom: 2px dashed #3b82f6 !important; }
.template-creative2 .creative-skill { border-color: #3b82f6 !important; color: #1d4ed8 !important; background: rgba(0,0,0,0.02) !important; }

.template-creative3 .creative-header { background: #10b981 !important; border-radius: 0 0 40px 0 !important; }
.template-creative3 .creative-title { color: #047857 !important; border-bottom: 2px dashed #10b981 !important; }
.template-creative3 .creative-skill { border-color: #10b981 !important; color: #047857 !important; background: rgba(0,0,0,0.02) !important; }

.template-creative4 .creative-header { background: #8b5cf6 !important; border-radius: 0 0 40px 0 !important; }

/* --- Premium Templates Styles --- */

.template-modern2 .sidebar { background: #1e3a8a !important; }
.template-modern2 .sidebar h3 { color: #93c5fd !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern2 .section-header { border-bottom: 2px solid #3b82f6 !important; }
.template-modern2 .timeline-header strong { color: #1e3a8a !important; }

.template-modern3 .sidebar { background: #064e3b !important; }
.template-modern3 .sidebar h3 { color: #6ee7b7 !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern3 .section-header { border-bottom: 2px solid #10b981 !important; }
.template-modern3 .timeline-header strong { color: #064e3b !important; }

.template-modern4 .sidebar { background: #4c1d95 !important; }
.template-modern4 .sidebar h3 { color: #c4b5fd !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern4 .section-header { border-bottom: 2px solid #8b5cf6 !important; }
.template-modern4 .timeline-header strong { color: #4c1d95 !important; }

.template-modern5 .sidebar { background: #7f1d1d !important; }
.template-modern5 .sidebar h3 { color: #fca5a5 !important; border-bottom-color: rgba(255,255,255,0.2) !important; }
.template-modern5 .section-header { border-bottom: 2px solid #ef4444 !important; }
.template-modern5 .timeline-header strong { color: #7f1d1d !important; }

.template-professional2 h1 { color: #1e3a8a !important;  }
.template-professional2 .section-title { color: #1e3a8a !important; border-bottom-color: #bfdbfe !important;  }
.template-professional2 .prof-item-header strong { color: #1e3a8a !important; }
.template-professional2 { background-color: #eff6ff !important; padding: 20px; }

.template-professional3 h1 { color: #064e3b !important;  }
.template-professional3 .section-title { color: #064e3b !important; border-bottom-color: #a7f3d0 !important;  }
.template-professional3 .prof-item-header strong { color: #064e3b !important; }
.template-professional3 { background-color: #ecfdf5 !important; padding: 20px; }

.template-professional4 h1 { color: #4c1d95 !important;  }
.template-professional4 .section-title { color: #4c1d95 !important; border-bottom-color: #ddd6fe !important;  }
.template-professional4 .prof-item-header strong { color: #4c1d95 !important; }
.template-professional4 { background-color: #f5f3ff !important; padding: 20px; }

.template-professional5 h1 { color: #333333 !important; font-family: 'Playfair Display', serif !important; }
.template-professional5 .section-title { color: #333333 !important; border-bottom-color: #e5e7eb !important; font-family: 'Playfair Display', serif !important; }
.template-professional5 .prof-item-header strong { color: #333333 !important; }
.template-professional5 { background-color: #f9fafb !important; padding: 20px; }

.template-minimal2 h1 { color: #2563eb !important; letter-spacing: 2px !important; }
.template-minimal2 .section-min-title { color: #2563eb !important; border-left: 3px solid #bfdbfe !important; }
.template-minimal2 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal3 h1 { color: #059669 !important; letter-spacing: 2px !important; }
.template-minimal3 .section-min-title { color: #059669 !important; border-left: 3px solid #a7f3d0 !important; }
.template-minimal3 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal4 h1 { color: #7c3aed !important; letter-spacing: 2px !important; }
.template-minimal4 .section-min-title { color: #7c3aed !important; border-left: 3px solid #ddd6fe !important; }
.template-minimal4 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-minimal5 h1 { color: #dc2626 !important; letter-spacing: 2px !important; }
.template-minimal5 .section-min-title { color: #dc2626 !important; border-left: 3px solid #fecaca !important; }
.template-minimal5 .min-item-header span:first-child { font-weight: 700 !important; color: #111827 !important; }

.template-creative2 .creative-header { background: #3b82f6 !important; border-radius: 0 0 40px 0 !important; }
.template-creative2 .creative-title { color: #1d4ed8 !important; border-bottom: 2px dashed #3b82f6 !important; }
.template-creative2 .creative-skill { border-color: #3b82f6 !important; color: #1d4ed8 !important; background: rgba(0,0,0,0.02) !important; }

.template-creative3 .creative-header { background: #10b981 !important; border-radius: 0 0 40px 0 !important; }
.template-creative3 .creative-title { color: #047857 !important; border-bottom: 2px dashed #10b981 !important; }
.template-creative3 .creative-skill { border-color: #10b981 !important; color: #047857 !important; background: rgba(0,0,0,0.02) !important; }

.template-creative4 .creative-header { background: #8b5cf6 !important; border-radius: 0 0 40px 0 !important; }
.template-creative4 .creative-title { color: #6d28d9 !important; border-bottom: 2px dashed #8b5cf6 !important; }
.template-creative4 .creative-skill { border-color: #8b5cf6 !important; color: #6d28d9 !important; background: rgba(0,0,0,0.02) !important; }

.template-creative5 .creative-header { background: #f59e0b !important; border-radius: 0 0 40px 0 !important; }
.template-creative5 .creative-title { color: #b45309 !important; border-bottom: 2px dashed #f59e0b !important; }
.template-creative5 .creative-skill { border-color: #f59e0b !important; color: #b45309 !important; background: rgba(0,0,0,0.02) !important; }

/* ==========================================================================
   PRINT / PDF EXPORT FIXES
   ========================================================================== */
.timeline-item, 
.prof-item, 
.creative-item, 
.exec-item, 
.sidebar-section,
.section-minimal > div {
    page-break-inside: avoid;
    break-inside: avoid;
}

h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    break-after: avoid;
}

/* Ensure backgrounds print correctly across pages for modern templates */
.template-modern {
    background-image: linear-gradient(to right, var(--modern-sidebar, #0f172a) 0%, var(--modern-sidebar, #0f172a) 35%, white 35%, white 100%) !important;
}

.template-modern2 {
    --modern-sidebar: #1e3a8a;
}
.template-modern3 {
    --modern-sidebar: #064e3b;
}
.template-modern4 {
    --modern-sidebar: #4c1d95;
}
.template-modern5 {
    --modern-sidebar: #7f1d1d;
}

.template-modern .sidebar {
    background: transparent !important;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */
@media (max-width: 992px) {
    /* Builder Layout */
    .builder-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .builder-sidebar {
        border-right: none;
        border-bottom: 2px solid var(--border);
        height: auto;
        overflow: visible;
    }
    
    .builder-form-container {
        overflow-y: visible;
        padding: 24px 16px;
    }

    .builder-preview-wrapper {
        min-height: 100vh;
    }

    /* Dashboard Layout */
    .dashboard-layout {
        flex-direction: column;
    }

    .dashboard-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
        justify-content: center;
    }

    .dashboard-main {
        padding: 24px 16px;
    }

    /* Dashboard */
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid-full {
        grid-column: 1;
    }
    
    .templates-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .preview-container {
        padding: 16px;
        transform: scale(0.9);
        transform-origin: top center;
    }
    
    .builder-preview {
        padding: 16px 0;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .resume-grid {
        grid-template-columns: 1fr;
    }
    
    .templates-list {
        grid-template-columns: 1fr;
    }
    
    .builder-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
}
