﻿:root {
    --primary: hsl(243, 75%, 59%);
    --primary-hover: hsl(243, 75%, 52%);
    --primary-light: hsl(243, 100%, 96%);
    --secondary: hsl(263, 70%, 50%);
    --dark: hsl(222, 47%, 11%);
    --light: hsl(210, 40%, 98%);
    --bg: hsl(210, 40%, 97%);
    --card-bg: hsl(0, 0%, 100%);
    --text-main: hsl(222, 47%, 15%);
    --text-muted: hsl(215, 16%, 47%);
    --border: hsl(214, 32%, 91%);
    --success: hsl(142, 71%, 45%);
    --success-light: hsl(142, 71%, 95%);
    --warning: hsl(38, 92%, 50%);
    --warning-light: hsl(38, 92%, 95%);
    --danger: hsl(350, 89%, 60%);
    --danger-light: hsl(350, 89%, 95%);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 40px -15px rgba(79, 70, 229, 0.15);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-container {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.text-accent {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.admin-badge {
    color: var(--danger);
    background: var(--danger-light);
    font-weight: 600;
}

.admin-badge:hover {
    color: #fff;
    background: var(--danger);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 1px solid var(--border);
    padding-left: 20px;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--light);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: hsl(350, 89%, 50%);
}

/* Content */
.app-content {
    flex: 1;
    padding: 40px 0;
}

/* Alerts */
.flash-container {
    margin-bottom: 24px;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-light);
    color: hsl(142, 71%, 25%);
    border-left: 4px solid var(--success);
}

.alert-error,
.alert-danger {
    background: var(--danger-light);
    color: hsl(350, 89%, 25%);
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: hsl(38, 92%, 25%);
    border-left: 4px solid var(--warning);
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* Footer */
.app-footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 12px;
    max-width: 320px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    transform: translateX(3px);
}

.footer-copy {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Auth Cards */
.auth-wrapper {
    max-width: 420px;
    margin: 40px auto;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-body {
    padding: 40px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    color: var(--dark);
}

.card-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg);
    color: var(--text-main);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Landing Page Grid */
.hero-section {
    text-align: center;
    padding: 80px 0;
    background: radial-gradient(circle at top, hsl(243, 75%, 97%) 0%, var(--bg) 100%);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin-bottom: 24px;
    color: var(--dark);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 60px 0;
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .app-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 40px;
    }
}

/* ============================================================
   CV EDITOR â€” Professional Redesign
   ============================================================ */

/* --- Parent layout overrides for the full-height editor --- */
.app-content:has(.cv-editor-toolbar) {
    padding: 0;
}

.app-content:has(.cv-editor-toolbar)~.app-footer {
    display: none;
}

/* --- Top Toolbar --- */
.cv-editor-toolbar {
    height: 56px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    position: relative;
}

.cv-editor-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.cv-editor-toolbar-left .back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    flex-shrink: 0;
    text-decoration: none;
}

.cv-editor-toolbar-left .back-btn:hover {
    background: var(--light);
    color: var(--primary);
    border-color: var(--primary);
}

.cv-editor-toolbar-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 17px;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.cv-editor-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cv-editor-toolbar-right .toolbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.cv-editor-toolbar-right .toolbar-icon-btn:hover:not(:disabled) {
    background: var(--light);
    color: var(--primary);
    border-color: var(--primary);
}

.cv-editor-toolbar-right .toolbar-icon-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.cv-save-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0 8px;
}

.cv-save-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.cv-save-dot.saving {
    background: var(--warning);
    animation: cvPulse 1s infinite;
}

.cv-save-dot.error {
    background: var(--danger);
}

.cv-editor-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-heading);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
    transition: var(--transition);
}

.cv-editor-export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

/* --- Main Layout (2-panel: form + preview) --- */
.cv-editor-layout {
    display: flex;
    height: calc(100vh - 56px - 72px);
    overflow: hidden;
    background: var(--bg);
}

