/* ==========================================
   RESUMEFORGE — GLOBAL STYLES
   4 Workspace themes · 10 Resume themes
   ========================================== */

/* ==========================================
   WEBSITE THEME DEFINITIONS
   Applied as data-site-theme on <body>
   ========================================== */

/* — 1. OBSIDIAN (default) — */
body,
body[data-site-theme="obsidian"] {
    --app-bg:          #0d1117;
    --app-panel-bg:    rgba(18, 23, 31, 0.97);
    --app-panel-border:rgba(255,255,255,0.07);
    --app-text:        #e6edf3;
    --app-text-muted:  #7d8590;
    --app-border:      rgba(255,255,255,0.08);
    --app-accent:      #3b82f6;
    --app-accent-rgb:  59,130,246;
    --app-accent-hover:#2563eb;
    --app-danger:      #f85149;
    --app-success:     #3fb950;
    --app-view-bg:     radial-gradient(ellipse at 65% 0%, rgba(59,130,246,0.07) 0%, transparent 55%),
                       radial-gradient(ellipse at 0% 100%, rgba(99,102,241,0.05) 0%, transparent 55%),
                       #0d1117;
    --app-brand-gradient: linear-gradient(135deg, #60a5fa, #818cf8);
    --app-btn-active-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* — 2. AURORA — */
body[data-site-theme="aurora"] {
    --app-bg:          #0a0614;
    --app-panel-bg:    rgba(16, 10, 30, 0.97);
    --app-panel-border:rgba(168,85,247,0.12);
    --app-text:        #ede9fe;
    --app-text-muted:  #8b7fa8;
    --app-border:      rgba(168,85,247,0.12);
    --app-accent:      #a855f7;
    --app-accent-rgb:  168,85,247;
    --app-accent-hover:#9333ea;
    --app-danger:      #f472b6;
    --app-success:     #34d399;
    --app-view-bg:     radial-gradient(ellipse at 70% 0%, rgba(168,85,247,0.1) 0%, transparent 55%),
                       radial-gradient(ellipse at 0% 100%, rgba(236,72,153,0.06) 0%, transparent 55%),
                       #0a0614;
    --app-brand-gradient: linear-gradient(135deg, #c084fc, #f472b6);
    --app-btn-active-gradient: linear-gradient(135deg, #a855f7, #ec4899);
}

/* — 3. FOREST — */
body[data-site-theme="forest"] {
    --app-bg:          #050e08;
    --app-panel-bg:    rgba(8, 18, 12, 0.97);
    --app-panel-border:rgba(34,197,94,0.1);
    --app-text:        #dcfce7;
    --app-text-muted:  #6b9e7a;
    --app-border:      rgba(34,197,94,0.1);
    --app-accent:      #22c55e;
    --app-accent-rgb:  34,197,94;
    --app-accent-hover:#16a34a;
    --app-danger:      #f87171;
    --app-success:     #4ade80;
    --app-view-bg:     radial-gradient(ellipse at 60% 0%, rgba(34,197,94,0.08) 0%, transparent 55%),
                       radial-gradient(ellipse at 0% 100%, rgba(16,185,129,0.05) 0%, transparent 55%),
                       #050e08;
    --app-brand-gradient: linear-gradient(135deg, #4ade80, #34d399);
    --app-btn-active-gradient: linear-gradient(135deg, #22c55e, #16a34a);
}

/* — 4. POLAR (light mode) — */
body[data-site-theme="polar"] {
    --app-bg:          #f0f4f8;
    --app-panel-bg:    rgba(255, 255, 255, 0.95);
    --app-panel-border:rgba(0,0,0,0.06);
    --app-text:        #1e293b;
    --app-text-muted:  #64748b;
    --app-border:      rgba(0,0,0,0.07);
    --app-accent:      #3b82f6;
    --app-accent-rgb:  59,130,246;
    --app-accent-hover:#2563eb;
    --app-danger:      #ef4444;
    --app-success:     #10b981;
    --app-view-bg:     radial-gradient(ellipse at 60% 0%, rgba(59,130,246,0.06) 0%, transparent 55%), #f0f4f8;
    --app-brand-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
    --app-btn-active-gradient: linear-gradient(135deg, #3b82f6, #6366f1);
}

/* ==========================================
   RESUME TOKEN DEFAULTS (theme-* override)
   ========================================== */
:root {
    --res-primary:     #1e293b;
    --res-secondary:   #475569;
    --res-accent:      #2563eb;
    --res-text:        #334155;
    --res-bg:          #ffffff;
    --res-border:      #e2e8f0;
    --res-shadow:      0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);

    --font-heading:    'Outfit', sans-serif;
    --font-body:       'Inter', sans-serif;
    --font-serif:      'Playfair Display', serif;
    --font-mono:       'Fira Code', monospace;

    --paper-width:     210mm;
    --paper-height:    297mm;

    --res-font-size:   10.5pt;
    --res-line-height: 1.5;
    --res-section-gap: 5.5mm;
    --res-bullet-gap:  1.5mm;
    --res-padding:     18mm 20mm;
    --res-header-gap:  5mm;
    --res-title-gap:   2.5mm;
    --res-item-gap:    3.5mm;
}

/* ==========================================
   GLOBAL RESET
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--app-bg);
    color: var(--app-text);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================
   APP SHELL
   ========================================== */
.app-container { display: flex; min-height: 100vh; }

/* ==========================================
   SIDEBAR
   ========================================== */
.control-panel {
    width: 295px;
    min-width: 295px;
    flex-shrink: 0;
    background: var(--app-panel-bg);
    border-right: 1px solid var(--app-panel-border, var(--app-border));
    padding: 20px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.control-panel::-webkit-scrollbar { width: 3px; }
.control-panel::-webkit-scrollbar-track { background: transparent; }
.control-panel::-webkit-scrollbar-thumb { background: var(--app-border); border-radius: 2px; }

/* ── Brand Header ── */
.panel-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--app-border);
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--app-brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(var(--app-accent-rgb, 59,130,246), 0.35);
}
.brand-icon svg { width: 18px; height: 18px; stroke: white; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    background: var(--app-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.brand-tagline {
    font-size: 0.68rem;
    color: var(--app-text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ── Website Theme Trigger Button ── */
.site-theme-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(var(--app-accent-rgb, 59,130,246), 0.08);
    border: 1px solid rgba(var(--app-accent-rgb, 59,130,246), 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}
.site-theme-trigger:hover {
    background: rgba(var(--app-accent-rgb, 59,130,246), 0.14);
    border-color: rgba(var(--app-accent-rgb, 59,130,246), 0.35);
    transform: translateY(-1px);
}

.site-theme-trigger-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--app-text);
}
.site-theme-trigger-left svg { stroke: var(--app-accent); }

.site-theme-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--app-accent);
    background: rgba(var(--app-accent-rgb, 59,130,246), 0.12);
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* ── Panel Sections ── */
.panel-section { display: flex; flex-direction: column; gap: 10px; }

.section-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--app-text-muted);
    padding-left: 2px;
}

/* ── Resume Theme Grid ── */
.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.theme-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    font-family: var(--font-body);
    line-height: 1.25;
    white-space: normal;
    word-break: break-word;
}
.theme-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}
.theme-btn.active {
    background: var(--app-btn-active-gradient);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(var(--app-accent-rgb, 59,130,246), 0.35);
    color: #fff;
}

/* Polar light mode: dark text on buttons */
body[data-site-theme="polar"] .theme-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
    color: var(--app-text);
}
body[data-site-theme="polar"] .theme-btn:hover { background: rgba(0,0,0,0.07); }
body[data-site-theme="polar"] .theme-btn.active { color: #fff; }

/* ── Controls Grid ── */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.control-btn {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--app-border);
    background: rgba(255,255,255,0.04);
    color: var(--app-text);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
    font-family: var(--font-body);
    white-space: nowrap;
    width: 100%;
}
.control-btn svg { flex-shrink: 0; }
.control-btn:hover { background: rgba(255,255,255,0.09); transform: translateY(-1px); }

body[data-site-theme="polar"] .control-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.08);
}
body[data-site-theme="polar"] .control-btn:hover { background: rgba(0,0,0,0.08); }

