/* ===== CSS VARIABLES ===== */
:root {
    /* Color Palette */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #06B6D4;
    --accent: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    
    /* Text Colors */
    --text-dark: #1F2937;
    --text-medium: #6B7280;
    --text-light: #9CA3AF;
    
    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --bg-gray: #F3F4F6;
    
    /* Borders */
    --border: #E5E7EB;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Elite Template Colors */
    --elite-gold: #D4AF37;
    --elite-dark: #1a1a2e;
    --elite-charcoal: #2d2d44;
    --elite-silver: #C0C0C0;
    --bg-cream: #FFFEF9;
    
    /* Mobile */
    --mobile-safe-area: env(safe-area-inset-bottom, 20px);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-dark);
}

p {
    line-height: 1.6;
    color: var(--text-medium);
}

/* ===== UTILITY CLASSES ===== */
.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

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

/* ===== BUTTONS ===== */
.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #E5E7EB;
}

.btn-success {
    background: var(--success);
    color: var(--bg-white);
}

.btn-success:hover {
    background: #0DA271;
}

.btn-danger {
    background: var(--danger);
    color: var(--bg-white);
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-slow);
    padding: var(--spacing-xl);
}

.welcome-screen.hide {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    color: var(--bg-white);
    max-width: 800px;
    padding: var(--spacing-2xl);
    width: 100%;
}

.welcome-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: var(--spacing-xl);
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: var(--bg-white);
}

.welcome-content p {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: var(--spacing-2xl);
    opacity: 0.95;
    color: var(--bg-white);
}

.welcome-btn {
    padding: clamp(0.875rem, 4vw, 1rem) clamp(2rem, 8vw, 3rem);
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-xl);
    background: var(--bg-white);
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-height: 60px;
    width: 100%;
    max-width: 300px;
    position: relative;
    overflow: hidden;
}

.welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

/* ===== TEMPLATE SELECTION ===== */
.template-selection {
    display: none;
    padding: var(--spacing-2xl) var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

.template-selection.active {
    display: block;
}

.template-header {
    text-align: center;
    color: var(--bg-white);
    margin-bottom: var(--spacing-2xl);
}

.template-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: var(--spacing-sm);
    color: var(--bg-white);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.template-card {
    background: var(--bg-white);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
    cursor: pointer;
}

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

.template-preview {
    width: 100%;
    height: 400px;
    background: var(--bg-gray);
    position: relative;
    overflow: hidden;
}

.template-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bg-white);
}

.badge-popular { background: var(--accent); }
.badge-modern { background: var(--primary); }
.badge-professional { background: var(--secondary); }
.badge-elite { background: var(--elite-gold); }

.template-info {
    padding: var(--spacing-xl);
}

.template-info h3 {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    margin-bottom: var(--spacing-xs);
}

.template-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: var(--spacing-md) 0;
}

.feature-tag {
    padding: 0.25rem 0.625rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    color: var(--text-medium);
}

.select-template-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 44px;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.select-template-btn:hover {
    background: var(--primary-dark);
}

/* Template Preview Styles */
.template-preview-content {
    padding: var(--spacing-xl);
    height: 100%;
}

.preview-header {
    text-align: center;
    border-bottom: 3px solid var(--primary);
    padding-bottom: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.preview-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.3125rem;
}

.preview-title {
    color: var(--primary);
    font-weight: 600;
}

.preview-section {
    margin-bottom: var(--spacing-md);
}

.preview-section h4 {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.3125rem;
    margin-bottom: 0.625rem;
}

.preview-text {
    font-size: 0.75rem;
    color: var(--text-medium);
    line-height: 1.4;
}

.preview-experience {
    font-size: 0.7rem;
}

.preview-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.1875rem;
}

/* Modern Template Preview */
.modern-preview-container {
    display: grid;
    grid-template-columns: 35% 65%;
    height: 100%;
}

.modern-sidebar-preview {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    padding: var(--spacing-xl);
}

.modern-sidebar-preview h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3125rem;
}

.modern-sidebar-preview .preview-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
}

.modern-sidebar-preview .preview-section h5 {
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    color: var(--bg-white);
}

.modern-main-preview {
    padding: var(--spacing-xl);
}

.modern-main-preview .preview-section h5 {
    color: var(--primary);
    font-size: 0.8rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.3125rem;
    margin-bottom: 0.75rem;
}

/* Minimalist Template Preview */
.minimalist-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.minimalist-header h3 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: -1px;
    margin-bottom: 0.3125rem;
}

