/* ==========================================================================
   APPLE HIG-INSPIRED DESIGN SYSTEM (JOB HUNTER PRO)
   ========================================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- Root Variables & Theme Tokens --- */
:root {
    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);

    /* Border Radius (Squircle Style) */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

    /* Light Theme (Apple Studio Light) */
    --bg-app: #f4f4f7;
    --bg-sidebar: rgba(255, 255, 255, 0.7);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.45);
    --bg-tooltip: #1d1d1f;
    
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-focus: rgba(0, 102, 204, 0.3);
    
    --text-primary: #1d1d1f;
    --text-secondary: #515154;
    --text-muted: #86868b;
    --text-light: #ffffff;

    /* Accents (SF Colors) */
    --accent-1: #0066cc;          /* SF Blue */
    --accent-1-light: rgba(0, 102, 204, 0.08);
    --accent-2: #0588a6;          /* SF Teal */
    --accent-3: #e0245e;          /* SF Pink */
    --accent-4: #10b981;          /* SF Green */
    --accent-warning: #f59e0b;    /* SF Orange */

    --gradient-accent: linear-gradient(135deg, #0066cc, #3399ff);
    --gradient-rose: linear-gradient(135deg, #e0245e, #ff6b8b);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #c084fc);
    
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.06);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.03);
}

/* --- Dark Theme Override (Premium Obsidian Cinematic Dark) --- */
html.dark {
    --bg-app: #080810;             /* Dark space-indigo background */
    --bg-sidebar: rgba(13, 13, 25, 0.4); /* Translucent dark glass */
    --bg-card: rgba(18, 18, 36, 0.5);   /* Translucent elevated card */
    --bg-glass: rgba(25, 25, 50, 0.25);  /* Translucent glass dialogs */
    --bg-tooltip: #f5f5f7;

    --border-subtle: rgba(255, 255, 255, 0.08); /* Hairline white border */
    --border-focus: rgba(99, 102, 241, 0.4);   /* Purple-blue focus border */

    --text-primary: #f5f5f7;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-light: #080810;

    /* Accents Dark Mode */
    --accent-1: #6366f1;          /* Indigo Blue */
    --accent-1-light: rgba(99, 102, 241, 0.15);
    --accent-2: #06b6d4;          /* Cyan */
    --accent-3: #d946ef;          /* Neon Pink */
    --accent-4: #10b981;          /* Emerald Green */
    --accent-warning: #f59e0b;    /* Amber */

    --gradient-accent: linear-gradient(135deg, #6366f1, #818cf8);
    --gradient-rose: linear-gradient(135deg, #d946ef, #f472b6);
    --gradient-purple: linear-gradient(135deg, #a855f7, #c084fc);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color var(--transition-slow);
}

/* Ambient glow highlights (dynamic spatial gradients) */
.ambient-glow {
    position: fixed;
    top: -15%;
    left: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 65%);
    z-index: -2;
    filter: blur(100px);
    pointer-events: none;
    animation: pulseGlow 25s infinite alternate ease-in-out;
}

.ambient-glow-2 {
    position: fixed;
    bottom: -15%;
    right: -10%;
    width: 55vw;
    height: 55vh;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.08) 0%, transparent 65%);
    z-index: -2;
    filter: blur(120px);
    pointer-events: none;
    animation: pulseGlow 30s infinite alternate-reverse ease-in-out;
}

.ambient-glow-3 {
    position: fixed;
    top: 40%;
    left: 45%;
    width: 40vw;
    height: 40vh;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, transparent 65%);
    z-index: -2;
    filter: blur(90px);
    pointer-events: none;
    animation: pulseGlow 28s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(6%, 6%); }
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ==========================================================================
   SIDEBAR (DESKTOP)
   ========================================================================== */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--bg-sidebar);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 30px 16px;
    transition: var(--transition-slow);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.sidebar-logo img {
    transition: transform var(--transition);
}

