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

:root {
    --bg: #0c0d12;
    --bg-panel: #13141b;
    --bg-toolbar: #181920;
    --bg-hover: #1f2130;
    --bg-active: #262839;
    --border: #232538;
    --border-light: #2d2f45;
    --text: #e4e5f1;
    --text-dim: #8889a0;
    --text-muted: #55566e;
    --accent: #7c6ef5;
    --accent-light: #9b8fff;
    --accent-bg: rgba(124, 110, 245, 0.1);
    --accent-bg-hover: rgba(124, 110, 245, 0.18);
    --green: #3dd68c;
    --green-bg: rgba(61, 214, 140, 0.1);
    --red: #f06c75;
    --red-bg: rgba(240, 108, 117, 0.08);
    --blue: #61afef;
    --orange: #e5a547;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.35);
    --transition: 0.15s ease;

    /* CV Colors */
    --cv-blue: #4a86e8;
    --cv-link: #1155cc;
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}

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

/* ===== TOP BAR ===== */
.top-bar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(19, 20, 27, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(124, 110, 245, 0.15) 0%, rgba(97, 175, 239, 0.15) 100%);
    border: 1px solid rgba(124, 110, 245, 0.35);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    box-shadow: 0 0 12px rgba(124, 110, 245, 0.2);
    transition: all 0.3s ease;
}

.brand:hover .brand-icon {
    transform: rotate(-5deg) scale(1.05);
    border-color: var(--accent-light);
    box-shadow: 0 0 16px rgba(124, 110, 245, 0.35);
}

.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shortcut-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.shortcut-hint kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* ===== MAIN LAYOUT ===== */
.main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ===== EDITOR SECTION ===== */
.editor-section {
    width: 42%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
}

/* Toolbars (shared) */
.editor-toolbar,
.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-toolbar);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.toolbar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background var(--transition);
}

.toolbar-dot.valid {
    background: var(--green);
}

.toolbar-dot.invalid {
    background: var(--red);
}

.toolbar-status {
    font-size: 11px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

/* Tool Buttons (small icon buttons) */
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.tool-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.tool-btn:active {
    background: var(--bg-active);
    transform: scale(0.95);
}

/* ===== EDITOR BODY ===== */
.editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.line-numbers {
    width: 40px;
    padding: 12px 6px 12px 0;
    text-align: right;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-muted);
    background: var(--bg-panel);
    overflow: hidden;
    user-select: none;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    opacity: 0.6;
}

#json-editor {
    flex: 1;
    padding: 12px 14px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg-panel);
    border: none;
    outline: none;
    resize: none;
    tab-size: 2;
    overflow: auto;
}

#json-editor::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.8;
}

#json-editor::-webkit-scrollbar {
    width: 6px;
}

#json-editor::-webkit-scrollbar-track {
    background: transparent;
}

#json-editor::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ===== ACTION BAR ===== */
.action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-toolbar);
    flex-shrink: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 36px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.action-btn:active {
    transform: scale(0.97);
}

.action-btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-light);
}

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

.action-btn-primary {
    flex: 1;
    background: var(--accent);
    color: white;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(124, 110, 245, 0.3);
    position: relative;
    overflow: hidden;
}

.action-btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.action-btn-primary:hover::after {
    left: 150%;
}

.action-btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 110, 245, 0.4);
}

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

/* Loading state */
.action-btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.action-btn-primary.loading svg {
    animation: spin 0.8s linear infinite;
}

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

/* ===== RESIZE HANDLE ===== */
.resize-handle {
    width: 5px;
    cursor: col-resize;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}

.resize-handle:hover,
.resize-handle.active {
    background: var(--accent-bg);
}