.minimalist-header .preview-title {
    color: var(--text-medium);
    font-size: 0.85rem;
    font-weight: 400;
}

.minimalist-header .preview-contact {
    color: var(--text-light);
    font-size: 0.7rem;
    margin-top: 0.5rem;
}

.minimalist-header .preview-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--text-dark);
}

/* Elite Template Preview */
.elite-preview-container {
    display: grid;
    grid-template-columns: 5px 1fr;
    height: 100%;
}

.elite-accent-preview {
    background: linear-gradient(180deg, var(--elite-gold) 0%, var(--elite-dark) 50%, var(--elite-charcoal) 100%);
}

.elite-content-preview {
    padding: var(--spacing-xl);
    background: var(--bg-cream);
}

.elite-header-preview h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--elite-dark);
    margin-bottom: 0.3125rem;
    position: relative;
    padding-bottom: 0.625rem;
}

.elite-header-preview h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--elite-gold);
}

.elite-subtitle {
    font-size: 0.7rem;
    color: var(--text-medium);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.elite-contact-preview {
    margin-top: 0.9375rem;
    font-size: 0.6rem;
    color: var(--text-medium);
}

.elite-contact-preview .contact-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.3125rem;
}

.elite-contact-preview .contact-item i {
    color: var(--elite-gold);
    font-size: 0.6rem;
}

.elite-section-preview {
    margin-top: var(--spacing-xl);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.section-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--elite-gold) 0%, var(--elite-silver) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-icon i {
    color: var(--bg-white);
    font-size: 0.6rem;
}

.section-header span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--elite-dark);
}

/* ===== EDITOR CONTAINER ===== */
.editor-container {
    display: none;
    max-width: 1800px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
}

.editor-container.active {
    display: grid;
    grid-template-columns: 320px 1fr 280px;
    gap: var(--spacing-xl);
}

/* Editor Header */
.editor-header {
    grid-column: 1 / -1;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-lg);
}

.header-left h2 {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.header-left h2 i {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.progress-label {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: var(--text-medium);
    font-weight: 500;
    white-space: nowrap;
}

.progress-bar {
    width: 120px;
    height: 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex: 1;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    width: 0%;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    color: var(--text-medium);
}

.auto-save-badge {
    background: var(--bg-light);
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--success);
    white-space: nowrap;
}

.undo-redo-buttons {
    display: flex;
    gap: 0.625rem;
}

/* Sidebar */
.sidebar {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
    box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch;
}

.sidebar h3 {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.sidebar h3 i {
    color: var(--primary);
}

.form-group {
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.form-label {
    display: block;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.help-icon {
    color: var(--text-light);
    cursor: help;
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
}

.form-input {
    width: 100%;
    padding: 0.75rem 0.9375rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    transition: all var(--transition-fast);
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.font-size-value {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-top: 0.3125rem;
    text-align: center;
}

.section-divider {
    height: 1px;
    background: var(--border);
    margin: var(--spacing-xl) 0;
}

/* CV Preview */
.cv-preview {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    box-shadow: var(--shadow-xl);
    min-height: calc(100vh - 40px);
    position: relative;
    -webkit-overflow-scrolling: touch;
}

.cv-paper {
    max-width: 210mm;
    margin: 0 auto;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    border-radius: var(--radius-md);
    transform-origin: top center;
}

/* Template Styles - These are loaded dynamically */
.template-classic .cv-header {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-xl);
    border-bottom: 3px solid var(--primary);
}

.template-classic .cv-name {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.template-classic .cv-title {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--primary);
    margin-bottom: var(--spacing-xl);
}

.template-classic .cv-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-medium);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.template-classic .cv-body {
    padding: var(--spacing-2xl);
}

.cv-section {
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.section-content {
    color: var(--text-medium);
    line-height: 1.7;
}

/* Modern Template */
.template-modern {
    display: grid;
    grid-template-columns: 35% 65%;
}

.template-modern .cv-sidebar {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-white);
    padding: var(--spacing-2xl) var(--spacing-xl);
}

.template-modern .cv-main {
    padding: var(--spacing-2xl);
}

.template-modern .cv-name {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.5rem;
}

.template-modern .cv-title {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
}

.sidebar-section {
    margin-bottom: var(--spacing-xl);
}

.sidebar-section h3 {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-bottom: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Minimalist Template */
.template-minimalist .cv-header {
    padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
}

.template-minimalist .cv-name {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.template-minimalist .cv-title {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-medium);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.template-minimalist .section-title {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--text-dark);
}

/* Elite Executive Template */
.template-elite {
    display: grid;
    grid-template-columns: 5px 1fr;
    min-height: 1123px;
    background: var(--bg-cream);
    position: relative;
    max-width: 210mm;
    margin: 0 auto;
}

.elite-accent {
    background: linear-gradient(180deg, var(--elite-gold) 0%, var(--elite-dark) 50%, var(--elite-charcoal) 100%);
    position: relative;
}

.elite-content {
    padding: var(--spacing-2xl);
}

.elite-header {
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.elite-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--elite-dark);
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.elite-name::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--elite-gold);
}

.elite-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 400;
    color: var(--text-medium);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: var(--spacing-xl);
    margin-bottom: 1.5rem;
}

.elite-contact {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    color: var(--text-medium);
    margin-top: var(--spacing-xl);
}

.elite-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.elite-contact-item i {
    color: var(--elite-gold);
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
}

.elite-contact-item:not(:last-child)::after {
    content: '•';
    position: absolute;
    right: -0.9375rem;
    color: var(--elite-silver);
    font-weight: 300;
}

.elite-section {
    margin-bottom: var(--spacing-2xl);
    position: relative;
}

.elite-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.elite-section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--elite-gold) 0%, var(--elite-silver) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    flex-shrink: 0;
}