.sidebar-logo:hover img {
    transform: scale(1.05) rotate(2deg);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Sidebar Nav Buttons with Native CSS Animations */
@keyframes navBtnFadeIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-btn {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: left;
    transition: var(--transition-fast);
    position: relative;
    opacity: 0;
    animation: navBtnFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-btn:nth-child(1) { animation-delay: 0.05s; }
.nav-btn:nth-child(2) { animation-delay: 0.1s; }
.nav-btn:nth-child(3) { animation-delay: 0.15s; }
.nav-btn:nth-child(4) { animation-delay: 0.2s; }
.nav-btn:nth-child(5) { animation-delay: 0.25s; }
.nav-btn:nth-child(6) { animation-delay: 0.3s; }
.nav-btn:nth-child(7) { animation-delay: 0.35s; }
.nav-btn:nth-child(8) { animation-delay: 0.4s; }
.nav-btn:nth-child(9) { animation-delay: 0.45s; }
.nav-btn:nth-child(10) { animation-delay: 0.5s; }

.nav-btn i {
    font-size: 16px;
    width: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.nav-btn .nav-label {
    flex: 1;
}

/* Sidebar Active & Hover States */
.nav-btn:hover {
    background-color: var(--bg-glass);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-btn:hover i {
    color: var(--accent-1);
}

.nav-btn.active {
    background-color: var(--accent-1-light);
    color: var(--accent-1);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.06);
    border: 1px solid var(--border-focus);
}

.nav-btn.active i {
    color: var(--accent-1);
}

/* Tooltips */
.nav-tooltip {
    display: none; /* Hidden by default on sidebar */
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

/* ==========================================================================
   COMPONENTS & UI BLOCKS
   ========================================================================== */

/* Page General Layout */
.page {
    display: none;
    opacity: 0;
    flex-direction: column;
}

.page.active {
    display: flex;
    animation: pageReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Staggered card reveals inside active pages */
.page.active .card,
.page.active .upload-zone,
.page.active .stat-card,
.page.active .job-card,
.page.active .notif-item {
    animation: cardReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* Dynamic staggering delay */
.page.active .upload-zone,
.page.active .card:nth-child(1),
.page.active .stat-card:nth-child(1),
.page.active .job-card:nth-child(1) {
    animation-delay: 0.05s;
}
.page.active .card:nth-child(2),
.page.active .stat-card:nth-child(2),
.page.active .job-card:nth-child(2) {
    animation-delay: 0.12s;
}
.page.active .card:nth-child(3),
.page.active .stat-card:nth-child(3),
.page.active .job-card:nth-child(3) {
    animation-delay: 0.18s;
}
.page.active .card:nth-child(4),
.page.active .stat-card:nth-child(4),
.page.active .job-card:nth-child(4) {
    animation-delay: 0.24s;
}

/* Page Header styling */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.page-header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-1);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Premium Apple Card */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 113, 227, 0.12);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--accent-1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.2);
}

.btn-primary:hover {
    background-color: #0077ed;
    box-shadow: 0 6px 18px rgba(0, 113, 227, 0.35);
    transform: translateY(-1px);
}

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

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-glass);
    border-color: var(--text-secondary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    background-color: var(--bg-glass);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Form Inputs */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 2px;
}

.form-group label .req {
    color: var(--accent-3);
}

.form-input, .select-input {
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    transition: var(--transition-fast);
}

.form-input:focus, .select-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--border-focus);
    background-color: var(--bg-card);
}

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

/* ==========================================================================
   PAGE: CV UPLOAD
   ========================================================================== */
.upload-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 60px 24px;
    text-align: center;
    background-color: var(--bg-glass);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-1);
    background-color: rgba(0, 113, 227, 0.03);
    transform: scale(1.005);
}

.upload-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-1-light);
    color: var(--accent-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.upload-zone:hover .upload-icon-wrapper {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.15);
}

.upload-zone h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    color: var(--text-primary);
}

.upload-zone p {
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Upload Progress Bar */
.upload-progress {
    display: none;
    margin-top: 20px;
    padding: 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.progress-bar {
    height: 6px;
    width: 100%;
    background-color: var(--border-subtle);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent-1);
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}

.upload-status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
}

/* Analyzed CV Grid */
.cv-info {
    display: none;
    margin-top: 32px;
}

.cv-info.show {
    display: block;
    animation: fadeInUp 0.5s ease forwards;
}

.cv-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.cv-info-icon {
    font-size: 24px;
    color: var(--accent-4);
}

.cv-info-header h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
}

