/* =========================================
   CV PRO - ATS-Optimized CV Builder
   Premium Design System
   ========================================= */

/* === CSS Custom Properties === */
:root {
    /* Color Palette - Deep Navy & Gold Accent */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2235;
    --bg-card: #1e2a3a;
    --bg-card-hover: #243044;
    --bg-input: #0f1729;
    --bg-input-focus: #131d33;

    --text-primary: #f0f4fc;
    --text-secondary: #94a3c4;
    --text-muted: #5a6a8a;
    --text-hint: #4a5a7a;

    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-tertiary: #a5b4fc;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);

    --border: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(99, 102, 241, 0.5);
    --border-hover: rgba(255, 255, 255, 0.12);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.15);

    /* Sizing */
    --sidebar-width: 280px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

body.auth-active {
    overflow-y: auto;
    height: auto;
}

body.landing-active {
    overflow-y: auto;
    height: auto;
}

/* When dashboard is visible, allow body to scroll */
body.dashboard-active {
    overflow: auto;
    height: auto;
}

/* === Scrollbar — use native OS auto-hide behavior === */
/* On macOS: System Preferences → Appearance → Show scroll bars → "When scrolling" */
/* We keep minimal styling but let the OS handle show/hide */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* === App Container === */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), width var(--transition-base);
    z-index: 100;
    position: relative;
}

.sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.3) 50%, 
        transparent 100%
    );
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-icon {
    font-size: 1.6rem;
}

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

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 4px;
    font-weight: 500;
}

/* === Sidebar Navigation === */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 200px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    position: relative;
    font-family: inherit;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-tertiary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.nav-item.completed .nav-status {
    opacity: 1;
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.nav-item.has-content .nav-status {
    opacity: 1;
    background: var(--warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* === ATS Score Widget === */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 1;
    min-height: 0;
    max-height: 50vh;
}

.ats-score {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.score-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.score-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 6;
}

.score-fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 264;
    stroke-dashoffset: 264;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-tertiary);
}

.score-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.score-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.score-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* === Top Bar === */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-height);
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm), 0 0 16px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md), 0 0 24px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 1.1rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.04);
    color: var(--accent-secondary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    width: 100%;
    justify-content: center;
}

.btn-add:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* === Form Container === */
.form-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.form-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.form-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 28px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* === Form Grid === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid.full-width {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.required {
    color: var(--accent-primary);
}

.field-hint {
    font-size: 0.72rem;
    color: var(--text-hint);
    font-style: italic;
}

/* === Form Inputs === */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="month"],
select,
textarea {
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-hint);
}

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

input:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: var(--border-hover);
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6a8a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* === textarea tools === */
.textarea-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.char-count {
    font-size: 0.72rem;
    color: var(--text-hint);
    font-weight: 500;
}

.ats-tips {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-hint);
}

.tip-badge {
    background: var(--warning-bg);
    color: var(--warning);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.68rem;
}

/* === Dynamic List Items (Experience, Education, etc.) === */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.dynamic-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    transition: all var(--transition-fast);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dynamic-entry:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.entry-number {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.entry-grid .full {
    grid-column: 1 / -1;
}

/* Bullet points editor */
.bullets-editor {
    margin-top: 8px;
}

.bullet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.bullet-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    padding: 2px 4px 2px 0;
}

.bullet-reorder {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0;
}

.bullet-move {
    background: none;
    border: none;
    color: var(--text-hint);
    cursor: pointer;
    font-size: 8px;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bullet-move:hover {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

@keyframes bulletSlide {
    0% { opacity: 0.5; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.bullet-item input {
    flex: 1;
}

.bullet-remove {
    background: none;
    border: none;
    color: var(--text-hint);
    cursor: pointer;
    padding: 10px 4px;
    font-size: 1rem;
    transition: color var(--transition-fast);
}

.bullet-remove:hover {
    color: var(--danger);
}

.btn-add-bullet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-add-bullet:hover {
    border-color: var(--accent-primary);
    color: var(--accent-secondary);
}

/* === Skills Section === */
.skills-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.category-header h3 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.category-actions {
    display: flex;
    gap: 6px;
}

.category-actions .btn-ai-review {
    position: static;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 20px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-glow);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-tertiary);
    animation: tagPop 0.2s ease;
    cursor: grab;
    transition: opacity 0.15s, box-shadow 0.15s;
    user-select: none;
}

.skill-tag:active {
    cursor: grabbing;
}

.skill-tag.skill-dragging {
    opacity: 0.35;
}

.skill-tag.skill-drag-over-left {
    box-shadow: -3px 0 0 0 var(--accent-primary);
}

.skill-tag.skill-drag-over-right {
    box-shadow: 3px 0 0 0 var(--accent-primary);
}

@keyframes tagPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.tag-remove {
    background: none;
    border: none;
    color: var(--accent-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.tag-remove:hover {
    opacity: 1;
    color: var(--danger);
}

.skill-input-group {
    display: flex;
    gap: 8px;
}

.skill-input {
    flex: 1;
}

/* === Toggle Switch === */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--accent-primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* ====================================
   CV PREVIEW MODAL
   ==================================== */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.preview-overlay.active {
    display: flex;
}

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

.preview-modal {
    width: 90%;
    max-width: 900px;
    height: 92vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.preview-toolbar h2 {
    font-size: 1rem;
    font-weight: 700;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-select {
    padding: 7px 32px 7px 12px;
    font-size: 0.8rem;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: #2a2a2a;
}

/* === CV Page (Print-Ready Layout) === */
.cv-page {
    width: 210mm;
    min-height: 297mm;
    height: auto;
    background: #ffffff;
    color: #1a1a1a;
    padding: 32px 36px;
    font-family: 'Crimson Pro', 'Times New Roman', serif;
    font-size: 10.5pt;
    line-height: 1.45;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    flex-shrink: 0;
}

/* CV Header */
.cv-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1a1a1a;
}

.cv-name {
    font-family: 'Inter', sans-serif;
    font-size: 22pt;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.cv-title {
    font-size: 11pt;
    color: #444;
    font-weight: 500;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

.cv-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 0;
    font-size: 9pt;
    color: #333;
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.cv-contact span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    border-right: 1px solid #ccc;
    line-height: 1.6;
}

.cv-contact span:last-child {
    border-right: none;
}

.cv-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    color: #555;
    vertical-align: middle;
}

.cv-contact .separator {
    display: none;
}

/* CV Sections */
.cv-section {
    margin-bottom: 14px;
}

.cv-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #1a1a1a;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
    margin-bottom: 8px;
}

.cv-entry {
    margin-bottom: 10px;
}

.cv-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.cv-entry-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 10.5pt;
    color: #1a1a1a;
}

.cv-entry-date {
    font-size: 9pt;
    color: #666;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    white-space: nowrap;
}

.cv-entry-subtitle {
    font-size: 10pt;
    color: #444;
    font-style: italic;
    margin-bottom: 4px;
}

.cv-bullets {
    list-style: none;
    padding: 0;
}

.cv-bullets li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 3px;
    font-size: 10pt;
    line-height: 1.45;
    color: #2a2a2a;
}

.cv-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #555;
}

/* CV Skills */
.cv-skills-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 16px;
    font-size: 10pt;
}