.resize-grip {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.resize-grip span {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
}

/* ===== PREVIEW SECTION ===== */
.preview-section {
    flex: 1;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.zoom-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Download Buttons */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.download-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.download-btn:not(:disabled):active {
    transform: scale(0.96);
}

.download-btn-pdf {
    background: var(--red-bg);
    color: var(--red);
    border-color: rgba(240, 108, 117, 0.15);
}

.download-btn-pdf:not(:disabled):hover {
    background: rgba(240, 108, 117, 0.15);
    border-color: rgba(240, 108, 117, 0.3);
}

.download-btn-docx {
    background: rgba(97, 175, 239, 0.08);
    color: var(--blue);
    border-color: rgba(97, 175, 239, 0.12);
}

.download-btn-docx:not(:disabled):hover {
    background: rgba(97, 175, 239, 0.14);
    border-color: rgba(97, 175, 239, 0.25);
}

/* ===== PREVIEW AREA ===== */
.preview-area {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(124, 110, 245, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(97, 175, 239, 0.03) 0%, transparent 60%),
        var(--bg);
}

.preview-area::-webkit-scrollbar {
    width: 6px;
}

.preview-area::-webkit-scrollbar-track {
    background: transparent;
}

.preview-area::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    max-width: 340px;
    margin: 0 auto;
}

.empty-illustration {
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.empty-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.empty-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-dim);
    text-align: left;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== CV PAGE ===== */
.cv-page-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.cv-page {
    width: 8.5in;
    min-height: 11in;
    background: #ffffff;
    padding: 0.5in 0.42in 0.5in 0.4in;
    box-shadow: var(--shadow-lg);
    border-radius: 4px;
    font-family: 'STIX Two Text', Georgia, 'Times New Roman', serif;
    color: #000;
    font-size: 11pt;
    line-height: 1.3;
    transform-origin: top center;
    transition: transform var(--transition);
}

/* Premium Graduate (Trinity) Theme */
.cv-page.theme-premium {
    font-family: 'STIX Two Text', Georgia, 'Times New Roman', serif;
    color: #000;
    font-size: 11pt;
    line-height: 1.3;
    padding: 0.08in 0.35in 0in 0.44in;
}

/* Name: Title style = 28 half-pts = 14pt, bold, centered */
.theme-premium .cv-name{
    font-size: 17pt;
    font-weight: bold;
    margin-bottom: 0;
    line-height: 1.2;
}

/* Address line: 10pt, bold, italic */
.theme-premium .cv-address{
    font-size: 11pt;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    margin-top: 2px;
}

/* Contact line: 11pt normal */
.theme-premium .cv-contact{
    margin-top: 1px;
    font-size: 11pt;
    font-weight: normal;
    font-style: normal;
}

.theme-premium .cv-contact a{
    text-decoration: underline;
    color: #000;
}

/* No HR line in Trinity format */
.theme-premium .cv-hr{
    display: none;
}

/* Section headings: full horizontal line matching the underlined tab in DOCX */
.theme-premium .cv-section-heading-wrapper{
    border-bottom: 1px solid #000;
    margin-top: 6px;
    margin-bottom: 2px;
    padding-left: 6px;
    padding-bottom: 1px;
}

.theme-premium .cv-section-heading{
    color: #000;
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

/* Education institution: Heading3 = 10pt bold, NOT underlined */
.theme-premium .cv-edu-block{
    margin-top: 4px;
}

.theme-premium .cv-edu-school{
    font-size: 11pt;
    font-weight: bold;
}

.theme-premium .cv-edu-header{
    padding-left: 6px;
}

/* Degree: 11pt bold italic */
.theme-premium .cv-edu-details{
    font-size: 11pt;
    font-weight: bold;
    font-style: italic;
}

/* Date in education: 11pt italic, NOT bold */
.theme-premium .cv-edu-header .cv-entry-date{
    font-size: 11pt;
    font-style: italic;
    font-weight: normal;
}

/* Bullets under education */
.theme-premium .cv-entry-bullets{
    font-size: 11pt;
    margin-top: 1px;
    line-height: 1.3;
    padding-left: 34px;
}

.theme-premium .cv-entry-bullets li{
    margin-bottom: 1px;
    padding-right: 0;
}

/* Experience: company bold 11pt, location bold 11pt */
.theme-premium .cv-entry{
    margin-top: 4px;
}

.theme-premium .cv-entry-header{
    padding-left: 6px;
}

.theme-premium .cv-entry-title{
    font-size: 11pt;
    font-weight: bold;
}

.theme-premium .cv-entry-location{
    font-size: 11pt;
    font-weight: bold;
}

/* Job title: 11pt bold italic */
.theme-premium .cv-entry-sub{
    padding-left: 6px;
}

.theme-premium .cv-entry-subtitle{
    font-size: 11pt;
    font-weight: bold;
    font-style: italic;
}

.theme-premium .cv-entry-date{
    font-size: 11pt;
    font-style: italic;
    font-weight: normal;
}

/* Additional Information section */
.theme-premium .cv-additional-info{
    padding-left: 13px;
    font-size: 11pt;
    line-height: 1.3;
}

.theme-premium .cv-additional-info .cv-addl-label{
    font-weight: bold;
    font-style: normal;
    font-size: 11pt;
    margin-top: 2px;
    margin-bottom: 1px;
}

.theme-premium .cv-additional-info .cv-addl-value{
    padding-left: 8px;
    margin-top: 1px;
    margin-bottom: 4px;
}

/* Summary paragraph — 2-4 lines, tight, right under the heading */
.theme-premium .cv-summary{
    font-size: 11pt;
    line-height: 1.4;
    margin-top: 2px;
    padding-left: 6px;
    color: #000;
}

/* Original Theme — identical layout to Premium, Tinos font (metrically identical to Times New Roman) */
.cv-page.theme-original {
    font-family: 'Tinos', 'Times New Roman', Georgia, serif;
    color: #000;
    font-size: 11pt;
    line-height: 1.3;
    padding: 0.08in 0.35in 0in 0.44in;
}
.theme-original .cv-name { font-size: 17pt; font-weight: bold; margin-bottom: 0; line-height: 1.2; }
.theme-original .cv-address { font-size: 11pt; font-weight: bold; font-style: italic; text-align: center; margin-top: 2px; }
.theme-original .cv-contact { margin-top: 1px; font-size: 11pt; font-weight: normal; font-style: normal; }
.theme-original .cv-contact a { text-decoration: underline; color: #000; }
.theme-original .cv-hr { display: none; }
.theme-original .cv-section-heading-wrapper { border-bottom: 1px solid #000; margin-top: 6px; margin-bottom: 2px; padding-left: 6px; padding-bottom: 1px; }
.theme-original .cv-section-heading { color: #000; font-size: 11pt; font-weight: 700; text-transform: uppercase; text-decoration: none; }
.theme-original .cv-edu-block { margin-top: 4px; }
.theme-original .cv-edu-school { font-size: 11pt; font-weight: bold; }
.theme-original .cv-edu-header { padding-left: 6px; }
.theme-original .cv-edu-details { font-size: 11pt; font-weight: bold; font-style: italic; }
.theme-original .cv-edu-header .cv-entry-date { font-size: 11pt; font-style: italic; font-weight: normal; }
.theme-original .cv-entry-bullets { font-size: 11pt; margin-top: 1px; line-height: 1.3; padding-left: 34px; }
.theme-original .cv-entry-bullets li { margin-bottom: 1px; padding-right: 0; }
.theme-original .cv-entry { margin-top: 4px; }
.theme-original .cv-entry-header { padding-left: 6px; }
.theme-original .cv-entry-title { font-size: 11pt; font-weight: bold; }
.theme-original .cv-entry-location { font-size: 11pt; font-weight: bold; }
.theme-original .cv-entry-sub { padding-left: 6px; }
.theme-original .cv-entry-subtitle { font-size: 11pt; font-weight: bold; font-style: italic; }
.theme-original .cv-entry-date { font-size: 11pt; font-style: italic; font-weight: normal; }
.theme-original .cv-additional-info { padding-left: 13px; font-size: 11pt; line-height: 1.3; }
.theme-original .cv-additional-info .cv-addl-label { font-weight: bold; font-style: normal; font-size: 11pt; margin-top: 2px; margin-bottom: 1px; }
.theme-original .cv-additional-info .cv-addl-value { padding-left: 8px; margin-top: 1px; margin-bottom: 4px; }
.theme-original .cv-summary { font-size: 11pt; line-height: 1.4; margin-top: 2px; padding-left: 6px; color: #000; }

/* CV Header */
.cv-header {
    text-align: center;
    margin-bottom: 0;
}

.cv-name {
    font-size: 23pt;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.cv-title {
    font-size: 15pt;
    font-weight: 400;
    line-height: 1.2;
    margin: 1px 0 0;
}

.cv-contact {
    font-size: 11pt;
    margin-top: 2px;
    line-height: 1.3;
}

.cv-contact a {
    color: var(--cv-link);
    text-decoration: none;
}

/* CV HR */
.cv-hr {
    border: none;
    border-top: 1.5px solid #a0a0a0;
    margin: 6px 0 5px;
}

/* CV Biography */
.cv-biography {
    font-style: italic;
    font-size: 11pt;
    line-height: 1.3;
}

/* CV Section Headings */
.cv-section-heading-wrapper {
    margin-top: 10px;
    margin-bottom: 3px;
    page-break-after: avoid;
    break-after: avoid;
    border-bottom: 1.5px solid var(--cv-blue);
    padding-bottom: 1px;
}

.cv-section-heading {
    font-size: 12pt;
    font-weight: 700;
    color: var(--cv-blue);
    text-transform: uppercase;
    letter-spacing: 0.01em;
    display: inline;
}

/* Skills Grid */
.cv-skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 3px;
}

.cv-skills-col {
    list-style: disc;
    padding-left: 20px;
    font-size: 11pt;
    line-height: 1.4;
    margin: 0;
}

.cv-skills-col li {
    margin: 0;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Entry (Project/Exp) */
.cv-entry {
    margin-top: 6px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cv-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    line-height: 1.3;
}

.cv-entry-title {
    font-weight: 700;
    font-size: 12pt;
}

.cv-entry-location {
    font-weight: 700;
    font-size: 11pt;
}

.cv-entry-date {
    font-style: italic;
    font-size: 11pt;
    white-space: nowrap;
    flex-shrink: 0;
}

.cv-entry-sub {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    line-height: 1.3;
}

.cv-entry-subtitle {
    font-style: italic;
    font-size: 11pt;
}

.cv-entry-description {
    font-style: italic;
    font-size: 11pt;
    line-height: 1.3;
}

.cv-entry-bullets {
    list-style: disc;
    padding-left: 22px;
    margin-top: 3px;
    font-size: 11pt;
    line-height: 1.3;
}

.cv-entry-bullets li {
    margin-bottom: 3pt;
    padding-right: 0.4in;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cv-entry-bullets li:last-child {
    margin-bottom: 0;
}

/* Education */
.cv-edu-block {
    margin-top: 6px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.cv-edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    line-height: 1.3;
}

.cv-edu-school {
    font-weight: 700;
    font-size: 12pt;
}

.cv-edu-details {
    font-size: 11pt;
    line-height: 1.3;
}

/* Courses */
.cv-courses-list {
    list-style: disc;
    padding-left: 22px;
    margin-top: 3px;
    font-size: 11pt;
    line-height: 1.3;
}

.cv-courses-list li {
    margin-bottom: 2px;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Additional Information (Premium) */
.cv-additional-info {
    font-size: 11pt;
    line-height: 1.3;
}

.cv-additional-info p {
    margin: 3px 0 6px 0;
}

.cv-courses-list a {
    color: var(--cv-link);
    text-decoration: underline;
}

/* ===== TOASTS ===== */
.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-toolbar);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.2s ease;
    pointer-events: auto;
}

.toast-icon {
    flex-shrink: 0;
}

.toast.success {
    border-left: 3px solid var(--green);
}

.toast.error {
    border-left: 3px solid var(--red);
}

.toast.info {
    border-left: 3px solid var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    .editor-section {
        width: 100% !important;
        height: 45%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .preview-section {
        height: 55%;
    }

    .resize-handle {
        display: none;
    }

    .shortcut-hint {
        display: none;
    }

    .cv-page {
        width: 100%;
        min-height: auto;
        padding: 0.3in;
        font-size: 9pt;
    }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* LLM Modal toolbar row */
.llm-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.llm-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    height: 34px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #7c6ef5 0%, #61afef 100%);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(124, 110, 245, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.llm-copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(124, 110, 245, 0.45);
}

.llm-copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(124, 110, 245, 0.2);
}

.modal-code-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: #1a1b25;
    overflow: hidden;
}

.copy-modal-btn {
    display: none;
}

#llm-format-text {
    width: 100%;
    flex: 1;
    background: transparent;
    color: #e8e9f5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    padding: 16px 20px;
    border: none;
    resize: none;
    outline: none;
    overflow-y: auto;
}

#llm-format-text::-webkit-scrollbar {
    width: 8px;
}

#llm-format-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}

#llm-format-text::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

#llm-format-text::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Paywall Modal */
.paywall-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    text-align: center;
    max-width: 400px;
    padding: 40px 30px;
}

.paywall-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.paywall-content h2 {
    margin: 0 0 10px;
    color: #111;
    font-size: 24px;
}

.paywall-content p {
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
}

.paywall-features {
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
    text-align: left;
}

.paywall-features li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #333;
}

.paywall-features li:last-child {
    border-bottom: none;
}

.paywall-disclaimer {
    font-size: 12px;
    color: #888;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
}

.paywall-btn {
    display: block;
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(124, 110, 245, 0.4);
    transition: all 0.2s ease;
    margin-top: 20px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.paywall-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 110, 245, 0.5);
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    color: #ffffff !important;
}

.paywall-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(124, 110, 245, 0.3);
}