.elite-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 600;
    color: var(--elite-dark);
    letter-spacing: -0.3px;
    position: relative;
}

.elite-section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--elite-gold) 0%, transparent 100%);
    margin-left: 0.625rem;
}

.elite-summary {
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
    line-height: 1.8;
    color: var(--text-dark);
    font-weight: 400;
    padding-left: 44px;
    position: relative;
}

.elite-summary::before {
    content: '"';
    position: absolute;
    left: 10px;
    top: -10px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--elite-gold);
    opacity: 0.3;
    font-weight: 700;
}

.elite-timeline-item {
    padding-left: 44px;
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.elite-timeline-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--elite-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.elite-timeline-item::after {
    content: '';
    position: absolute;
    left: 18px;
    top: 20px;
    width: 2px;
    height: calc(100% - 10px);
    background: linear-gradient(180deg, var(--elite-gold) 0%, transparent 100%);
}

.elite-timeline-item:last-child::after {
    display: none;
}

.elite-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.625rem;
    gap: 0.9375rem;
    flex-wrap: wrap;
}

.elite-item-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: var(--elite-dark);
    margin-bottom: 0.25rem;
}

.elite-item-company {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-medium);
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.elite-item-location {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--text-light);
    font-style: italic;
}

.elite-item-date {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    color: var(--elite-gold);
    font-weight: 600;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 175, 55, 0.08);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.elite-item-description {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    line-height: 1.7;
    color: var(--text-medium);
    margin-top: 0.75rem;
}

.elite-item-description ul {
    margin-top: 0.5rem;
    padding-left: 20px;
}

.elite-item-description li {
    margin-bottom: 0.375rem;
    position: relative;
    line-height: 1.5;
}

.elite-item-description li::marker {
    color: var(--elite-gold);
}

.elite-skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9375rem;
    padding-left: 44px;
}

.elite-skill-category {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(26, 26, 46, 0.02) 100%);
    padding: 0.9375rem;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--elite-gold);
}

.elite-skill-category-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--elite-dark);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.elite-skill-category-title i {
    color: var(--elite-gold);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

.elite-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.elite-skill-tag {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--text-dark);
    background: var(--bg-white);
    padding: 0.3125rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-weight: 500;
}

.elite-education-item {
    padding-left: 44px;
    margin-bottom: 1.5rem;
    position: relative;
}

.elite-education-item::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--elite-gold);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.elite-degree {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: var(--elite-dark);
    margin-bottom: 0.375rem;
}

.elite-institution {
    font-size: clamp(0.9rem, 2vw, 1rem);
    color: var(--text-medium);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.elite-education-details {
    display: flex;
    gap: 0.75rem;
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: var(--text-light);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.elite-education-detail {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.elite-education-detail i {
    color: var(--elite-gold);
    font-size: clamp(0.7rem, 1.5vw, 0.75rem);
}

.elite-footer {
    margin-top: 3rem;
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--elite-gold);
    text-align: center;
    position: relative;
}

.elite-footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--elite-dark);
}