.cv-skill-label {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 9.5pt;
}

.cv-skill-value {
    color: #2a2a2a;
}

/* CV Languages */
.cv-languages-list {
    font-size: 10pt;
}

/* ====================================
   CV TEMPLATE VARIANTS
   ==================================== */

/* === TEMPLATE: Modern Classic (default — serif body, clean lines) === */
/* Already styled above as base .cv-page */

/* === TEMPLATE: Minimal Clean === */
.template-minimal {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 10pt;
    padding: 40px 44px;
    line-height: 1.5;
}

.template-minimal .cv-header {
    text-align: left;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.template-minimal .cv-name {
    font-size: 26pt;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
    color: #111827;
}

.template-minimal .cv-title {
    font-size: 11pt;
    color: #6b7280;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.template-minimal .cv-contact {
    justify-content: flex-start;
    gap: 2px 0;
    font-size: 8.5pt;
    color: #6b7280;
    margin-top: 6px;
}

.template-minimal .cv-contact span {
    border-right: 1px solid #d1d5db;
    padding: 0 10px 0 0;
    margin-right: 10px;
    line-height: 1.8;
}

.template-minimal .cv-contact span:first-child {
    padding-left: 0;
}

.template-minimal .cv-contact span:last-child {
    border-right: none;
    margin-right: 0;
}

.template-minimal .cv-icon {
    display: none;
}

.template-minimal .cv-section {
    margin-bottom: 16px;
}

.template-minimal .cv-section-title {
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #374151;
    border-bottom: none;
    padding-bottom: 0;
    padding-left: 10px;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-left: 2px solid #6b7280;
}

.template-minimal .cv-entry {
    margin-bottom: 12px;
}

.template-minimal .cv-entry-title {
    font-weight: 600;
    font-size: 10.5pt;
    color: #111827;
}

.template-minimal .cv-entry-date {
    font-size: 8.5pt;
    color: #9ca3af;
    font-weight: 500;
}

.template-minimal .cv-entry-subtitle {
    font-size: 9.5pt;
    color: #6b7280;
    font-style: italic;
}

.template-minimal .cv-bullets li {
    font-size: 9.5pt;
    color: #374151;
    padding-left: 12px;
    line-height: 1.55;
}

.template-minimal .cv-bullets li::before {
    content: '–';
    color: #9ca3af;
}

.template-minimal .cv-skills-grid {
    grid-template-columns: 120px 1fr;
    gap: 6px 12px;
    font-size: 9.5pt;
}

.template-minimal .cv-skill-label {
    font-weight: 600;
    font-size: 9pt;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.template-minimal .cv-skill-value {
    color: #4b5563;
}

/* === TEMPLATE: Executive Bold === */
.template-executive {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: 10pt;
    padding: 28px 32px;
    line-height: 1.45;
    /* border-top removed */
}

.template-executive .cv-header {
    text-align: center;
    border-bottom: none;
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.template-executive .cv-name {
    font-size: 24pt;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #1a365d;
}

.template-executive .cv-title {
    font-size: 11pt;
    color: #2b6cb0;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.template-executive .cv-contact {
    gap: 4px 0;
    font-size: 8.5pt;
    color: #4a5568;
}

.template-executive .cv-contact span {
    border-color: #a0aec0;
}

.template-executive .cv-icon {
    color: #1a365d;
}

.template-executive .cv-section {
    margin-bottom: 14px;
}

.template-executive .cv-section-title {
    font-size: 11pt;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #ffffff;
    background: #1a365d;
    padding: 4px 10px;
    margin-bottom: 10px;
    border-bottom: none;
    border-radius: 2px;
}

.template-executive .cv-entry {
    margin-bottom: 10px;
    padding-left: 6px;
    border-left: 3px solid #bee3f8;
}

.template-executive .cv-entry-title {
    font-weight: 700;
    font-size: 10.5pt;
    color: #1a365d;
}

.template-executive .cv-entry-date {
    font-size: 8.5pt;
    color: #718096;
    font-weight: 600;
}

.template-executive .cv-entry-subtitle {
    font-size: 9.5pt;
    color: #4a5568;
    font-style: normal;
    font-weight: 500;
}

.template-executive .cv-bullets li {
    font-size: 9.5pt;
    color: #2d3748;
    padding-left: 16px;
}

.template-executive .cv-bullets li::before {
    content: '▸';
    color: #2b6cb0;
    font-size: 8pt;
}

.template-executive .cv-skills-grid {
    grid-template-columns: 130px 1fr;
    gap: 4px 12px;
    font-size: 9.5pt;
}

.template-executive .cv-skill-label {
    font-weight: 700;
    font-size: 9pt;
    color: #1a365d;
}

.template-executive .cv-skill-value {
    color: #4a5568;
}

/* ====================================
   PRINT STYLES
   ==================================== */
@media print {
    body {
        background: white;
        overflow: visible;
    }
    .app-container,
    .sidebar,
    .topbar,
    .preview-toolbar,
    .preview-overlay {
        display: none !important;
    }
    .cv-page {
        box-shadow: none;
        padding: 0;
        width: 100%;
        min-height: auto;
        border-radius: 0;
    }
    @page {
        margin: 0.5in;
        size: A4;
    }
}

/* === Responsive === */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .entry-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .form-container {
        padding: 20px 16px;
    }
    .topbar {
        padding: 0 16px;
    }
    .preview-modal {
        width: 98%;
        height: 96vh;
        border-radius: var(--radius-md);
    }
    .preview-content {
        padding: 16px;
    }
    .cv-page {
        width: 100%;
        padding: 24px 20px;
        font-size: 9.5pt;
    }
}

/* ====================================
   AI ENHANCEMENT STYLES
   ==================================== */

/* === AI Settings Button === */
.btn-ai {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.12) 100%);
    color: #c4b5fd;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-ai::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 60%);
    animation: aiGlow 3s ease-in-out infinite;
}

