:root {
    /* Dark Theme (Default) */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-card: rgba(30, 30, 30, 0.7);
    --text-main: #fcfcfc;
    --text-muted: #a1a1aa;
    --accent-1: #6366f1;
    /* Indigo */
    --accent-2: #8b5cf6;
    /* Violet */
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-1: #4f46e5;
    --accent-2: #7c3aed;
    --success: #059669;
    --danger: #dc2626;
    --border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 1.5rem;
}

/* Typography Gradient */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s;
}

.nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.4rem;
    font-family: 'Outfit', var(--font-main);
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform 0.2s ease, text-shadow 0.2s ease;
}

.nav-brand:hover {
    transform: scale(1.02);
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-brand:hover .brand-icon {
    transform: rotate(10deg) scale(1.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Outfit', var(--font-main);
    transition: color 0.2s, transform 0.2s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text-main);
    transform: translateY(-1px);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: rgba(128, 128, 128, 0.1);
}

/* Main Section */
.main-section {
    padding: 5.5rem 0 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0px;
    animation: textReveal 0.8s ease-out both;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    animation: textReveal 0.8s ease-out 0.2s both;
}

.screen-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
}

/* Form */
.form-panel {
    position: sticky;
    top: 6rem;
    z-index: 10;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    background: rgba(128, 128, 128, 0.05);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
}

.drop-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.drop-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid var(--border);
}

.file-name {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.file-remove {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

.form-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--bg-secondary);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Panel */
.results-panel {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Placeholder */
.results-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    min-height: 250px;
    background: rgba(128, 128, 128, 0.02);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.results-placeholder h3 {
    color: var(--text-main);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Loading */
.results-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 1.5rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.lstep {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.lstep.active {
    color: var(--text-main);
    opacity: 1;
}

.lstep.done {
    color: var(--success);
    opacity: 1;
}

/* Results Content */
.results-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.score-card {
    text-align: center;
}

.score-value-large {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bi-label {
    width: 140px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 600;
}

.bi-bar-wrap {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.bi-bar {
    height: 100%;
    border-radius: 5px;
    width: 0%;
    transition: width 1s ease 0.5s;
}

.skill-bar {
    background: var(--success);
}

.tfidf-bar {
    background: var(--accent-1);
}

.bi-val {
    width: 50px;
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 700;
}

/* AI Suggestion Box */
.ai-suggestion {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--accent-1);
    margin-bottom: 0.75rem;
}

.ai-content {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.6;
}

.ai-content ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* Verdict Badge */
.verdict-badge {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid;
}

/* Skills Tabs */
.skill-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.stab {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stab:hover {
    background: var(--border);
    color: var(--text-main);
}

.stab.active {
    background: var(--text-main);
    color: var(--bg-primary);
}

.stab-count {
    background: rgba(128, 128, 128, 0.2);
    padding: 0.1rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
}

.stab.active .stab-count {
    background: rgba(128, 128, 128, 0.4);
}

.skill-content .stab-panel {
    display: none;
}

.skill-content .stab-panel.active {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sk-chip {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    border: 1px solid;
    font-weight: 500;
}

.sk-matched {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.sk-missing {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.sk-resume {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--accent-1);
}

.no-skills {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
}

/* Entities */
.section-mini-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    font-weight: 700;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.entity-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
}

.entity-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-1);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.entity-list {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Export / Action Row */
.export-row {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn-export {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

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

.results-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.results-error p {
    color: var(--danger);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    background: var(--bg-secondary);
}

.footer p {
    color: var(--text-muted);
}

.footer strong {
    color: var(--text-main);
}

.footer-sub {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--accent-1);
}

.social-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* How it works separate page */
.how-page {
    padding: 8rem 0 4rem;
}

.how-page .how-section {
    background: none;
    border: none;
    padding: 0;
}

.how-page .step-card {
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
    .screen-grid {
        grid-template-columns: 1fr;
    }

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

@media print {

    :root,
    [data-theme="dark"],
    [data-theme="light"] {
        --bg-primary: #ffffff !important;
        --bg-secondary: #ffffff !important;
        --bg-card: #ffffff !important;
        --text-main: #000000 !important;
        --text-muted: #333333 !important;
        --accent-1: #4f46e5 !important;
        --accent-2: #7c3aed !important;
        --success: #059669 !important;
        --danger: #dc2626 !important;
        --border: #cccccc !important;
        --glass-shadow: none !important;
    }

    *,
    ::after,
    ::before {
        box-sizing: border-box !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .navbar,
    .form-panel,
    .export-row,
    .theme-toggle,
    .footer {
        display: none !important;
    }

    .main-section {
        padding: 0 !important;
    }

    .section-header p {
        display: none !important;
    }

    .screen-grid {
        display: block !important;
    }

    .results-panel,
    .glass-card,
    .results-content {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    .gradient-text {
        background: none !important;
        -webkit-text-fill-color: var(--accent-1) !important;
        color: var(--accent-1) !important;
        border: none !important;
    }

    .entity-type {
        color: var(--accent-1) !important;
    }
}