.cv-info-header p {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.cv-field {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cv-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cv-field-label i {
    font-size: 12px;
    color: var(--accent-1);
}

.cv-field-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Skill tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

/* ==========================================================================
   PAGE: CONTRACT ANALYZER
   ========================================================================== */
.contract-tab-btn {
    border-bottom: 2px solid transparent !important;
}

.contract-tab-btn.active {
    color: var(--accent-warning) !important;
    border-bottom: 2px solid var(--accent-warning) !important;
}

.contract-tab {
    animation: fadeInUp 0.4s ease forwards;
}

/* ==========================================================================
   PAGE: BUILD CV FROM SCRATCH
   ========================================================================== */
.cv-builder-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 4px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 60px;
    cursor: pointer;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.step.active .step-num {
    background-color: var(--accent-1);
    border-color: var(--accent-1);
    color: #ffffff;
    box-shadow: 0 0 0 3px var(--border-focus);
}

.step.completed .step-num {
    background-color: var(--accent-4);
    border-color: var(--accent-4);
    color: #ffffff;
}

.step-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-subtle);
    min-width: 16px;
    margin-top: -16px;
}

.step.completed + .step-line {
    background-color: var(--accent-4);
}

/* Builder Sections */
.cv-builder-step {
    display: none;
    flex-direction: column;
    gap: 20px;
    animation: pageReveal 0.4s ease forwards;
}

.cv-builder-step.active {
    display: flex;
}

.cv-builder-step h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: -12px;
}

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

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

.ai-hint-box {
    background-color: var(--accent-1-light);
    border: 1px solid rgba(0, 113, 227, 0.15);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: var(--accent-1);
    font-size: 12px;
    line-height: 1.5;
}

.ai-hint-box i {
    font-size: 16px;
    margin-top: 2px;
}