@keyframes aiGlow {
    0%, 100% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.btn-ai:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
    transform: translateY(-1px);
}

/* === AI Enhance Button (inline) === */
.btn-ai-enhance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border: 1px solid rgba(168, 85, 247, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(168, 85, 247, 0.15) 100%);
    color: #c4b5fd;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.btn-ai-enhance:hover {
    border-color: rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(168, 85, 247, 0.25) 100%);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
    transform: translateY(-1px);
}

.btn-ai-enhance:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-ai-enhance.loading {
    pointer-events: none;
}

.btn-ai-enhance.loading .ai-sparkle {
    animation: sparkleRotate 1s linear infinite;
}

@keyframes sparkleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-sparkle {
    display: inline-block;
    font-size: 0.85rem;
}

/* === AI Entry-Level Enhance Button === */
.btn-ai-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(168, 85, 247, 0.25);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(168, 85, 247, 0.12) 100%);
    color: #c4b5fd;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.btn-ai-entry:hover {
    border-color: rgba(168, 85, 247, 0.5);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(168, 85, 247, 0.2) 100%);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.15);
}

.btn-ai-entry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ai-entry.loading .ai-sparkle {
    animation: sparkleRotate 1s linear infinite;
}

/* === AI Settings Modal === */
.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-modal-overlay.active {
    display: flex;
}

.ai-modal {
    width: 90%;
    max-width: 540px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 40px rgba(168, 85, 247, 0.1);
    overflow: hidden;
    animation: modalSlideIn2 0.3s ease;
}

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

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.ai-modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.ai-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ai-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
}

.ai-info-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.ai-info-banner strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ai-info-banner p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.api-key-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.api-key-input-group input {
    flex: 1;
}

.btn-toggle-key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.btn-toggle-key:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.ai-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
}

