/* ═══════════════════════════════════════════════════════════════
   resume forge — style
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
    --bg: #0a0a0e;
    --bg-alt: #0e0e16;
    --bg-card: rgba(14,14,22,0.7);
    --border: rgba(30,30,50,0.4);
    --border-focus: rgba(0,255,200,0.4);
    --cyan: #00ffc8;
    --cyan-dim: #00cc9e;
    --cyan-glow: rgba(0,255,200,0.1);
    --text: #c8c8d0;
    --text-dim: #6a6a7a;
    --text-bright: #f0f0fa;
    --font: 'Courier New', 'Fira Code', 'SF Mono', monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

.cyan { color: var(--cyan); }
.seo-h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.dim { color: var(--text-dim); }
.mt { margin-top: 1rem; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── NAV ── */
#navbar {
    background: rgba(10,10,14,0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; width: 100%; z-index: 100;
}
.nav-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 1rem;
    display: flex; align-items: center; justify-content: space-between; height: 48px;
}
.logo { font-size: 0.9rem; font-weight: bold; color: var(--text-bright); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-badge { font-size: 0.65rem; color: var(--text-dim); padding: 0.2rem 0.5rem; border: 1px solid var(--border); border-radius: 2px; }
.nav-link { font-size: 0.75rem; color: var(--text-dim); cursor: pointer; }
.nav-link:hover { color: var(--cyan); }

/* ── APP LAYOUT ── */
#app {
    display: grid;
    grid-template-columns: 420px 1fr;
    height: calc(100vh - 48px);
    margin-top: 48px;
}

/* ── FORM PANEL ── */
#form-panel {
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.panel-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
}
.panel-header h2 { font-size: 0.85rem; color: var(--text-bright); }
.panel-sub { font-size: 0.65rem; color: var(--text-dim); margin-top: 0.1rem; }
.preview-actions { display: flex; gap: 0.5rem; }
.btn-icon-only {
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    width: 28px; height: 28px; border-radius: 3px; cursor: pointer;
    font-size: 0.85rem; transition: all 0.2s ease;
}
.btn-icon-only:hover { border-color: var(--cyan); color: var(--cyan); }

.form-scroll { flex: 1; overflow-y: auto; padding: 1rem; }
.form-section { margin-bottom: 1rem; }
.section-label {
    font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 0.5rem;
    padding-bottom: 0.3rem; border-bottom: 1px solid rgba(30,30,50,0.2);
}
.form-row { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.flex-1 { flex: 1; }
.form-group { margin-bottom: 0.4rem; }
.form-group label { font-size: 0.65rem; color: var(--text-dim); display: block; margin-bottom: 0.15rem; }
.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    color: var(--text-bright);
    font-family: var(--font);
    font-size: 0.78rem;
    border-radius: 3px;
    outline: none;
    transition: border-color 0.2s ease;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 8px var(--cyan-glow);
}
.form-group textarea { resize: vertical; }
.field-hint { font-size: 0.6rem; color: var(--text-dim); margin-top: 0.15rem; display: block; }

.btn-sm {
    background: transparent; border: 1px dashed var(--border); color: var(--text-dim);
    font-family: var(--font); font-size: 0.7rem; padding: 0.3rem 0.7rem;
    border-radius: 3px; cursor: pointer; margin-top: 0.3rem;
    transition: all 0.2s ease;
}
.btn-sm:hover { border-color: var(--cyan); color: var(--cyan); }

/* Template selector */
.template-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tmpl-option {
    flex: 1;
    min-width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0,0,0,0.2);
}
.tmpl-option:hover { border-color: var(--cyan-dim); }
.tmpl-option.selected {
    border-color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan-glow);
    background: rgba(0,255,200,0.05);
}
.tmpl-name { display: block; font-size: 0.7rem; color: var(--text-bright); }
.tmpl-desc { display: block; font-size: 0.6rem; color: var(--text-dim); margin-top: 0.15rem; }