/* Auth UI & User Dropdown */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    height: 36px;
    padding: 0 20px;
    background: linear-gradient(135deg, #7c6ef5 0%, #9b8fff 50%, #61afef 100%);
    background-size: 200% auto;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(124, 110, 245, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
}

.auth-btn:hover {
    background-position: right center;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(124, 110, 245, 0.5);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(124, 110, 245, 0.25);
}

.auth-btn svg {
    transition: transform 0.2s ease;
}

.auth-btn:hover svg {
    transform: translateX(1px);
}

/* Help Button */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    height: 36px;
    padding: 0 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(124, 110, 245, 0.15);
    transform: translateY(-1px);
}

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

.user-dropdown-container {
    position: relative;
    display: inline-block;
}

.user-avatar-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar-btn:hover {
    transform: scale(1.08);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
}

.user-avatar-btn:hover .user-avatar {
    border-color: var(--accent-light);
    box-shadow: 0 0 10px rgba(124, 110, 245, 0.4);
}

.user-dropdown-container.open .user-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(124, 110, 245, 0.5);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 260px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    animation: slideUp 0.2s ease forwards;
    transform-origin: top right;
}

.user-dropdown-container.open .user-dropdown-menu {
    display: flex;
}

.dropdown-header {
    padding: 16px;
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name-large {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email-text {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-status {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    width: fit-content;
    background: #f3f4f6;
    color: #4b5563;
}

.dropdown-status.pro {
    background: linear-gradient(135deg, #f59e0b20, #ef444420);
    color: #dc2626;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
}

.dropdown-status.pro .status-dot {
    background: #ef4444;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    width: 100%;
}

.dropdown-item {
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item svg {
    color: var(--text-dim);
    transition: color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-panel);
}

.dropdown-item:hover svg {
    color: var(--text);
}

.dropdown-logout {
    color: #dc2626;
}

.dropdown-logout svg {
    color: #dc2626;
}

.dropdown-logout:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Auth Modal */
.auth-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    max-width: 420px;
}

.auth-content .modal-header,
.paywall-content .modal-header {
    border-bottom-color: #eee;
}

.auth-content .modal-header h3,
.paywall-content .modal-header h3 {
    color: #111;
}

.auth-content .modal-header button,
.paywall-content .modal-header button {
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
}

.auth-content .modal-header button:hover,
.paywall-content .modal-header button:hover {
    color: #111;
}

.auth-body {
    padding: 40px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--accent-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-body h2 {
    font-size: 24px;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px 0;
}

.auth-body p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.auth-google-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: background 0.2s, box-shadow 0.2s;
}

.auth-google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-color: #d2e3fc;
}

.auth-google-btn svg {
    flex-shrink: 0;
}

/* Theme Toggle Segmented Control */
.theme-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.25);
    padding: 2px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.theme-btn {
    border: none;
    background: transparent;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
}

.theme-btn:hover {
    color: var(--text);
}

.theme-btn.active {
    background: var(--bg-hover);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-light);
}