.control-btn.primary {
    background: linear-gradient(135deg, var(--app-accent), var(--app-accent-hover));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(var(--app-accent-rgb, 59,130,246), 0.3);
    grid-column: 1 / -1;
}
.control-btn.primary:hover { filter: brightness(1.1); }

.control-btn.secondary {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
    color: #fff;
}
.control-btn.secondary:hover { filter: brightness(1.1); }

.control-btn.accent {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,0.3);
    grid-column: 1 / -1;
}
.control-btn.accent:hover { filter: brightness(1.08); }

.control-btn.demo {
    background: transparent;
    border: 1px dashed var(--app-border);
    color: var(--app-text-muted);
    grid-column: 1 / -1;
}
.control-btn.demo:hover { border-color: var(--app-accent); color: var(--app-accent); background: rgba(var(--app-accent-rgb, 59,130,246), 0.05); }

.control-btn.danger {
    background: transparent;
    border-color: rgba(248,81,73,0.3);
    color: var(--app-danger);
}
.control-btn.danger:hover { background: var(--app-danger); color: #fff; border-color: var(--app-danger); }

/* Parser */
.parser-container { display: flex; flex-direction: column; gap: 8px; }

.parser-textarea {
    width: 100%;
    height: 105px;
    background: rgba(255,255,255,0.03);
    color: var(--app-text);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 9px 11px;
    font-family: var(--font-body);
    font-size: 0.73rem;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.parser-textarea:focus {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb, 59,130,246), 0.1);
}
.parser-textarea::placeholder { color: var(--app-text-muted); opacity: 0.65; }

body[data-site-theme="polar"] .parser-textarea {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
}

/* Edit active state */
body.editing-active #edit-toggle {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
    color: #fff;
}

/* Panel footer */
.panel-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--app-border);
    font-size: 0.68rem;
    color: var(--app-text-muted);
    line-height: 1.5;
    text-align: center;
}

/* Edit banner */
.edit-banner {
    display: none;
    width: var(--paper-width);
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}
body.editing-active .edit-banner { display: flex; }
.close-banner { background: transparent; border: none; color: white; font-size: 1.2rem; cursor: pointer; font-weight: 700; }

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

/* ==========================================
   WEBSITE THEME PICKER OVERLAY
   ========================================== */
.site-theme-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.site-theme-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.site-theme-modal {
    background: var(--app-panel-bg);
    border: 1px solid var(--app-border);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.site-theme-overlay.open .site-theme-modal {
    transform: translateY(0) scale(1);
}

.site-theme-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}
.site-theme-modal-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--app-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.site-theme-modal-sub {
    font-size: 0.8rem;
    color: var(--app-text-muted);
    margin-top: 4px;
}
.site-theme-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--app-text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.site-theme-close:hover { background: rgba(255,255,255,0.12); color: var(--app-text); }
body[data-site-theme="polar"] .site-theme-close { background: rgba(0,0,0,0.05); }