.ai-test-result {
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.ai-test-result.success {
    display: block;
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.ai-test-result.error {
    display: block;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.ai-test-result.loading {
    display: block;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    color: #c4b5fd;
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(15, 22, 41, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 320px;
    max-width: 420px;
    pointer-events: all;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.hiding {
    animation: toastSlideOut 0.25s ease forwards;
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #f0f4fc;
    margin-bottom: 1px;
    font-family: 'Inter', sans-serif;
}

.toast-message {
    font-size: 12px;
    color: #7a859b;
    line-height: 1.4;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f4fc;
}

/* Type-specific */
.toast.success { border-color: rgba(16, 185, 129, 0.15); }
.toast.success .toast-icon { background: rgba(16, 185, 129, 0.15); }
.toast.success .toast-title { color: #6ee7b7; }

.toast.error { border-color: rgba(239, 68, 68, 0.15); }
.toast.error .toast-icon { background: rgba(239, 68, 68, 0.15); }
.toast.error .toast-title { color: #fca5a5; }

.toast.info { border-color: rgba(59, 130, 246, 0.15); }
.toast.info .toast-icon { background: rgba(59, 130, 246, 0.15); }
.toast.info .toast-title { color: #93c5fd; }

.toast.ai { border-color: rgba(168, 85, 247, 0.15); }
.toast.ai .toast-icon { background: rgba(168, 85, 247, 0.15); }
.toast.ai .toast-title { color: #d8b4fe; }

/* Progress — hidden visually but keeps auto-dismiss timing */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 0;
    opacity: 0;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* === AI Diff Preview === */
.ai-diff-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
}

.ai-diff-overlay.active {
    display: flex;
}

.ai-diff-modal {
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(168, 85, 247, 0.2);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn2 0.3s ease;
}

.ai-diff-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(168, 85, 247, 0.04) 100%);
}

.ai-diff-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-diff-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.diff-section {
    margin-bottom: 20px;
}

.diff-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-label.original { color: var(--danger); }
.diff-label.enhanced { color: var(--success); }

.diff-content {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.diff-content.original {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.3);
}

.diff-content.enhanced {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.ai-diff-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.diff-footer-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-footer-actions {
    display: flex;
    gap: 10px;
}

.btn-accept {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-accept:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-reject {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-reject:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ====================================
   OAUTH STYLES
   ==================================== */

/* === OAuth Section === */
.oauth-section {
    margin: 4px 0;
}

.oauth-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(16, 185, 129, 0.04) 100%);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.oauth-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oauth-card-header svg {
    flex-shrink: 0;
}

.oauth-card-header strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.oauth-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* OAuth Status */
.oauth-status {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
}

.oauth-status.connected {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.oauth-status.disconnected {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.oauth-connected {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    flex-wrap: wrap;
}

.oauth-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.oauth-expiry {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.oauth-disconnected {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 6px;
}

.oauth-disconnected::before {
    content: '○';
    font-size: 0.7rem;
}

/* OAuth Buttons */
.oauth-actions {
    display: flex;
    gap: 10px;
}

.btn-oauth-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
    flex: 1;
    justify-content: center;
}

.btn-oauth-login:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-oauth-login:active {
    transform: translateY(0);
}

.btn-oauth-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.06);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.btn-oauth-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
}

/* OAuth Security Note */
.oauth-security-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(99, 102, 241, 0.04);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    color: var(--text-hint);
    line-height: 1.4;
    border: 1px dashed rgba(99, 102, 241, 0.12);
}

.oauth-security-note span:first-child {
    flex-shrink: 0;
    font-size: 0.85rem;
}

/* === Provider Logo === */
.provider-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* === Quick Steps === */
.quick-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.step-item:last-child {
    border-bottom: none;
}

.step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    color: #a78bfa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
}

.step-text strong {
    color: var(--text-primary);
}

.step-link {
    color: #818cf8;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.step-link:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a78bfa;
}

/* === Connect Key Group (inside card) === */
.connect-key-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.connect-key-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.connect-key-group .api-key-input-group {
    display: flex;
    gap: 6px;
}

.connect-key-group input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    letter-spacing: 0.5px;
    transition: border-color var(--transition-fast);
}

.connect-key-group input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.connect-key-group input::placeholder {
    color: var(--text-hint);
    font-family: inherit;
    letter-spacing: normal;
}

/* ====================================
   ATS BREAKDOWN PANEL
   ==================================== */

.ats-breakdown {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ats-breakdown.expanded {
    max-height: 600px;
}

.breakdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 6px;
}

.breakdown-toggle:hover {
    color: var(--text-secondary);
}

.breakdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.65rem;
}

.ats-breakdown.expanded .breakdown-arrow {
    transform: rotate(180deg);
}

.breakdown-content {
    padding: 4px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Category Rows */
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
}

.breakdown-icon {
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.breakdown-label {
    flex: 1;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
    font-size: 0.66rem;
}

.breakdown-bar-wrap {
    flex: 0 0 50px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 1px;
}

.breakdown-score {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Tips Section */
.breakdown-tips {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.tips-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.tip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.tip-text {
    flex: 1;
}

/* ATS Score widget - add hover hint */
.ats-score {
    position: relative;
}

.ats-score::after {
    content: 'Click xem chi tiết';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--text-hint);
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.ats-score:hover::after {
    opacity: 1;
}

/* ====================================
   AI DEEP SCAN STYLES
   ==================================== */

/* AI Scan Button */
.btn-ai-scan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    margin-top: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    color: #fff;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}

.btn-ai-scan::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-ai-scan:hover:not(:disabled)::before {
    left: 100%;
}

.btn-ai-scan:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.35);
}

.btn-ai-scan:active:not(:disabled) {
    transform: translateY(0);
}

.btn-ai-scan:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-ai-scan.scanning {
    animation: scanPulse 1.5s ease-in-out infinite;
}

@keyframes scanPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25), 0 0 0 0 rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25), 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* Dual Score Badge */
.ai-score-badge {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
}

.dual-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.score-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 38px;
}

.score-chip.rule {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.score-chip.ai {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.score-chip.final {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.3);
    min-width: 42px;
}

.chip-label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.chip-value {
    font-size: 0.82rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.score-chip.rule .chip-value { color: #818cf8; }
.score-chip.ai .chip-value { color: #c084fc; }
.score-chip.final .chip-value { color: #6ee7b7; }

.score-plus, .score-equals {
    font-size: 0.65rem;
    color: var(--text-hint);
    font-weight: 600;
}

/* AI Scan Summary */
.ai-scan-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scan-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.scan-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.scan-label.good { color: #6ee7b7; }
.scan-label.warn { color: #fbbf24; }

.scan-item {
    font-size: 0.65rem;
    line-height: 1.35;
    padding: 2px 0 2px 10px;
    border-left: 2px solid;
}

.scan-item.good {
    color: var(--text-secondary);
    border-color: rgba(16, 185, 129, 0.3);
}

.scan-item.warn {
    color: var(--text-secondary);
    border-color: rgba(251, 191, 36, 0.3);
}

.scan-verdict {
    font-size: 0.63rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(255, 255, 255, 0.06);
    line-height: 1.4;
    margin-top: 2px;
}

/* ===== AI FIELD REVIEW ===== */
.form-group {
    position: relative;
}

.btn-ai-review {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    z-index: 2;
}

.btn-ai-review:hover {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
    transform: translateY(-1px);
}

.btn-ai-review:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-ai-review .ai-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a78bfa;
    display: inline-block;
}

.btn-ai-review.loading .ai-dot {
    animation: aiPulse 0.8s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.6); }
}

.ai-field-feedback {
    margin-top: 6px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.06), rgba(99, 102, 241, 0.04));
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 8px;
    font-size: 0.75rem;
    line-height: 1.55;
    color: var(--text-secondary);
    animation: feedbackSlideIn 0.25s ease-out;
    position: relative;
}

@keyframes feedbackSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-field-feedback .feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ai-field-feedback .feedback-score {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.8rem;
}

.ai-field-feedback .score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
}

.ai-field-feedback .score-badge.score-high { background: linear-gradient(135deg, #10b981, #059669); }
.ai-field-feedback .score-badge.score-mid { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ai-field-feedback .score-badge.score-low { background: linear-gradient(135deg, #ef4444, #dc2626); }

.ai-field-feedback .feedback-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.ai-field-feedback .feedback-close:hover {
    color: var(--text-primary);
}

.ai-field-feedback .feedback-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.ai-field-feedback .feedback-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Skill suggestion tags */
.skill-suggest-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 0.73rem;
    font-weight: 500;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
    border: 1px dashed rgba(167, 139, 250, 0.35);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.skill-suggest-tag:hover {
    background: rgba(167, 139, 250, 0.22);
    border-color: rgba(167, 139, 250, 0.6);
    border-style: solid;
    color: #c4b5fd;
    transform: scale(1.03);
}

/* ===== AI CHAT PANEL ===== */
.entry-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ai-chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-ai-chat-toggle:hover {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.4);
    color: #c4b5fd;
}

.btn-ai-chat-toggle.active {
    background: rgba(167, 139, 250, 0.2);
    border-color: rgba(167, 139, 250, 0.5);
    color: #c4b5fd;
}

.ai-chat-panel {
    margin-top: 12px;
    border-top: 1px solid rgba(167, 139, 250, 0.12);
    padding-top: 12px;
    animation: feedbackSlideIn 0.3s ease-out;
}

.ai-chat-messages {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    margin-bottom: 10px;
}

.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: rgba(167, 139, 250, 0.2); border-radius: 4px; }

.ai-chat-msg {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: feedbackSlideIn 0.2s ease-out;
}

.ai-chat-msg.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    background: rgba(167, 139, 250, 0.15);
}

.user-msg .msg-avatar { background: rgba(99, 102, 241, 0.15); }

.msg-content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.ai-msg .msg-content {
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.12);
    border-top-left-radius: 4px;
}

.user-msg .msg-content {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-top-right-radius: 4px;
    color: var(--text-primary);
}

.ai-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    transition: border-color 0.2s;
    outline: none;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}

.ai-chat-input:focus {
    border-color: rgba(167, 139, 250, 0.5);
    background: rgba(255, 255, 255, 0.06);
}

.ai-chat-input::placeholder { color: var(--text-muted); }

.btn-ai-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-ai-chat-send:hover {
    background: linear-gradient(135deg, #8b5cf6, #818cf8);
    transform: scale(1.05);
}

.btn-ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.msg-content .typing-dots {
    display: inline-flex;
    gap: 3px;
    padding: 4px 0;
}

.msg-content .typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a78bfa;
    animation: typingBounce 1.2s ease-in-out infinite;
}

.msg-content .typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.msg-content .typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

/* ===== AI CHAT FAB & POPUP ===== */
.ai-chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.3);
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fabPulse 3s ease-in-out infinite;
}
.ai-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
    animation: none;
}
.ai-chat-fab.hidden { display: none; }
.fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #10b981;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 0 rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 0 12px rgba(99, 102, 241, 0); }
}