/* --- Form Panel (left, scrollable accordion) --- */
.cv-editor-form-panel {
    width: 50%;
    min-width: 0;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cv-editor-form-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px 60px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.cv-editor-form-scroll::-webkit-scrollbar {
    width: 5px;
}

.cv-editor-form-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.cv-editor-form-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* --- Accordion Section Blocks --- */
.cv-section-block {
    border: 1.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    background: white;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cv-section-block:hover {
    border-color: hsl(214, 32%, 82%);
}

.cv-section-block.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
}

.cv-section-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.cv-section-block-header:hover {
    background: var(--bg);
}

.cv-section-block-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.cv-section-block-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cv-section-block-icon svg {
    width: 18px;
    height: 18px;
}

.cv-section-block-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.cv-section-block-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.cv-section-block-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-section-block-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.cv-section-block-dot.filled {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.cv-section-block-chevron {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.cv-section-block.expanded .cv-section-block-chevron {
    transform: rotate(180deg);
}

.cv-section-block-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cv-section-block.expanded .cv-section-block-body {
    max-height: 5000px;
}

.cv-section-block-content {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border);
}

/* Form field enhancements */
.cv-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cv-form-group {
    margin-bottom: 18px;
}

.cv-form-group:last-child {
    margin-bottom: 0;
}

.cv-form-group .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.cv-form-group .form-control {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 8px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    transition: all 0.2s ease;
}

.cv-form-group .form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.cv-form-group .form-control::placeholder {
    color: hsl(215, 16%, 67%);
}

/* Rich Text Editor */
.cv-rich-text-group {
    margin-bottom: 18px;
}

.cv-rich-text-toolbar {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 6px 8px;
    display: flex;
    gap: 4px;
}

.cv-rich-text-toolbar .toolbar-btn {
    width: 30px;
    height: 28px;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
    background: white;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cv-rich-text-toolbar .toolbar-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.cv-rich-text-content {
    min-height: 100px;
    outline: none;
    background: white;
    border: 1.5px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    overflow-y: auto;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cv-rich-text-content:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.cv-rich-text-content[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: hsl(215, 16%, 67%);
    pointer-events: none;
}

/* List item cards */
.cv-list-item {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 14px;
    position: relative;
    transition: all 0.2s ease;
    animation: cvItemAppear 0.3s ease;
}

.cv-list-item:hover {
    border-color: hsl(214, 32%, 82%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cv-list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.cv-list-item-drag {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: grab;
    opacity: 0.4;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.cv-list-item:hover .cv-list-item-drag {
    opacity: 0.8;
}

.cv-list-item-drag:active {
    cursor: grabbing;
}

.cv-list-item-number {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cv-list-item-actions {
    display: flex;
    gap: 4px;
}

.cv-list-item-actions button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    transition: all 0.15s ease;
}

.cv-list-item-actions button:hover {
    background: var(--light);
    color: var(--primary);
    border-color: var(--primary);
}

.cv-list-item-actions button.delete-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

.cv-list-item-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.cv-add-item-btn {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.cv-add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Simple tag list (skills, certs, langs) */
.cv-tag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    animation: cvItemAppear 0.2s ease;
}

.cv-tag-item .form-control {
    flex: 1;
}

.cv-tag-item .tag-remove-btn {
    width: 38px;
    height: 40px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.cv-tag-item .tag-remove-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

/* Empty state */
.cv-empty-state {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.cv-empty-state-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

/* Section separator */
.cv-section-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* Drag and drop */
.cv-list-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.cv-list-item.drag-over {
    border-color: var(--primary) !important;
    border-top-width: 3px;
    box-shadow: 0 -2px 8px rgba(79, 70, 229, 0.15);
    background: rgba(79, 70, 229, 0.02);
}

/* --- Preview Panel (right, dark bg) --- */
.cv-editor-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: hsl(220, 13%, 18%);
    position: relative;
    overflow: hidden;
}

.cv-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
}

.cv-preview-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    font-family: var(--font-heading);
}

.cv-preview-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
}

.cv-zoom-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.15s ease;
    font-family: var(--font-heading);
}

.cv-zoom-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.cv-zoom-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.cv-preview-canvas {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
}

.cv-preview-canvas::-webkit-scrollbar {
    width: 6px;
}

.cv-preview-canvas::-webkit-scrollbar-track {
    background: transparent;
}

.cv-preview-canvas::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.cv-preview-paper {
    background: white;
    border-radius: 4px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    flex-shrink: 0;
    transform-origin: top center;
    transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
    width: 595px;
    min-height: 842px;
}

.cv-preview-paper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    min-height: 842px;
}

/* Zoom levels */
.cv-preview-paper.zoom-fit {
    width: 520px;
    min-height: 735px;
    transform: none;
}

.cv-preview-paper.zoom-fit iframe {
    min-height: 735px;
}

.cv-preview-paper.zoom-75 {
    width: 446px;
    min-height: 631px;
    transform: none;
}

.cv-preview-paper.zoom-75 iframe {
    min-height: 631px;
}

.cv-preview-paper.zoom-100 {
    width: 595px;
    min-height: 842px;
    transform: none;
}

.cv-preview-paper.zoom-100 iframe {
    min-height: 842px;
}

/* --- Animations --- */
@keyframes cvSectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cvItemAppear {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cvPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* --- Settings Section --- */
.cv-settings-card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
}

.cv-settings-card h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 14px;
}

.cv-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.cv-toggle-switch {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.cv-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cv-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 12px;
    transition: 0.3s;
    cursor: pointer;
}

.cv-toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.cv-toggle-switch input:checked+.cv-toggle-slider {
    background: var(--primary);
}

.cv-toggle-switch input:checked+.cv-toggle-slider::before {
    transform: translateX(18px);
}

.cv-public-link-box {
    margin-top: 14px;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    animation: cvSectionFadeIn 0.25s ease;
}

.cv-public-link-url {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    margin-top: 10px;
}

.cv-public-link-url a {
    color: var(--primary);
    text-decoration: underline;
}

/* --- Photo Upload --- */
.cv-photo-upload-section {
    margin-bottom: 8px;
}

.cv-photo-upload-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.cv-photo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    border: 2.5px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.cv-photo-preview:hover {
    border-color: var(--primary);
}

.cv-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cv-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.cv-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.cv-photo-preview:hover .cv-photo-overlay {
    opacity: 1;
}

.cv-photo-preview.uploading {
    opacity: 0.5;
    pointer-events: none;
    animation: cvPulse 1s infinite;
}

.cv-photo-remove-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-body);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.cv-photo-remove-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

.cv-photo-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* --- Mobile Bottom Navigation --- */
.cv-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.cv-mobile-bottom-nav .cv-mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
}