/* Theme cards grid */
.site-theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.site-theme-card {
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--app-border);
    border-radius: 14px;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    overflow: hidden;
    font-family: var(--font-body);
    position: relative;
}
.site-theme-card:hover {
    border-color: rgba(var(--app-accent-rgb, 59,130,246), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.site-theme-card.active {
    border-color: var(--app-accent);
    box-shadow: 0 0 0 3px rgba(var(--app-accent-rgb, 59,130,246), 0.18);
}

body[data-site-theme="polar"] .site-theme-card { background: rgba(0,0,0,0.03); }

/* Checkmark */
.stc-check {
    position: absolute;
    top: 10px; right: 10px;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--app-accent);
    color: white;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.site-theme-card.active .stc-check { display: flex; }

.stc-info {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.stc-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--app-text);
}
.stc-desc {
    font-size: 0.71rem;
    color: var(--app-text-muted);
}

/* ── Mini Preview Boxes ── */
.stc-preview {
    height: 100px;
    display: flex;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}
.stc-sidebar {
    width: 32%;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stc-paper {
    flex: 1;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(255,255,255,0.92);
}
.stc-bar { height: 5px; border-radius: 3px; width: 75%; opacity: 0.6; }
.stc-bar.short { width: 45%; }
.stc-line { height: 4px; border-radius: 2px; width: 90%; opacity: 0.35; background: #334155; }
.stc-line.short { width: 60%; }

/* Obsidian preview */
.stc-obsidian { background: #0d1117; }
.stc-obsidian .stc-sidebar { background: rgba(22,27,34,0.97); }
.stc-obsidian .stc-bar { background: #3b82f6; }

/* Aurora preview */
.stc-aurora { background: #0a0614; }
.stc-aurora .stc-sidebar { background: rgba(16,10,30,0.97); }
.stc-aurora .stc-bar { background: #a855f7; }

/* Forest preview */
.stc-forest { background: #050e08; }
.stc-forest .stc-sidebar { background: rgba(8,18,12,0.97); }
.stc-forest .stc-bar { background: #22c55e; }

/* Polar preview */
.stc-polar { background: #f0f4f8; }
.stc-polar .stc-sidebar { background: rgba(255,255,255,0.95); border-right: 1px solid rgba(0,0,0,0.07); }
.stc-polar .stc-bar { background: #3b82f6; }
.stc-polar .stc-paper { background: rgba(255,255,255,0.7); }

/* ==========================================
   MAIN RESUME VIEW AREA
   ========================================== */
.resume-view {
    margin-left: 295px;
    flex: 1;
    min-height: 100vh;
    padding: 48px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--app-view-bg);
    overflow-y: auto;
    transition: background 0.4s ease;
}

/* ==========================================
   EMPTY STATE PLACEHOLDER
   ========================================== */
.resume-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30mm 20mm;
    text-align: center;
    pointer-events: none;
    animation: fadeInUp 0.5s ease;
}

.resume-empty-state .empty-icon {
    font-size: 3rem;
    opacity: 0.25;
    margin-bottom: 4px;
    animation: float 3s ease-in-out infinite;
}

.resume-empty-state .empty-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16pt;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.resume-empty-state .empty-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 9.5pt;
    color: #94a3b8;
    line-height: 1.7;
    max-width: 280px;
}

.resume-empty-state .empty-demo-btn {
    pointer-events: all;
    margin-top: 8px;
    padding: 9px 22px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 9.5pt;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.resume-empty-state .empty-demo-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

/* Floating animation for the placeholder icon */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

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

/* The resume-paper needs relative positioning for the overlay */
.resume-paper { position: relative; }

/* ==========================================
   RESUME PAPER (A4 REPRESENTATION)
   ========================================== */
.resume-paper {
    /* Auto-Fit CSS variables */
    --res-font-size:   10.5pt;
    --res-line-height: 1.5;
    --res-section-gap: 5.5mm;
    --res-bullet-gap:  1.5mm;
    --res-padding:     18mm 20mm;
    --res-header-gap:  5mm;
    --res-title-gap:   2.5mm;
    --res-item-gap:    3.5mm;

    /* Fixed A4 dimensions — NEVER stretch */
    width: var(--paper-width);
    min-width: var(--paper-width);
    max-width: var(--paper-width);
    min-height: var(--paper-height);
    flex-shrink: 0;

    background-color: var(--res-bg);
    color: var(--res-text);
    padding: var(--res-padding);
    box-shadow: var(--res-shadow);
    border-radius: 2px;
    position: relative;
    font-family: var(--font-body);
    font-size: var(--res-font-size);
    line-height: var(--res-line-height);
    transition: box-shadow 0.3s ease;
    overflow: visible;
}

/* ── Inline Editing Hints ── */
body.editing-active .editable {
    border-bottom: 1px dashed rgba(251,191,36,0.5);
    background: rgba(251,191,36,0.03);
    cursor: text;
    border-radius: 1px;
    transition: background 0.15s, border-color 0.15s;
}
body.editing-active .editable:hover {
    border-bottom-color: #f59e0b;
    background: rgba(251,191,36,0.07);
}
body.editing-active .editable:focus {
    outline: none;
    border-bottom: 1.5px solid #f59e0b;
    background: rgba(251,191,36,0.1);
}

/* ==========================================
   RESUME STRUCTURE — TYPOGRAPHY & SPACING
   ========================================== */

/* Header */
.resume-header {
    margin-bottom: var(--res-header-gap);
    border-bottom: 1.5px solid var(--res-border);
    padding-bottom: var(--res-header-gap);
}

.header-main .name {
    font-family: var(--font-heading);
    font-size: 2.1em;
    font-weight: 800;
    color: var(--res-primary);
    line-height: 1.15;
    margin-bottom: 1.5mm;
    letter-spacing: -0.02em;
}

.header-main .subtitle {
    font-size: 1.05em;
    font-weight: 500;
    color: var(--res-accent);
    letter-spacing: 0.01em;
}

.header-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 3mm 5mm;
    margin-top: 3.5mm;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5mm;
    font-size: 0.85em;
}

.contact-icon {
    width: 3.5mm;
    height: 3.5mm;
    flex-shrink: 0;
    fill: var(--res-secondary);
}

.contact-text {
    color: var(--res-secondary);
    text-decoration: none;
}
.contact-text:hover { color: var(--res-accent); }

/* Body / Sections */
.resume-body { }

.resume-section { margin-bottom: var(--res-section-gap); }
.resume-section:last-child { margin-bottom: 0; }

.section-title {
    font-family: var(--font-heading);
    font-size: 0.92em;
    font-weight: 700;
    color: var(--res-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--res-title-gap);
    border-bottom: 1.5px solid var(--res-border);
    padding-bottom: 1.2mm;
}

.section-content { }

/* Items */
.education-item, .experience-item {
    margin-bottom: var(--res-item-gap);
}
.education-item:last-child, .experience-item:last-child { margin-bottom: 0; }

.edu-header, .exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 1mm;
    margin-bottom: 1mm;
}

.edu-degree, .exp-title {
    font-size: 1.0em;
    font-weight: 700;
    color: var(--res-primary);
    line-height: 1.3;
}

.edu-date, .exp-date {
    font-size: 0.82em;
    color: var(--res-secondary);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.edu-school {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--res-secondary);
    margin-bottom: 1mm;
}

/* Bullets */
.bullet-list {
    list-style: disc;
    padding-left: 4.5mm;
    display: flex;
    flex-direction: column;
    gap: var(--res-bullet-gap);
    margin-top: 1.5mm;
}

.bullet-list li {
    line-height: 1.45;
    color: var(--res-text);
}

/* Skills */
.skills-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5mm;
}

.skills-block {
    display: flex;
    flex-direction: column;
    gap: 2mm;
}

.skills-subtitle {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--res-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5mm;
}

.skill-tag {
    font-size: 0.78em;
    background: var(--res-border);
    color: var(--res-primary);
    padding: 0.25em 0.75em;
    border-radius: 3px;
    font-weight: 500;
    line-height: 1.3;
}

/* Additional info columns */
#list-additional {
    column-count: 2;
    column-gap: 8mm;
    display: block;
}
#list-additional li {
    margin-bottom: 1mm;
    break-inside: avoid;
}

/* Project website link */
.project-website {
    display: flex;
    align-items: center;
    gap: 1.5mm;
    margin: 1mm 0 2mm;
    font-size: 8.5pt;
    color: var(--res-secondary);
}
.project-website a {
    color: var(--res-accent);
    text-decoration: none;
    font-weight: 500;
}
.project-website a:hover { text-decoration: underline; }

/* ==========================================
   THEME 1 — CLASSIC PROFESSIONAL
   Warm ivory · Italic Playfair · Gold accent
   Ornamental ruled header · Timeless elegance
   ========================================== */
.theme-classic {
    --res-primary:   #16213e;
    --res-secondary: #5a6a7e;
    --res-accent:    #8b6914;
    --res-text:      #2c3e50;
    --res-bg:        #fdfaf5;
    --res-border:    #c9b99a;
    --font-heading:  'Playfair Display', serif;
    --font-body:     'Inter', sans-serif;
}

/* Ambient warm glow in the preview background */
.resume-view:has(.theme-classic) {
    background: radial-gradient(ellipse at 50% 0%, rgba(139,105,20,0.07) 0%, transparent 50%), #0d1117;
}

/* Header: centered, with top + bottom ornamental lines */
.theme-classic .resume-header {
    text-align: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 5mm;
    position: relative;
}

/* Top thin rule */
.theme-classic .resume-header::before {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--res-border) 20%, var(--res-border) 80%, transparent);
    margin-bottom: 5.5mm;
}

/* Bottom thin rule after contact */
.theme-classic .resume-header::after {
    content: "";
    display: block;
    margin-top: 4mm;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--res-border) 20%, var(--res-border) 80%, transparent);
}