/* Generate button */
.btn-generate {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.7rem;
    background: transparent;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-family: var(--font);
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 0.5rem;
}
.btn-generate:hover {
    background: var(--cyan);
    color: var(--bg);
    box-shadow: 0 0 25px var(--cyan-glow);
}
.btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.btn-price {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid currentColor;
    border-radius: 2px;
    opacity: 0.7;
}
.gen-status {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.2rem;
}

/* ── PREVIEW PANEL ── */
#preview-panel {
    display: flex; flex-direction: column;
    overflow: hidden;
}
#resume-preview {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex; align-items: flex-start; justify-content: center;
}
.preview-placeholder {
    text-align: center;
    margin-top: 5rem;
    color: var(--text-dim);
}
.ph-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.ph-text { font-size: 0.9rem; display: block; }
.ph-sub { font-size: 0.7rem; margin-top: 0.3rem; }

/* ── RESUME OUTPUT ── */
.resume-output {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    color: #111;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    padding: 0;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    border-radius: 2px;
    overflow: hidden;
}

/* Terminal template */
.resume-terminal .rt-header {
    background: #0a0a0e;
    color: #00ffc8;
    padding: 1.5rem 2rem 1rem;
    font-family: 'Courier New', monospace;
}
.resume-terminal .rt-header h1 {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: -0.5px;
}
.resume-terminal .rt-header .rt-role {
    color: #6a6a7a;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}
.resume-terminal .rt-header .rt-contact {
    display: flex; flex-wrap: wrap; gap: 0.8rem;
    margin-top: 0.6rem;
    font-size: 0.7rem;
    color: #6a6a7a;
}
.resume-terminal .rt-body {
    padding: 1rem 2rem 2rem;
    color: #1a1a1a;
}
.resume-terminal .rt-section { margin-bottom: 1rem; }
.resume-terminal .rt-section-title {
    font-size: 0.8rem;
    font-weight: bold;
    color: #00cc9e;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.2rem;
    margin-bottom: 0.4rem;
}
.resume-terminal .rt-item { margin-bottom: 0.5rem; }
.resume-terminal .rt-item-title {
    font-size: 0.8rem;
    font-weight: 600;
}
.resume-terminal .rt-item-sub {
    font-size: 0.72rem;
    color: #555;
}
.resume-terminal .rt-item-desc {
    font-size: 0.72rem;
    color: #333;
    margin-top: 0.15rem;
    line-height: 1.4;
}
.resume-terminal .rt-skills {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
}
.resume-terminal .rt-skill-tag {
    font-size: 0.65rem;
    padding: 0.1rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    color: #333;
}

/* Minimal template */
.resume-minimal .rm-header {
    text-align: center;
    padding: 1.5rem 2rem 0.8rem;
    border-bottom: 2px solid #111;
}
.resume-minimal .rm-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.resume-minimal .rm-header .rm-role {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}
.resume-minimal .rm-header .rm-contact {
    font-size: 0.7rem;
    color: #555;
    margin-top: 0.4rem;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem;
}
.resume-minimal .rm-body {
    padding: 0.8rem 2rem 2rem;
}
.resume-minimal .rm-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #111;
    margin-bottom: 0.3rem;
}

/* Modern template */
.resume-modern { display: flex; }
.resume-modern .mod-sidebar {
    width: 35%;
    background: #1a1a2e;
    color: #eee;
    padding: 1.5rem;
}
.resume-modern .mod-sidebar h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}
.resume-modern .mod-sidebar .mod-role {
    font-size: 0.75rem;
    color: #00ffc8;
    margin-top: 0.2rem;
}
.resume-modern .mod-sidebar .mod-contact {
    font-size: 0.65rem;
    margin-top: 0.6rem;
    line-height: 1.6;
    color: #aaa;
}
.resume-modern .mod-sidebar .mod-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #00ffc8;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.2rem;
}
.resume-modern .mod-sidebar .mod-skill-item {
    font-size: 0.65rem;
    color: #ccc;
    margin-bottom: 0.15rem;
}
.resume-modern .mod-main {
    width: 65%;
    padding: 1.5rem;
    color: #1a1a1a;
}
.resume-modern .mod-main .mod-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a2e;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.2rem;
    margin-bottom: 0.4rem;
}
.resume-modern .mod-item-title {
    font-size: 0.8rem;
    font-weight: 600;
}
.resume-modern .mod-item-sub {
    font-size: 0.7rem;
    color: #555;
}