.cv-mobile-bottom-nav .cv-mobile-tab.active {
    color: var(--primary);
}

.cv-mobile-bottom-nav .cv-mobile-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
}

/* --- Mobile Sections Drawer --- */
.cv-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cv-mobile-backdrop.visible {
    display: block;
    opacity: 1;
}

.cv-mobile-sections-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.cv-mobile-sections-drawer.open {
    transform: translateY(0);
}

.cv-drawer-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 12px auto 0;
}

.cv-drawer-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    padding: 16px 20px 8px;
}

.cv-drawer-nav {
    padding: 0 12px 8px;
}

.cv-drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
}

.cv-drawer-nav-item:hover {
    background: var(--bg);
}

.cv-drawer-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.cv-drawer-nav-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
}

.cv-drawer-nav-item.active .cv-drawer-nav-item-icon {
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
}

.cv-drawer-nav-item-icon svg {
    width: 18px;
    height: 18px;
}

.cv-drawer-nav-item-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border);
    margin-left: auto;
    flex-shrink: 0;
}

.cv-drawer-nav-item-dot.filled {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 1100px) {
    .cv-editor-form-panel {
        width: 45%;
    }

    .cv-editor-form-scroll {
        padding: 20px 20px 60px;
    }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
    .cv-editor-toolbar {
        padding: 0 12px;
        height: 50px;
    }

    .cv-editor-toolbar-title {
        font-size: 14px;
        max-width: 140px;
    }

    .cv-export-label {
        display: none;
    }

    .cv-editor-export-btn {
        padding: 8px 12px;
    }

    .cv-editor-layout {
        flex-direction: column;
        height: calc(100vh - 50px - 72px - 60px);
    }

    /* Form panel - full width on mobile */
    .cv-editor-form-panel {
        width: 100%;
        min-width: 0;
        flex: 1;
        border-right: none;
    }

    .cv-editor-form-scroll {
        padding: 16px 16px 80px;
    }

    /* Preview panel - full width on mobile, hidden by default */
    .cv-editor-preview-panel {
        display: none;
        width: 100%;
        flex: 1;
    }

    .cv-preview-toolbar {
        padding: 8px 16px;
    }

    .cv-preview-zoom-controls {
        display: none;
    }

    /* Mobile show/hide states */
    .cv-editor-layout.show-preview .cv-editor-form-panel {
        display: none;
    }

    .cv-editor-layout.show-preview .cv-editor-preview-panel {
        display: flex;
    }

    /* Mobile bottom nav visible */
    .cv-mobile-bottom-nav {
        display: flex;
    }

    /* Accordion block adjustments */
    .cv-section-block-header {
        padding: 14px 16px;
    }

    .cv-section-block-content {
        padding: 0 16px 16px;
    }

    .cv-section-block-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .cv-section-block-title {
        font-size: 14px;
    }

    .cv-form-row {
        grid-template-columns: 1fr;
    }

    /* Mobile A4 preview scaling */
    .cv-preview-canvas {
        padding: 12px;
        align-items: flex-start;
        justify-content: center;
    }

    .cv-preview-paper {
        transform-origin: top center;
    }

    .cv-photo-upload-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