/* Chat Popup */
.ai-chat-popup {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 400px;
    max-height: 560px;
    background: #0f1629;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.ai-chat-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.ai-chat-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}
.ai-chat-popup-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-chat-popup-icon {
    font-size: 24px;
}
.ai-chat-popup-name {
    font-size: 14px;
    font-weight: 700;
    color: #f0f4fc;
    font-family: 'Inter', sans-serif;
}
.ai-chat-popup-status {
    font-size: 11px;
    color: #10b981;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}
.ai-chat-popup-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.ai-chat-popup-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f4fc;
}

/* Messages */
.ai-chat-popup-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    min-height: 200px;
}
.ai-chat-popup-messages .ai-chat-msg {
    display: flex;
    gap: 8px;
    animation: msgFadeIn 0.3s ease;
}
.ai-chat-popup-messages .ai-chat-msg.user-msg {
    flex-direction: row-reverse;
}
.ai-chat-popup-messages .msg-avatar {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-popup-messages .msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    font-family: 'Inter', sans-serif;
    max-width: 85%;
    word-wrap: break-word;
}
.ai-chat-popup-messages .ai-msg .msg-content {
    background: rgba(99, 102, 241, 0.1);
    color: #c8d0e0;
    border: 1px solid rgba(99, 102, 241, 0.12);
}
.ai-chat-popup-messages .user-msg .msg-content {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    border: none;
}
@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Input area */
.ai-chat-popup-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
    background: rgba(15, 22, 41, 0.8);
}
.ai-chat-popup-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    color: #f0f4fc;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.4;
}
.ai-chat-popup-input:focus {
    border-color: #6366f1;
}
.ai-chat-popup-input::placeholder {
    color: #4a5568;
}
.ai-chat-popup-send {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.ai-chat-popup-send:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}
.ai-chat-popup-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar */
.ai-chat-popup-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-popup-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-popup-messages::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.3); border-radius: 4px; }

/* Responsive */
@media (max-width: 480px) {
    .ai-chat-popup {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 80px;
        max-height: 70vh;
    }
    .ai-chat-fab {
        bottom: 16px;
        right: 16px;
    }
}

/* =============================================
   DASHBOARD SCREEN STYLES
   ============================================= */

/* === Dashboard Screen === */
.dashboard-screen {
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 0 80px;
    animation: dashFadeIn 0.3s ease-out;
}

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

/* === Animated Background Orbs === */
.dashboard-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

.bg-orb-1 {
    width: 900px; height: 900px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
    top: -25%; left: -15%;
    animation: orbDrift1 8s ease-in-out infinite;
}

.bg-orb-2 {
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0) 70%);
    top: 20%; right: -20%;
    animation: orbDrift2 10s ease-in-out infinite;
}

.bg-orb-3 {
    width: 850px; height: 850px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.10) 0%, rgba(168, 85, 247, 0) 70%);
    bottom: -20%; left: 15%;
    animation: orbDrift3 12s ease-in-out infinite;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(80px, -50px) scale(1.08); }
    50% { transform: translate(-40px, 60px) scale(0.95); }
    75% { transform: translate(60px, 30px) scale(1.04); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-70px, 40px) scale(1.06); }
    50% { transform: translate(50px, -80px) scale(0.92); }
    80% { transform: translate(-30px, -30px) scale(1.03); }
}

@keyframes orbDrift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    30% { transform: translate(60px, 50px) scale(1.05); }
    60% { transform: translate(-50px, -40px) scale(0.96); }
    85% { transform: translate(40px, -60px) scale(1.02); }
}

.landing-bg,
.dashboard-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* === Dashboard Header === */
.dashboard-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 48px;
    width: 100%;
    box-sizing: border-box;
}

.dashboard-header .user-menu {
    margin-left: auto;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-logo-icon {
    font-size: 1.8rem;
}

.dashboard-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.dashboard-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    border-left: 1px solid var(--border);
    padding-left: 16px;
}

/* === Hero Section === */
.dashboard-hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 48px 36px;
    animation: heroFadeIn 0.8s ease-out;
}

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

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.hero-line {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
}

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

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* === Grid Section === */
.dashboard-grid-section {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 48px;
}

.dashboard-grid-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.grid-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.grid-title svg {
    color: var(--accent-secondary);
}

.grid-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* === CV Card Grid === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
    gap: 20px;
    animation: gridFadeIn 0.6s ease-out 0.2s both;
}

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

/* === Create New CV Card === */
.cv-card-create {
    background: transparent;
    border: 2px dashed rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    height: 380px;
    min-height: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.cv-card-create::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    transition: all var(--transition-base);
}

.cv-card-create:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.12);
}

.cv-card-create:hover::before {
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

.cv-card-create:hover .create-icon-wrap {
    transform: scale(1.1) rotate(90deg);
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.create-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.create-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.2);
    background: rgba(99, 102, 241, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-secondary);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.create-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-tertiary);
}

.create-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* === Saved CV Card === */
.cv-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 380px;
    animation: cardAppear 0.4s ease-out both;
}