.elite-footer-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    color: var(--text-light);
    font-style: italic;
}

/* Timeline Item */
.timeline-item {
    margin-bottom: 1.5rem;
    padding-left: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.item-title {
    font-weight: 600;
    font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.item-date {
    color: var(--primary);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    white-space: nowrap;
}

.item-subtitle {
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.item-description {
    color: var(--text-medium);
    line-height: 1.6;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

/* Skills Grid */
.skills-grid {
    display: grid;
    gap: 0.75rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-name {
    flex: 0 0 140px;
    font-weight: 500;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-sm);
    transition: width var(--transition-normal);
}

/* Action Toolbar */
.action-toolbar {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch;
}

.action-toolbar h3 {
    font-size: clamp(0.9rem, 2vw, 1rem);
    margin-bottom: var(--spacing-lg);
}

.toolbar-section {
    margin-bottom: var(--spacing-xl);
}

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

.shortcuts-list {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-top: 0.625rem;
}

.shortcuts-list div {
    margin-bottom: 0.5rem;
}

/* Editable Content */
[contenteditable="true"] {
    outline: none;
    cursor: text;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    margin: -0.5rem -0.75rem;
    min-height: 44px;
    -webkit-user-select: text;
    user-select: text;
    -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
    font-size: inherit;
    line-height: inherit;
}

[contenteditable="true"]:hover {
    background: rgba(79, 70, 229, 0.05);
}

[contenteditable="true"]:focus {
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

/* Word Count Indicator */
.word-count {
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    color: var(--text-light);
    background: var(--bg-white);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    pointer-events: none;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.toast {
    background: var(--bg-white);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.toast.hide {
    animation: slideOut 0.3s ease forwards;
}

/* ===== MOBILE COMPONENTS ===== */
/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.overlay-content {
    background: var(--bg-white);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.3s ease;
}

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

.overlay-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: var(--spacing-xl);
}

.overlay-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.9375rem;
}

.overlay-content p {
    color: var(--text-medium);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    text-align: left;
}

.overlay-close-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

.overlay-close-btn:active {
    transform: scale(0.98);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: var(--spacing-xl) 0;
}

/* Mobile FAB */
.mobile-fab {
    position: fixed;
    bottom: calc(20px + var(--mobile-safe-area));
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: var(--bg-white);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    z-index: 1000;
    transition: all var(--transition-normal);
    border: none;
}

.mobile-fab:active {
    transform: scale(0.9);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* Mobile Bottom Toolbar */
.mobile-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 0.75rem 1.25rem calc(0.75rem + var(--mobile-safe-area));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    border-top: 1px solid var(--border);
}

.mobile-toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-width: 64px;
}

.mobile-toolbar-btn:active {
    background: var(--bg-gray);
    color: var(--primary);
    transform: scale(0.95);
}

.mobile-toolbar-btn i {
    font-size: 1.2rem;
    margin-bottom: 0.125rem;
}

.mobile-toolbar-btn.active {
    color: var(--primary);
    background: var(--bg-light);
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: var(--bg-white);
    }
    
    .sidebar,
    .action-toolbar,
    .template-selection,
    .welcome-screen,
    .editor-header,
    .toast-container,
    .mobile-fab,
    .mobile-toolbar,
    .mobile-overlay {
        display: none !important;
    }
    
    .editor-container {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }
    
    .cv-preview {
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .cv-paper {
        box-shadow: none !important;
        max-width: 100% !important;
    }
    
    .template-elite {
        min-height: auto;
        max-width: 210mm;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
    .editor-container.active {
        grid-template-columns: 280px 1fr;
    }
    
    .action-toolbar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .editor-container.active {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .sidebar {
        position: static;
        max-height: none;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .editor-header {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .header-right {
        width: 100%;
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .progress-container {
        width: 100%;
        justify-content: space-between;
        flex-direction: row;
    }
    
    .undo-redo-buttons {
        display: flex;
        gap: 0.625rem;
        width: 100%;
    }
    
    .undo-redo-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    /* Mobile Layout */
    body {
        padding-bottom: 70px;
    }
    
    /* Welcome Screen */
    .welcome-content {
        padding: var(--spacing-xl);
    }
    
    .welcome-btn {
        max-width: none;
    }
    
    /* Template Selection */
    .template-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .template-preview {
        height: 280px;
    }
    
    /* Editor Layout */
    .editor-container.active {
        padding: 0.625rem;
    }
    
    .editor-header {
        padding: 0.75rem;
    }
    
    .progress-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .template-modern {
        grid-template-columns: 1fr;
    }
    
    /* CV Preview */
    .cv-preview {
        padding: var(--spacing-md);
        min-height: auto;
        overflow-x: hidden;
        margin-bottom: 80px;
    }
    
    .cv-paper {
        transform: scale(0.95);
    }
    
    /* Template Adjustments */
    .template-classic .cv-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    
    .template-classic .cv-contact {
        flex-direction: column;
        align-items: center;
        gap: 0.625rem;
        text-align: center;
    }
    
    .template-classic .contact-item {
        justify-content: center;
        width: 100%;
    }
    
    .cv-body {
        padding: var(--spacing-xl);
    }
    
    .template-modern .cv-sidebar {
        padding: var(--spacing-xl);
    }
    
    .template-modern .cv-main {
        padding: var(--spacing-xl);
    }
    
    .template-minimalist .cv-header {
        padding: 1.5rem 1.25rem 1.25rem;
    }
    
    /* Elite Template Responsive */
    .elite-content {
        padding: var(--spacing-xl);
    }

    .elite-name::after {
        width: 40px;
    }

    .elite-contact {
        flex-direction: column;
        gap: 0.625rem;
    }

    .elite-contact-item:not(:last-child)::after {
        display: none;
    }

    .elite-skills-grid {
        grid-template-columns: 1fr;
        gap: 0.9375rem;
    }

    .elite-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .elite-item-date {
        align-self: flex-start;
    }

    .elite-timeline-item,
    .elite-education-item,
    .elite-summary,
    .elite-skills-grid {
        padding-left: 30px;
    }

    .elite-timeline-item::before,
    .elite-education-item::before {
        left: 5px;
    }

    .elite-timeline-item::after {
        left: 9px;
    }

    .elite-summary::before {
        left: -5px;
        font-size: 2.5rem;
    }
    
    /* Content Adjustments */
    .section-title {
        margin-bottom: 0.9375rem;
    }
    
    .timeline-item {
        padding-left: 20px;
        margin-bottom: var(--spacing-xl);
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3125rem;
    }
    
    .item-date {
        margin-top: 0.3125rem;
    }
    
    /* Skills Grid */
    .skills-grid {
        gap: 0.9375rem;
    }
    
    .skill-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .skill-name {
        flex: none;
        width: 100%;
    }
    
    .skill-bar {
        width: 100%;
    }
    
    /* Action Toolbar */
    .action-toolbar {
        display: none !important;
    }
    
    /* Mobile Toolbar */
    .mobile-toolbar {
        display: flex;
    }
    
    .mobile-fab {
        display: flex;
    }
    
    /* Toast */
    .toast-container {
        left: 0.625rem;
        right: 0.625rem;
        top: 0.625rem;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .word-count {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 0.3125rem;
        text-align: right;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .template-preview {
        height: 220px;
    }
    
    .editor-header {
        padding: 0.625rem;
    }
    
    .progress-bar {
        width: 100px;
    }
    
    .auto-save-badge {
        padding: 0.1875rem 0.5rem;
    }
    
    .form-group {
        margin-bottom: 0.9375rem;
    }
    
    .section-divider {
        margin: 0.9375rem 0;
    }
    
    .cv-paper {
        transform: scale(0.9);
    }
}

/* iOS Safari Fixes */
@supports (-webkit-touch-callout: none) {
    .welcome-screen,
    .template-selection,
    .editor-container {
        min-height: -webkit-fill-available;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
    
    .cv-preview {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    input, textarea, [contenteditable] {
        font-size: 16px !important;
    }
}

/* Mobile Device Specific */
.mobile-device .template-card:hover {
    transform: none;
}

.mobile-device .btn-primary:hover,
.mobile-device .btn-secondary:hover,
.mobile-device .btn-success:hover {
    transform: none;
}

.mobile-device .template-card:active,
.mobile-device .btn:active {
    transform: scale(0.98);
}

/* Improve Scrolling Performance */
.cv-preview {
    -webkit-overflow-scrolling: touch;
}

/* Better Tap Highlights */
button, 
[contenteditable="true"], 
.form-input,
.select-template-btn {
    -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
}

/* Loading Animation */
.swipe-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--bg-white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 999;
    display: none;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Mobile Zoom Prevention */
.prevent-zoom {
    touch-action: pan-y;
    -webkit-user-drag: none;
}