/* Experience entries */
.exp-entry, .train-entry, .edu-entry {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.exp-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-remove-entry {
    background: transparent;
    border: none;
    color: var(--accent-3);
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    transition: var(--transition-fast);
}

.btn-remove-entry:hover {
    transform: scale(1.1);
}

.cv-builder-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

/* Builder Result */
.cv-builder-result {
    background-color: var(--bg-card);
    border: 1px dashed var(--accent-4);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: scaleUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   PAGE: AI CHAT (CAREER ADVISOR)
   ========================================================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 80%;
    align-self: flex-start;
    animation: fadeInUp 0.4s ease forwards;
}

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

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.chat-msg.user .chat-avatar {
    background: var(--gradient-accent);
    color: #ffffff;
    border: none;
}

.chat-bubble {
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.5;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    position: relative;
    word-break: break-word;
}

.chat-msg.user .chat-bubble {
    background: var(--gradient-accent);
    color: #ffffff;
    border: none;
    border-top-right-radius: 4px;
}

.chat-msg.assistant .chat-bubble {
    border-top-left-radius: 4px;
}

.chat-features {
    list-style: none;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.chat-features i {
    color: var(--accent-1);
}

.chat-input-area {
    padding: 16px 20px;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    min-height: 38px;
    outline: none;
    line-height: 1.4;
    transition: var(--transition-fast);
}

.chat-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.chat-input-area button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

/* ==========================================================================
   PAGE: JOBS MATCHES
   ========================================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.stat-icon.purple { background-color: rgba(143, 82, 222, 0.1); color: #af52de; }
.stat-icon.green { background-color: rgba(52, 199, 89, 0.1); color: #34c759; }
.stat-icon.cyan { background-color: rgba(48, 176, 199, 0.1); color: #30b0c7; }
.stat-icon.rose { background-color: rgba(255, 45, 85, 0.1); color: #ff2d55; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Jobs Toolbar */
.jobs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    padding-left: 36px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    transition: var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.governorate-select {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.governorate-select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--border-focus);
}

.filter-group {
    display: flex;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2px;
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 8px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.filter-btn.active {
    background-color: var(--bg-card);
    color: var(--accent-1);
    box-shadow: var(--shadow-sm);
}

/* Jobs Grid */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.job-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 113, 227, 0.15);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.job-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.match-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.match-high { background-color: rgba(52, 199, 89, 0.1); color: #34c759; border: 1px solid rgba(52, 199, 89, 0.15); }
.match-medium { background-color: rgba(255, 149, 0, 0.1); color: #ff9500; border: 1px solid rgba(255, 149, 0, 0.15); }
.match-low { background-color: rgba(255, 45, 85, 0.1); color: #ff2d55; border: 1px solid rgba(255, 45, 85, 0.15); }

.job-company {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.job-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.job-skill-tag {
    font-size: 10.5px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    align-items: center;
}

.status-select {
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 8px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
}

/* Empty State styling */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    gap: 12px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 13px;
    max-width: 320px;
}

/* External Iraqi job links section (Bento grid style) */
.external-jobs-bento {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 40px;
    box-shadow: var(--shadow-md);
}

.external-jobs-bento h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.ext-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
}

.ext-link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ext-link-card:hover {
    background-color: var(--accent-1-light);
    border-color: var(--accent-1);
    color: var(--accent-1);
    transform: translateY(-1px);
}

/* ==========================================================================
   PAGE: ATS RESUME
   ========================================================================== */
.ats-card {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ats-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 15px;
}

.ats-card-header i {
    color: var(--accent-warning);
}

.ats-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--accent-1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

#ats-result {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ats-result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.resume-preview {
    background-color: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 600px;
    box-shadow: var(--shadow-md);
}

.resume-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   PAGE: NOTIFICATIONS & EMAILS LISTS
   ========================================================================== */
.notif-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notif-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 14px;
    transition: var(--transition-fast);
}

.notif-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.notif-item.unread {
    border-left: 3px solid var(--accent-1);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent-1);
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-time {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* Badge count styling */
.badge {
    background-color: var(--accent-3);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    min-width: 16px;
    text-align: center;
    margin-left: auto;
}

/* ==========================================================================
   MODALS AND OVERLAYS (frosted glass sheets)
   ========================================================================== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease forwards;
}

.auth-card {
    animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background-color: rgba(29, 29, 31, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: slideInRight 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.toast-success {
    background-color: rgba(52, 199, 89, 0.95);
}

.toast-error {
    background-color: rgba(255, 59, 48, 0.95);
}

.toast-info {
    background-color: rgba(0, 113, 227, 0.95);
}

@keyframes slideInRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION & DRAWER
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
}

.mobile-more-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-more-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-more-menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border-subtle);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom)) 16px;
    z-index: 9999;
    transition: bottom 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
}

.mobile-more-overlay.open .mobile-more-menu {
    bottom: 0;
}

.mobile-more-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mobile-more-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

.close-more-btn {
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
}

.mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mobile-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.mobile-more-item i {
    font-size: 20px;
    color: var(--text-secondary);
}

.mobile-more-item span {
    font-size: 11px;
    font-weight: 600;
}

.mobile-more-item.active {
    background-color: var(--accent-1-light);
    border-color: var(--accent-1);
    color: var(--accent-1);
}

.mobile-more-item.active i {
    color: var(--accent-1);
}

.mobile-theme-row {
    grid-column: span 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: 8px;
}

.mobile-theme-row span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.logout-item {
    grid-column: span 3;
    background-color: rgba(255, 45, 85, 0.05);
    border-color: rgba(255, 45, 85, 0.1);
    color: var(--accent-3);
    margin-top: 8px;
}

.logout-item i {
    color: var(--accent-3);
}

/* ==========================================================================
   RESPONSIVENESS & MEDIA QUERIES (MOBILE FIRST)
   ========================================================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        pointer-events: none;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px calc(80px + env(safe-area-inset-bottom)) 16px;
    }

    /* Mobile bottom navigation bar (Apple Style) */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background-color: var(--bg-sidebar);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-subtle);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    }

    .mobile-nav-btn {
        background: transparent;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 4px 12px;
        transition: var(--transition-fast);
    }

    .mobile-nav-btn i {
        font-size: 18px;
        color: var(--text-muted);
    }

    .mobile-nav-btn span {
        font-size: 10px;
        font-weight: 500;
    }

    .mobile-nav-btn.active {
        color: var(--accent-1);
    }

    .mobile-nav-btn.active i {
        color: var(--accent-1);
    }

    .cv-grid {
        grid-template-columns: 1fr;
    }

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

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

    .page-header h1 {
        font-size: 20px;
    }

    .chat-container {
        height: calc(100vh - 170px);
    }
}

/* Animate page entries slightly */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}