/* Name: large italic serif with deep navy */
.theme-classic .header-main .name {
    font-size: 2.3em;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.02em;
    color: var(--res-primary);
    line-height: 1.1;
    margin-bottom: 2mm;
}

/* Subtitle: small-caps-style uppercase */
.theme-classic .header-main .subtitle {
    font-size: 0.8em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--res-accent);
    font-style: normal;
    font-family: var(--font-body);
}

/* Ornamental diamond separator between subtitle and contact */
.theme-classic .header-main::after {
    content: "\2014\0020\25C6\0020\2014";
    display: block;
    text-align: center;
    color: var(--res-accent);
    font-size: 0.7em;
    letter-spacing: 0.2em;
    margin: 2.5mm 0 2mm;
    opacity: 0.65;
}

.theme-classic .header-contact {
    justify-content: center;
    gap: 2mm 6mm;
}
.theme-classic .contact-text {
    color: var(--res-secondary);
    font-size: 0.85em;
}
.theme-classic .contact-icon {
    fill: var(--res-accent);
    opacity: 0.75;
}

/* Section titles: centered italic, gold rule below */
.theme-classic .section-title {
    text-align: center;
    font-style: italic;
    font-size: 1.05em;
    font-weight: 700;
    color: var(--res-primary);
    text-transform: none;
    letter-spacing: 0.03em;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 3mm;
    position: relative;
}