/* ── EXECUTIVE TEMPLATE ─────────────────────────────────── */
.resume-executive {
    font-family: 'Georgia', 'Times New Roman', serif;
}

/* ── CREATIVE TEMPLATE ──────────────────────────────────── */
.resume-creative {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ── TIMELINE TEMPLATE ──────────────────────────────────── */
.resume-timeline {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ── COLUMNS TEMPLATE ───────────────────────────────────── */
.resume-columns {
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ── MODALS ── */
.modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-sm { max-width: 400px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 0.85rem; color: var(--text-bright); }
.modal-close {
    background: none; border: none; color: var(--text-dim);
    font-size: 1rem; cursor: pointer;
}
.modal-close:hover { color: var(--cyan); }
.modal-body { padding: 1rem; }
.about-body p { font-size: 0.8rem; margin-bottom: 0.3rem; }

/* Template showcase */
.tmpl-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.tmpl-preview-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tmpl-preview-card:hover { border-color: var(--cyan); }
.tmpl-preview-header {
    padding: 0.4rem;
    font-size: 0.65rem;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tmpl-desc-short {
    font-size: 0.55rem;
    color: var(--text-dim);
    text-align: center;
    padding: 0.1rem 0.3rem 0.2rem;
    background: rgba(0,0,0,0.15);
    border-bottom: 1px solid var(--border);
    font-style: italic;
}
.tmpl-preview-body { padding: 0.5rem; min-height: 120px; }


/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    #app { grid-template-columns: 1fr; }
    #form-panel { max-height: 50vh; }
    .resume-output { width: 100%; }
    .tmpl-showcase { grid-template-columns: 1fr; }
}

/* ── HISTORY PANEL ────────────────────────────────── */
#history-panel {
    position: fixed; top: 0; right: -380px; width: 360px; height: 100vh;
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    z-index: 300;
    display: flex; flex-direction: column;
    transition: right 0.35s var(--ease);
    box-shadow: -10px 0 40px rgba(0,0,0,0.4);
}
#history-panel.open { right: 0; }
.history-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.history-header h3 { font-size: 0.85rem; color: var(--text-bright); }
.history-body { flex: 1; overflow-y: auto; padding: 0.5rem; }
.history-empty {
    text-align: center; padding: 3rem 1rem;
    color: var(--text-dim); font-size: 0.85rem;
}
.history-item {
    display: flex; align-items: center;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.history-item:hover {
    border-color: var(--cyan-dim);
    background: rgba(0,255,200,0.03);
}
.hi-info { flex: 1; min-width: 0; }
.hi-name { font-size: 0.78rem; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-meta { font-size: 0.6rem; color: var(--text-dim); margin-top: 0.1rem; }
.hi-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.hi-btn {
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    width: 26px; height: 26px; border-radius: 3px; cursor: pointer;
    font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.hi-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.hi-del:hover { border-color: var(--red); color: var(--red); }

/* ── EXPERIENCE HEADER ───────────────────────────── */
.exp-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.3rem;
}
.exp-counter, .edu-counter, .proj-counter { font-size: 0.6rem; color: var(--text-dim); padding: 0.1rem 0.4rem; border: 1px solid var(--border); border-radius: 2px; }
.remove-entry {
    background: transparent; border: none; color: rgba(255,51,85,0.5);
    font-size: 0.8rem; cursor: pointer; padding: 0.15rem;
}
.remove-entry:hover { color: var(--red); }

/* ── SCROLLBAR POLISH ────────────────────────────── */
.history-body::-webkit-scrollbar { width: 3px; }
.history-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── PREVIEW POLISH ──────────────────────────────── */
#resume-preview {
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.02) 0px,
        rgba(0,0,0,0.02) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 768px) {
    #history-panel { width: 100%; right: -100%; }
    .nav-right .nav-badge { display: none; }
}