.theme-btn.premium.active {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 110, 245, 0.35);
    border: 1px solid transparent;
}

.theme-btn.premium svg {
    width: 13px;
    height: 13px;
    transition: transform 0.2s ease, fill 0.2s ease;
}

.theme-btn.premium:hover svg {
    transform: scale(1.1);
}

.theme-btn.premium.active svg {
    color: #f59e0b;
    fill: #f59e0b;
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.7));
}

/* ===== PRINT STYLES (For ATS-optimized, selectable vector PDF generation) ===== */
@media print {

    /* Reset margins and force light background */
    body,
    html {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Hide all layout structures, navigation headers, controls, and modals */
    header,
    .editor-section,
    .preview-toolbar,
    .toast-container,
    .modal-backdrop,
    .modal-overlay,
    #authModal,
    #paywallModal,
    #llm-modal,
    #pdf-modal,
    .resize-handle {
        display: none !important;
    }

    /* Make layout container take 100% space and remove flex spacing */
    .main-layout {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    .preview-section {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border: none !important;
    }

    .preview-area {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    .cv-page-container {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
    }

    /* Format the print page directly */
    .cv-page {
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0.5in 0.42in 0.5in 0.4in !important;
        width: 8.5in !important;
        min-height: auto !important;
        background: #ffffff !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        overflow: visible !important;
    }

    .cv-page.theme-premium {
        padding: 0.28in 0.35in 0.1in 0.44in !important;
    }


    /* Flatten multi-column grid into a linear comma-separated text block for ATS parsers */
    .cv-skills-grid {
        display: block !important;
        margin-top: 4px !important;
    }

    .cv-skills-col {
        display: inline !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .cv-skills-col li {
        display: inline !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .cv-skills-col li::after {
        content: ", " !important;
    }

    .cv-skills-col:last-child li:last-child::after {
        content: "" !important;
    }

    /* Print page settings */
    @page {
        size: letter portrait;
        margin: 0;
    }
}