/* Centered gold accent underline on each section */
.theme-classic .section-title::after {
    content: "";
    display: block;
    width: 36px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--res-accent), transparent);
    margin: 1.5mm auto 0;
    border-radius: 1px;
}

/* Skill tags: warm ivory */
.theme-classic .skill-tag {
    background: #f2e8d5;
    color: var(--res-primary);
    border: 1px solid #d4b896;
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 0.78em;
}

/* Degree/title: upright for readability */
.theme-classic .edu-degree,
.theme-classic .exp-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-style: normal;
    font-size: 0.95em;
}

/* Dates: gold accent color */
.theme-classic .edu-date,
.theme-classic .exp-date {
    font-family: var(--font-body);
    color: var(--res-accent);
    font-size: 0.8em;
    font-weight: 500;
}

/* School/org: italic serif */
.theme-classic .edu-school {
    font-style: italic;
    font-family: var(--font-heading);
    color: var(--res-secondary);
    font-size: 0.9em;
}

/* ==========================================
   THEME 2 — MODERN MINIMALIST
   Flush left, strong indigo accent, grid.
   ========================================== */
.theme-minimalist {
    --res-primary:   #111827;
    --res-secondary: #6b7280;
    --res-accent:    #4f46e5;
    --res-border:    #e5e7eb;
    --font-heading:  'Outfit', sans-serif;
}

.theme-minimalist .resume-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 6mm;
    border-left: 4px solid var(--res-accent);
    padding-left: 5mm;
}
.theme-minimalist .section-title {
    border-bottom: none;
    font-size: 8.5pt;
    font-weight: 900;
    letter-spacing: 0.14em;
    color: var(--res-accent);
    margin-bottom: 3mm;
}
.theme-minimalist .skill-tag {
    background: transparent;
    border: 1px solid var(--res-border);
    border-radius: 2px;
}

/* ==========================================
   THEME 3 — EXECUTIVE SLATE
   Dark header band, teal accent. Premium feel.
   ========================================== */
.theme-executive {
    --res-primary:   #1e293b;
    --res-secondary: #64748b;
    --res-accent:    #0f766e;
    --res-border:    #e2e8f0;
    --font-heading:  'Montserrat', sans-serif;
    padding: 0 !important;
    overflow: hidden;
}