.cv-card:not(.cv-card-create):hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.1);
}

@keyframes cardAppear {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* CV Card Thumbnail */
.cv-card-thumb {
    height: 200px;
    background: linear-gradient(135deg, #1a1f36 0%, #0f1729 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.cv-card-thumb-inner {
    width: 140px;
    background: #fff;
    border-radius: 4px;
    padding: 12px 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: scale(0.95);
    transition: transform var(--transition-base);
    min-height: 170px;
}

.cv-card:hover .cv-card-thumb-inner {
    transform: scale(1);
}

/* Mini CV Preview Lines */
.mini-cv-name {
    height: 6px;
    width: 60%;
    background: #333;
    border-radius: 3px;
    margin: 0 auto 3px;
}

.mini-cv-title {
    height: 4px;
    width: 45%;
    background: #6366f1;
    border-radius: 2px;
    margin: 0 auto 8px;
}

.mini-cv-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

.mini-cv-line {
    height: 3px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-bottom: 3px;
}

.mini-cv-line-long { width: 100%; }
.mini-cv-line-med { width: 75%; }
.mini-cv-line-short { width: 50%; }

.mini-cv-section-title {
    height: 4px;
    width: 40%;
    background: #9ca3af;
    border-radius: 2px;
    margin: 8px 0 4px;
}

/* Template Badge on card */
.cv-card-template-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-tertiary);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CV Card Info */
.cv-card-info {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cv-card-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cv-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.btn-rename {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    opacity: 0;
    transition: all 0.2s ease;
    padding: 0;
}

.cv-card:hover .btn-rename {
    opacity: 1;
}

.btn-rename:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-tertiary);
}

/* Inline rename */
.cv-rename-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cv-rename-input {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-tertiary);
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.cv-rename-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.cv-rename-save,
.cv-rename-cancel {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s ease;
    padding: 0;
}

.cv-rename-save {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.cv-rename-save:hover {
    background: rgba(16, 185, 129, 0.3);
}

.cv-rename-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.cv-rename-cancel:hover {
    background: rgba(239, 68, 68, 0.25);
}

.cv-card-job {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.cv-card-date {
    font-size: 0.72rem;
    color: var(--text-hint);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cv-card-score {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.cv-card-score.score-good {
    background: var(--success-bg);
    color: var(--success);
}

.cv-card-score.score-mid {
    background: var(--warning-bg);
    color: var(--warning);
}

.cv-card-score.score-low {
    background: var(--danger-bg);
    color: var(--danger);
}

/* CV Card Actions */
.cv-card-actions {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--border);
}

.cv-card-action {
    flex: 1;
    padding: 11px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cv-card-action:not(:last-child) {
    border-right: 1px solid var(--border);
}

.cv-card-action:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.cv-card-action.action-delete:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.cv-card-action.action-edit:hover {
    background: var(--accent-glow);
    color: var(--accent-tertiary);
}

.cv-card-action.action-duplicate:hover {
    background: rgba(16, 185, 129, 0.08);
    color: var(--success);
}

/* === Template Selection Modal === */
.template-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.template-modal-overlay.active {
    display: flex;
}

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

.template-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: min(640px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.template-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border);
}

.template-modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.template-modal-body {
    padding: 24px 28px;
}

.template-name-group {
    margin-bottom: 24px;
}

.template-name-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.template-name-group input {
    width: 100%;
}

/* Template Options */
.template-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.template-option:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

.template-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-glow);
}

.template-option.selected .template-check {
    opacity: 1;
    transform: scale(1);
}

.template-check {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Template Preview Thumbnails */
.template-preview {
    width: 80px;
    min-height: 100px;
    background: #fff;
    border-radius: 6px;
    padding: 10px 8px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tpl-header-bar {
    height: 8px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    margin-bottom: 6px;
}

.tpl-sidebar-block {
    width: 20px;
    height: 50px;
    background: #1e293b;
    border-radius: 2px;
    float: left;
    margin-right: 6px;
    margin-bottom: 4px;
}

.tpl-bold-divider {
    height: 3px;
    background: #1e293b;
    margin: 6px 0;
    border-radius: 2px;
}

.tpl-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

.tpl-spacer {
    height: 6px;
}

.tpl-section-gap {
    height: 8px;
}

.tpl-line {
    border-radius: 2px;
    margin-bottom: 3px;
}

.tpl-line-title {
    height: 5px;
    width: 55%;
    background: #374151;
}

.tpl-line-sub {
    height: 3px;
    width: 40%;
    background: #9ca3af;
}

.tpl-line-long {
    height: 3px;
    width: 90%;
    background: #e5e7eb;
}

.tpl-line-med {
    height: 3px;
    width: 65%;
    background: #e5e7eb;
}

.tpl-line-short {
    height: 3px;
    width: 45%;
    background: #e5e7eb;
}

.template-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.template-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.template-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.template-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border);
}

/* === Back to Dashboard Button === */
.btn-back-dashboard {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-back-dashboard:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-tertiary);
    transform: translateX(-2px);
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}