.theme-executive .resume-header {
    background: #1e293b;
    color: #f8fafc;
    padding: 10mm 18mm 9mm;
    border-bottom: none;
    margin-bottom: 0;
}
.theme-executive .name { color: #ffffff; font-size: 2.1em; }
.theme-executive .subtitle { color: #2dd4bf; font-size: 1.05em; }
.theme-executive .contact-icon { fill: #94a3b8; }
.theme-executive .contact-text { color: #cbd5e1; }
.theme-executive .contact-text:hover { color: #fff; }

.theme-executive .resume-body { padding: 8mm 18mm 14mm; }

.theme-executive .section-title {
    color: var(--res-primary);
    border-bottom: 2px solid var(--res-accent);
}

/* ==========================================
   THEME 4 — CREATIVE GRADIENT
   Purple/pink gradient accent + left bar.
   ========================================== */
.theme-gradient {
    --res-primary:   #1e1b4b;
    --res-secondary: #6366f1;
    --res-accent:    #8b5cf6;
    --res-border:    #ede9fe;
    --font-heading:  'Outfit', sans-serif;
    padding-top: 12mm !important;
}

.theme-gradient::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6mm;
    background: linear-gradient(90deg, #6d28d9, #9333ea, #ec4899);
}

.theme-gradient .header-main .name {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.theme-gradient .section-title {
    border-bottom: none;
    padding-bottom: 2mm;
    position: relative;
}
.theme-gradient .section-title::after {
    content: "";
    display: block;
    width: 32px;
    height: 3px;
    background: linear-gradient(90deg, #7c3aed, #ec4899);
    border-radius: 2px;
    margin-top: 1.5mm;
}

.theme-gradient .skill-tag {
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border: 1px solid #ddd6fe;
    color: #6d28d9;
}

/* ==========================================
   THEME 5 — TECH / AI
   Code aesthetic, green accent, monospace.
   ========================================== */
.theme-tech {
    --res-primary:   #0f172a;
    --res-secondary: #475569;
    --res-accent:    #10b981;
    --res-border:    #e2e8f0;
    --font-heading:  'Fira Code', monospace;
}

.theme-tech .name { font-family: var(--font-mono); font-size: 2.0em; }
.theme-tech .subtitle {
    font-family: var(--font-mono);
    font-size: 0.9em;
}
.theme-tech .subtitle::before { content: "$ "; color: var(--res-accent); }

.theme-tech .section-title {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: #f1f5f9;
    padding: 1.5mm 3mm;
    border-left: 3.5px solid var(--res-accent);
    border-bottom: none;
    border-radius: 0 3px 3px 0;
    margin-bottom: 3mm;
    letter-spacing: 0.06em;
}

.theme-tech .skill-tag {
    font-family: var(--font-mono);
    background: #f8fafc;
    border-bottom: 2px solid var(--res-accent);
    border-radius: 2px;
    font-size: 0.75em;
}

/* ==========================================
   THEME 6 — CYBER NEON (DARK)
   Deep dark, cyan glow, neon accents.
   ========================================== */
.theme-cyber {
    --res-bg:        #050c1a;
    --res-text:      #8fb3d4;
    --res-primary:   #cde4f8;
    --res-secondary: #4a7fa5;
    --res-accent:    #00d4ff;
    --res-border:    #0d2540;
    --font-heading:  'Fira Code', monospace;
    --font-body:     'Inter', sans-serif;
}

.theme-cyber .resume-header {
    border-bottom: 1px solid #0d2540;
}
.theme-cyber .name {
    color: #00d4ff;
    text-shadow: 0 0 16px rgba(0,212,255,0.4);
    font-family: var(--font-mono);
    font-size: 2.0em;
}
.theme-cyber .subtitle { color: #c084fc; font-size: 0.9em; }
.theme-cyber .contact-icon { fill: #4a7fa5; }
.theme-cyber .contact-text { color: #8fb3d4; }

.theme-cyber .section-title {
    color: #00d4ff;
    border-bottom: 1px solid #0d2540;
    letter-spacing: 0.12em;
}
.theme-cyber .edu-degree, .theme-cyber .exp-title { color: #cde4f8; }
.theme-cyber .skill-tag {
    background: #0d2540;
    color: #00d4ff;
    border: 1px solid #0d4c70;
    font-family: var(--font-mono);
    font-size: 0.72em;
}

/* Subtle scanline effect on dark bg */
.resume-view:has(.theme-cyber) {
    background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.06) 0%, transparent 55%), #050c1a;
}

/* ==========================================
   THEME 7 — ELEGANT SERIF
   Warm cream, italic serif, gold underlines.
   ========================================== */
.theme-elegant {
    --res-bg:        #fefcf8;
    --res-text:      #2d2521;
    --res-primary:   #2d2521;
    --res-secondary: #7a5c44;
    --res-accent:    #b05d2e;
    --res-border:    #d4b896;
    --font-heading:  'Playfair Display', serif;
    --font-body:     'Playfair Display', serif;
    line-height: 1.6;
}

.theme-elegant .name {
    font-style: italic;
    font-size: 2.2em;
    letter-spacing: 0.01em;
}
.theme-elegant .subtitle {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.82em;
    font-style: normal;
}
.theme-elegant .resume-header {
    text-align: center;
    border-bottom: 1px solid var(--res-border);
}
.theme-elegant .header-contact { justify-content: center; }

.theme-elegant .section-title {
    font-style: italic;
    border-bottom: 1px solid var(--res-border);
    color: var(--res-accent);
    font-size: 1.05em;
    letter-spacing: 0.03em;
    text-transform: none;
}

.theme-elegant .skill-tag {
    background: #fef3e2;
    color: #7a5c44;
    border: 1px solid #d4b896;
    border-radius: 2px;
}

/* ==========================================
   THEME 8 — ATS PLAIN
   Zero-styling, black text. Recruiter system safe.
   ========================================== */
.theme-ats {
    --res-primary:   #000000;
    --res-secondary: #111111;
    --res-accent:    #000000;
    --res-text:      #000000;
    --res-border:    #000000;
    --res-shadow:    none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95em;
    padding: 15mm !important;
}

.theme-ats .resume-header {
    border-bottom: 2px solid #000;
    padding-bottom: 2.5mm;
    margin-bottom: 4mm;
    text-align: center;
}
.theme-ats .header-contact { justify-content: center; gap: 2mm 5mm; }
.theme-ats .contact-icon { display: none; }

.theme-ats .contact-item + .contact-item::before {
    content: " | ";
    color: #000;
    margin-right: 0;
}

.theme-ats .name { font-size: 1.5em; font-weight: bold; font-family: Arial, sans-serif; }
.theme-ats .subtitle { font-size: 0.95em; font-weight: normal; font-family: Arial, sans-serif; color: #000; }

.theme-ats .section-title {
    font-family: Arial, sans-serif;
    font-size: 1.0em;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1.5px solid #000;
    color: #000;
    letter-spacing: 0;
    margin-bottom: 2mm;
}
.theme-ats .skill-tag {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.9em;
}
.theme-ats .skill-tag::after { content: ", "; }
.theme-ats .skill-tag:last-child::after { content: ""; }
.theme-ats .edu-degree, .theme-ats .exp-title { font-size: 0.95em; font-weight: bold; font-family: Arial; }

/* ==========================================
   THEME 9 — NORDIC FROST
   Clean sky blue, cool steel tones.
   ========================================== */
.theme-nordic {
    --res-bg:        #f7fbff;
    --res-text:      #1e3a5f;
    --res-primary:   #1e3a8a;
    --res-secondary: #4472a8;
    --res-accent:    #0369a1;
    --res-border:    #bfdbfe;
    --font-heading:  'Outfit', sans-serif;
}

.theme-nordic .resume-header {
    border-bottom: 2px solid var(--res-accent);
}
.theme-nordic .name { color: var(--res-primary); }
.theme-nordic .section-title {
    color: var(--res-accent);
    border-bottom: 2px solid var(--res-border);
}
.theme-nordic .skill-tag {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid var(--res-border);
}

/* ==========================================
   THEME 10 — EMERALD EXECUTIVE
   Forest green + gold. Sophisticated.
   ========================================== */
.theme-emerald {
    --res-bg:        #f0fdf4;
    --res-text:      #14432a;
    --res-primary:   #14532d;
    --res-secondary: #2d6a4f;
    --res-accent:    #b45309;
    --res-border:    #bbf7d0;
    --font-heading:  'Outfit', sans-serif;
    padding: 0 !important;
    overflow: hidden;
}

.theme-emerald .resume-header {
    background: linear-gradient(135deg, #14532d 0%, #1a6b38 100%);
    padding: 9mm 18mm 8mm;
    border-bottom: 3px solid #b45309;
    margin-bottom: 0;
}
.theme-emerald .name { color: #ffffff; font-size: 2.1em; }
.theme-emerald .subtitle { color: #86efac; font-size: 0.95em; }
.theme-emerald .contact-icon { fill: #6ee7b7; }
.theme-emerald .contact-text { color: #d1fae5; }

.theme-emerald .resume-body { padding: 7mm 18mm 12mm; }

.theme-emerald .section-title {
    color: var(--res-primary);
    border-bottom: 2px solid var(--res-accent);
}
.theme-emerald .skill-tag {
    background: #d1fae5;
    color: #14532d;
    border: 1px solid #a7f3d0;
}

/* ==========================================
   PRINT MEDIA — PERFECT A4 PDF
   ========================================== */
@media print {
  .no-print { display: none !important; }
  .app-container { display: block !important; }
  .resume-view { padding: 0 !important; margin: 0 !important; background: white !important; }
  .resume-paper {
    box-shadow: none !important;
    transform: none !important;
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
  }
  @page {
    size: A4;
    margin: 0 !important;
  }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1100px) {
    .resume-view { padding: 32px 24px; }
}

@media (max-width: 900px) {
    .app-container { flex-direction: column; }

    .control-panel {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--app-border);
        padding: 20px;
    }

    .resume-view {
        margin-left: 0;
        padding: 20px 12px;
    }

    .resume-paper {
        transform-origin: top center;
    }

    .skills-grid-container { grid-template-columns: 1fr; gap: 4mm; }
    #list-additional { column-count: 1; }

    .theme-executive .resume-body,
    .theme-emerald .resume-body { padding: 5mm 10mm 8mm; }
}

/* ==========================================
   MASTER PROMPT PAGE
   ========================================== */
#prompt-view {
    min-height: 100vh;
    width: 100%;
    background: var(--app-view-bg);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    box-sizing: border-box;
    transition: background 0.4s ease;
}

.prompt-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.prompt-header {
    display: flex;
    align-items: center;
}

.back-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-2px);
}
body[data-site-theme="polar"] .back-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--app-text);
}
body[data-site-theme="polar"] .back-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

.prompt-card {
    background: var(--app-panel-bg);
    border: 1px solid var(--app-panel-border, var(--app-border));
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: all 0.4s ease;
}
body[data-site-theme="polar"] .prompt-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.prompt-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--app-brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.prompt-subtitle {
    font-size: 0.88rem;
    color: var(--app-text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.prompt-box-wrapper {
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
body[data-site-theme="polar"] .prompt-box-wrapper {
    background: rgba(0, 0, 0, 0.02);
}

.prompt-text-box {
    margin: 0;
    padding: 24px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--app-text);
    white-space: pre-wrap;
    word-break: break-word;
    height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Custom scrollbar for prompt box */
.prompt-text-box::-webkit-scrollbar { width: 5px; }
.prompt-text-box::-webkit-scrollbar-track { background: transparent; }
.prompt-text-box::-webkit-scrollbar-thumb { background: var(--app-border); border-radius: 3px; }

@media (max-width: 900px) {
    .prompt-card {
        padding: 24px 18px;
    }
    .prompt-title {
        font-size: 1.4rem;
    }
    .prompt-text-box {
        height: 300px;
        padding: 16px;
        font-size: 0.78rem;
    }
}

/* ==========================================
   GEMINI WORKSPACE PAGE
   ========================================== */
#gemini-view {
    min-height: 100vh;
    width: 100%;
    background: var(--app-view-bg);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    padding: 40px 24px;
    box-sizing: border-box;
    transition: background 0.4s ease;
}

.gemini-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gemini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.api-key-config {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--app-panel-bg);
    border: 1px solid var(--app-border);
    padding: 6px 14px;
    border-radius: 12px;
}
body[data-site-theme="polar"] .api-key-config {
    background: #ffffff;
}

.api-label {
    font-size: 0.8rem;
    color: var(--app-text-muted);
    font-weight: 500;
}

.api-input-wrap {
    display: flex;
    gap: 6px;
}

.api-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    width: 180px;
}
body[data-site-theme="polar"] .api-input {
    background: rgba(0, 0, 0, 0.03);
}
.api-input:focus {
    outline: none;
    border-color: var(--app-accent);
}

.api-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.api-btn.save {
    background: var(--app-accent);
    color: white;
}
.api-btn.save:hover { opacity: 0.9; }
.api-btn.clear {
    background: rgba(255, 255, 255, 0.08);
    color: var(--app-text-muted);
}
.api-btn.clear:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--app-text);
}
body[data-site-theme="polar"] .api-btn.clear {
    background: rgba(0, 0, 0, 0.04);
}

.gemini-card {
    background: var(--app-panel-bg);
    border: 1px solid var(--app-panel-border, var(--app-border));
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
body[data-site-theme="polar"] .gemini-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
}

.gemini-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.gemini-subtitle {
    font-size: 0.86rem;
    color: var(--app-text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.gemini-workspace-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
}

.gemini-input-column, .gemini-output-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group, .output-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-text-muted);
}

.workspace-textarea {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    border-radius: 12px;
    padding: 16px;
    font-size: 0.88rem;
    font-family: var(--font-body);
    line-height: 1.5;
    height: 175px;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}
body[data-site-theme="polar"] .workspace-textarea {
    background: rgba(0, 0, 0, 0.02);
}
.workspace-textarea:focus {
    border-color: var(--app-accent);
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.select-wrapper {
    position: relative;
}
.model-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
}
body[data-site-theme="polar"] .model-select {
    background: #ffffff;
}

.output-box-wrapper {
    position: relative;
    border: 1px solid var(--app-border);
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}
body[data-site-theme="polar"] .output-box-wrapper {
    background: rgba(0, 0, 0, 0.01);
}

#gemini-output-content {
    margin: 0;
    padding: 16px;
    height: 388px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--app-text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    scrollbar-width: thin;
}

.output-actions {
    display: flex;
    gap: 12px;
}
.output-actions button {
    flex: 1;
}

/* Spinner & Loading */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    z-index: 10;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
body[data-site-theme="polar"] .loading-overlay {
    background: rgba(255, 255, 255, 0.85);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--app-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
body[data-site-theme="polar"] .spinner {
    border-color: rgba(0, 0, 0, 0.05);
    border-top-color: var(--app-accent);
}

.loading-text {
    font-size: 0.84rem;
    color: var(--app-text);
    font-weight: 500;
}

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

@media (max-width: 900px) {
    .gemini-workspace-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .gemini-card {
        padding: 20px;
    }
    #gemini-output-content {
        height: 300px;
    }
    .gemini-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .api-key-config {
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }
    .api-input {
        width: 140px;
    }
}

@media (max-width: 600px) {
    .action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .select-wrapper, .model-select {
        width: 100%;
    }
    #run-gemini-btn {
        width: 100%;
        justify-content: center;
    }
    .output-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .output-actions button {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .gemini-header {
        align-items: stretch;
    }
    .back-btn {
        width: 100%;
        justify-content: center;
    }
    .api-key-config {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    .api-input-wrap {
        width: 100%;
    }
    .api-input {
        flex: 1;
        width: auto;
    }
}

/* ==========================================
   NEW DETERMINISTIC RESUME CLASSES (STEP 3)
   ========================================== */
.r-header{ border-bottom:2.5px solid var(--res-primary); padding-bottom:12px; margin-bottom:16px; }
.r-name{ font-size:30px; font-weight:700; margin:0; color:var(--res-primary); }
.r-contact{ font-size:12.5px; color:var(--res-secondary); margin:4px 0 0 0; }
.r-section{ margin-bottom:14px; break-inside:avoid-page; }
.r-section-title{ font-size:11.5px; font-weight:700; letter-spacing:0.12em; text-transform:uppercase; color:var(--res-primary); border-bottom:1px solid var(--res-border); padding-bottom:4px; margin:0 0 8px 0; }
.r-summary{ font-size:12.8px; line-height:1.55; margin:0; }
.r-item{ margin-bottom:10px; break-inside:avoid-page; }
.r-item-top{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.r-item-title{ font-size:13.2px; font-weight:700; }
.r-item-org{ font-size:12.3px; font-weight:400; color:var(--res-secondary); }
.r-item-date{ font-size:11.5px; color:var(--res-secondary); white-space:nowrap; font-style:italic; }
.r-bullets{ margin:5px 0 0 0; padding-left:16px; }
.r-bullets li{ font-size:12.4px; line-height:1.5; margin-bottom:2px; }
.r-tags{ display:flex; flex-wrap:wrap; gap:6px; }
.r-tag{ font-size:11.5px; background:var(--res-bg); color:var(--res-primary); border:1px solid var(--res-border); padding:3px 10px; border-radius:20px; }
.r-empty{ color:#9aa3af; font-size:13px; font-style:italic; text-align:center; padding:40px 0; }

/* ==========================================
   HTML TO PDF CONVERTER VIEW
   ========================================== */
#converter-view {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    background: var(--app-bg-glow), var(--app-bg);
    padding: 40px 24px;
    display: flex;
    justify-content: center;
}
.converter-container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.converter-header {
    display: flex;
    justify-content: flex-start;
}
.converter-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.converter-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--app-accent);
    margin: 0 0 8px 0;
}
.converter-subtitle {
    font-size: 0.95rem;
    color: var(--app-text-muted);
    margin: 0 0 28px 0;
    line-height: 1.5;
}
.dropzone-area {
    border: 2px dashed var(--app-border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255,255,255,0.01);
    transition: all 0.2s ease;
    cursor: pointer;
}
.dropzone-area:hover, .dropzone-area.dragover {
    border-color: var(--app-accent);
    background: rgba(255,255,255,0.03);
}
.dropzone-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}
.dropzone-content h3 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    color: var(--app-text);
}
.dropzone-content p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--app-text-muted);
}
.file-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--app-border);
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 0.88rem;
}
.remove-file-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
}
.remove-file-btn:hover {
    color: #f87171;
}
.converter-buttons {
    display: flex;
    gap: 12px;
}
.converter-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}
.converter-btn.primary {
    background: linear-gradient(135deg, var(--app-accent), #4f46e5);
    border: none;
    color: white;
}
.converter-btn.primary:hover {
    opacity: 0.9;
}
.converter-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--app-border);
    color: var(--app-text);
}
.converter-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