/* CV Name Badge in topbar */
.cv-name-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    background: var(--accent-glow);
    color: var(--accent-tertiary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cv-name-badge:empty {
    display: none;
}

/* === Delete Confirmation Overlay === */
.delete-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.delete-confirm-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: min(420px, 90vw);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.delete-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.delete-confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.delete-confirm-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.delete-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-delete-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.btn-delete-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-delete-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

.btn-delete-yes:hover {
    background: #dc2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* === Screen Transitions === */
.dashboard-screen {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dashboard-screen.hiding {
    opacity: 0;
    transform: scale(0.98);
}

.app-container.entering {
    animation: builderEnter 0.4s ease-out;
}

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

/* === Dashboard Responsive === */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 20px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .dashboard-tagline {
        border-left: none;
        padding-left: 0;
    }
    .dashboard-hero {
        padding: 32px 24px 24px;
    }
    .hero-line {
        font-size: 1.8rem;
    }
    .dashboard-grid-section {
        padding: 12px 24px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .cv-card-create {
        min-height: 240px;
    }
}

@media (max-width: 480px) {
    .hero-line {
        font-size: 1.5rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .template-options {
        gap: 10px;
    }
    .template-option {
        padding: 12px;
    }
    .template-preview {
        width: 60px;
        min-height: 80px;
        padding: 8px 6px;
    }
}

/* =============================================
   AUTH SCREEN STYLES
   ============================================= */

.auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    background: var(--bg-primary);
    padding: 20px;
}

.auth-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.auth-logo {
    text-align: center;
}

.auth-logo svg {
    margin-bottom: 12px;
}

.auth-brand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.auth-brand span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-card {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-family: inherit;
}

.auth-tab.active {
    color: var(--accent-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.02);
}

.auth-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-field input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.auth-field input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-field input::placeholder {
    color: var(--text-hint);
}

.auth-message {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auth-btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.auth-btn-primary:active {
    transform: translateY(0);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-hint);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-btn-google {
    width: 100%;
    padding: 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.auth-btn-google:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.auth-btn-google:disabled {
    opacity: 0.6;
    cursor: wait;
}

.auth-forgot {
    text-align: center;
}

.auth-forgot a {
    color: var(--text-hint);
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot a:hover {
    color: var(--accent-primary);
}

/* =============================================
   USER MENU STYLES
   ============================================= */

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.user-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.3);
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
    padding: 0;
}

.user-avatar-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.user-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar-btn span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-info {
    padding: 12px 16px;
}

.user-dropdown-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-email {
    font-size: 0.78rem;
    color: var(--text-hint);
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.user-dropdown-item {
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.user-dropdown-item:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
}

/* Auth responsive */
@media (max-width: 480px) {
    .auth-container {
        max-width: 100%;
    }
    .auth-form {
        padding: 20px 16px;
    }
    .auth-brand {
        font-size: 1.6rem;
    }
}

/* =============================================
   TRANSLATE BUTTON STYLES
   ============================================= */

/* Wrapper for input + translate button */
.translate-wrap {
    position: relative;
    width: 100%;
}

/* Make wrapped inputs fill the wrapper */
.translate-wrap input[type="text"],
.translate-wrap textarea {
    width: 100%;
}

/* The translate button */
.btn-translate {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

/* Show on wrapper hover or focus-within */
.translate-wrap:hover .btn-translate,
.translate-wrap:focus-within .btn-translate {
    opacity: 1;
}

.btn-translate:hover {
    background: rgba(99, 102, 241, 0.25);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-translate:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-translate:disabled {
    opacity: 0.5 !important;
    cursor: wait;
}

/* For textarea — toolbar button style (sits in textarea-tools bar) */
.btn-translate-toolbar {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    opacity: 1 !important;
    width: auto;
    height: auto;
    padding: 4px 10px;
    font-size: 0.78rem;
    gap: 4px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent-tertiary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-translate-toolbar:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    transform: none !important;
}

.btn-translate-toolbar:active {
    transform: scale(0.97) !important;
}

/* Bullet items — translate-wrap takes flex space of the input */
.bullet-item .translate-wrap {
    flex: 1;
    min-width: 0;
}

.bullet-item .translate-wrap input[type="text"] {
    width: 100%;
}

/* Loading spinner */
.translate-spin {
    animation: translateSpin 1s linear infinite;
    display: inline-block;
}

@keyframes translateSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Add padding-right to inputs when hovered to avoid text overlap */
.translate-wrap:hover input[type="text"],
.translate-wrap:focus-within input[type="text"] {
    padding-right: 38px;
}

/* =========================================
   LANDING PAGE STYLES
   ========================================= */
.landing-screen {
    display: block;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: #e2e8f0;
}

/* Landing Background */
.landing-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.landing-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Landing Nav */
.landing-nav {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 48px);
    max-width: 1100px;
    padding: 0;
    border-radius: 50px;
    background: rgba(15, 18, 35, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: navSlideDown 0.6s ease both;
}

@keyframes navSlideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.landing-nav-inner {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.landing-logo-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.landing-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-accent {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-nav-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-landing-login {
    padding: 9px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.04);
    color: #c8cfd8;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.2px;
}

.btn-landing-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-landing-signup {
    padding: 9px 22px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.btn-landing-signup::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-landing-signup:hover::after {
    transform: translateX(100%);
}

.btn-landing-signup:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

/* Hero Section */
.landing-hero {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 140px 32px 80px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 13px;
    font-weight: 500;
    color: #a5b4fc;
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: clamp(36px, 6vw, 60px);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-gradient {
    background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.7;
    color: #94a3b8;
    max-width: 650px;
    margin: 0 auto 40px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 60px;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-hero-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-hero-primary:hover::after {
    transform: translateX(100%);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.1);
}

/* Features Section */
.landing-features {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 32px;
}

.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -1px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 32px 28px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #94a3b8;
}

/* Steps Section */
.landing-steps {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 32px 80px;
}

.steps-grid {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
}

.step-card {
    flex: 1;
    max-width: 280px;
    padding: 32px 24px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    transition: all 0.3s;
}

.step-card:hover {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-3px);
}

.step-number {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.step-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.step-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #94a3b8;
}

.step-arrow {
    font-size: 28px;
    color: #4f46e5;
    font-weight: 700;
}

/* CTA Section */
.landing-cta {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.cta-card {
    text-align: center;
    padding: 60px 40px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
    animation: spin 20s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cta-card h2 {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    position: relative;
}

.cta-card p {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 32px;
    position: relative;
}

.btn-cta-start {
    position: relative;
}

/* Footer */
.landing-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 32px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-copy {
    font-size: 13px;
    color: #475569;
}

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

/* =============================================
   RESPONSIVE — TABLET (max-width: 768px)
   ============================================= */
@media (max-width: 768px) {
    /* --- Landing Nav --- */
    .landing-nav {
        top: 10px;
        width: calc(100% - 24px);
        border-radius: 40px;
    }
    .landing-nav-inner {
        padding: 10px 16px;
    }
    .landing-logo-text {
        font-size: 17px;
    }
    .landing-logo-icon {
        font-size: 18px;
    }
    .landing-nav-actions {
        gap: 6px;
    }
    .btn-landing-login {
        padding: 7px 14px;
        font-size: 12px;
    }
    .btn-landing-signup {
        padding: 7px 16px;
        font-size: 12px;
    }

    /* --- Landing Hero --- */
    .landing-hero {
        padding: 110px 20px 50px;
    }
    .hero-badge {
        font-size: 11px;
        padding: 6px 14px;
        margin-bottom: 20px;
    }
    .hero-title {
        font-size: clamp(28px, 8vw, 42px);
        margin-bottom: 16px;
        letter-spacing: -1px;
    }
    .hero-subtitle {
        font-size: 15px;
        margin-bottom: 28px;
        padding: 0 8px;
    }
    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        margin-bottom: 40px;
    }
    .btn-hero-primary,
    .btn-hero-secondary {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 50px;
    }
    .hero-stats {
        flex-direction: row;
        gap: 16px;
    }
    .stat-number {
        font-size: 22px;
    }
    .stat-label {
        font-size: 11px;
    }
    .stat-divider {
        width: 1px;
        height: 30px;
    }

    /* --- Features --- */
    .landing-features {
        padding: 50px 20px;
    }
    .features-header {
        margin-bottom: 36px;
    }
    .section-badge {
        font-size: 11px;
        padding: 5px 12px;
    }
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .feature-card {
        padding: 24px 20px;
    }
    .feature-icon {
        font-size: 30px;
        margin-bottom: 12px;
    }
    .feature-card h3 {
        font-size: 16px;
    }
    .feature-card p {
        font-size: 13px;
    }

    /* --- Steps --- */
    .landing-steps {
        padding: 40px 20px 50px;
    }
    .steps-grid {
        flex-direction: column;
        gap: 16px;
    }
    .step-card {
        max-width: 100%;
        padding: 24px 20px;
    }
    .step-number {
        font-size: 36px;
        margin-bottom: 10px;
    }
    .step-card h3 {
        font-size: 16px;
    }
    .step-arrow {
        transform: rotate(90deg);
        font-size: 22px;
    }

    /* --- CTA --- */
    .landing-cta {
        padding: 20px 20px 50px;
    }
    .cta-card {
        padding: 40px 24px;
        border-radius: 20px;
    }
    .cta-card h2 {
        font-size: 24px;
    }
    .cta-card p {
        font-size: 14px;
        margin-bottom: 24px;
    }

    /* --- Footer --- */
    .landing-footer {
        padding: 24px 0;
    }
    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 0 20px;
    }
    .footer-copy {
        font-size: 11px;
    }

    /* --- Auth Screen --- */
    .auth-screen {
        padding: 20px 16px;
    }
    .auth-container {
        max-width: 100%;
    }
    .auth-header {
        padding: 24px 20px 16px;
    }
    .auth-brand-icon {
        font-size: 2rem;
    }
    .auth-brand {
        font-size: 1.6rem;
    }
    .auth-form {
        padding: 20px 16px;
    }

    /* --- Dashboard --- */
    .dashboard-header {
        padding: 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .dashboard-tagline {
        border-left: none;
        padding-left: 0;
    }
    .dashboard-hero {
        padding: 28px 20px 20px;
    }
    .hero-line {
        font-size: 1.6rem;
    }
    .dashboard-grid-section {
        padding: 12px 20px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    /* --- Builder --- */
    .form-container {
        padding: 20px 16px;
    }
    .topbar {
        padding: 0 12px;
        gap: 6px;
    }
    .topbar-actions {
        gap: 4px;
    }
    .topbar-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    .preview-modal {
        width: 98%;
        height: 96vh;
        border-radius: 12px;
    }
    .preview-content {
        padding: 16px;
    }
    .cv-page {
        width: 100%;
        padding: 24px 20px;
        font-size: 9.5pt;
    }

    /* --- Background orbs scale down --- */
    .bg-orb-1 { width: 500px; height: 500px; }
    .bg-orb-2 { width: 400px; height: 400px; }
    .bg-orb-3 { width: 450px; height: 450px; }

    /* --- AI Chat Popup --- */
    .ai-chat-popup {
        width: calc(100vw - 20px) !important;
        right: 10px !important;
        bottom: 70px !important;
        max-height: 70vh !important;
    }
}

/* =============================================
   RESPONSIVE — PHONE (max-width: 480px)
   ============================================= */
@media (max-width: 480px) {
    /* --- Landing Nav compact --- */
    .landing-nav {
        top: 8px;
        width: calc(100% - 16px);
    }
    .landing-nav-inner {
        padding: 8px 14px;
    }
    .landing-logo-text {
        font-size: 15px;
    }
    .landing-logo-icon {
        font-size: 16px;
    }
    .btn-landing-login {
        padding: 6px 12px;
        font-size: 11px;
    }
    .btn-landing-signup {
        padding: 6px 14px;
        font-size: 11px;
    }

    /* --- Hero even more compact --- */
    .landing-hero {
        padding: 100px 16px 40px;
    }
    .hero-title {
        font-size: clamp(24px, 9vw, 36px);
    }
    .hero-subtitle {
        font-size: 14px;
    }
    .btn-hero-primary,
    .btn-hero-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    .hero-stats {
        gap: 12px;
    }
    .stat-number {
        font-size: 20px;
    }

    /* --- Features compact --- */
    .feature-card {
        padding: 20px 16px;
    }

    /* --- CTA compact --- */
    .cta-card {
        padding: 32px 20px;
        border-radius: 16px;
    }
    .cta-card h2 {
        font-size: 20px;
    }

    /* --- Dashboard compact --- */
    .hero-line {
        font-size: 1.3rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .cv-card-create {
        min-height: 200px;
    }

    /* --- Template picker --- */
    .template-options {
        gap: 10px;
    }
    .template-option {
        padding: 12px;
    }
    .template-preview {
        width: 60px;
        min-height: 80px;
        padding: 8px 6px;
    }

    /* --- Auth compact --- */
    .auth-container {
        max-width: 100%;
    }
    .auth-form {
        padding: 16px 14px;
    }
    .auth-brand {
        font-size: 1.4rem;
    }

    /* --- Builder compact --- */
    .topbar {
        padding: 0 8px;
    }
    .sidebar {
        width: 260px;
    }

    /* --- Background orbs hide on very small --- */
    .bg-orb-2,
    .bg-orb-3 {
        display: none;
    }
    .bg-orb-1 {
        width: 350px;
        height: 350px;
        opacity: 0.1;
    }
}
