:root {
    --primary: #1e2a44;
    --primary-dark: #141d33;
    --accent: #4f6ef7;
    --accent-dark: #3a52c4;
    --success: #16a34a;
    --success-bg: #e8f7ee;
    --warn: #d97706;
    --warn-bg: #fef3e2;
    --danger: #dc2626;
    --danger-bg: #fdecec;
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --border: #e6e9f0;
    --text: #1f2430;
    --text-muted: #6b7280;
    --chip-bg: #eef0f6;
    --chip-text: #3a4155;
}

:root[data-theme="dark"] {
    --primary: #232c45;
    --primary-dark: #0f1424;
    --accent: #6b83ff;
    --accent-dark: #8b9fff;
    --success: #4ade80;
    --success-bg: #123a24;
    --warn: #fbbf24;
    --warn-bg: #3a2c0d;
    --danger: #f87171;
    --danger-bg: #3d1414;
    --bg: #10131f;
    --card-bg: #181c2b;
    --border: #2a2f45;
    --text: #e5e7ef;
    --text-muted: #9aa1b5;
    --chip-bg: #232842;
    --chip-text: #cfd4ea;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    transition: background 0.2s ease, color 0.2s ease;
    position: relative;
    overflow-x: hidden;
}

/* --- Decorative blurred background blobs (pure CSS, no images) --- */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-blobs::before,
.bg-blobs::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
}

.bg-blobs::before {
    width: 480px;
    height: 480px;
    top: -180px;
    left: -140px;
    background: var(--accent);
}

.bg-blobs::after {
    width: 420px;
    height: 420px;
    top: 120px;
    right: -160px;
    background: #a78bfa;
}

:root[data-theme="dark"] .bg-blobs::before,
:root[data-theme="dark"] .bg-blobs::after {
    opacity: 0.18;
}

/* --- Floating controls --- */
.backend-status {
    position: fixed;
    top: 18px;
    left: 20px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    color: white;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.status-online {
    background: #4ade80;
    box-shadow: 0 0 6px #4ade80;
}

.status-offline {
    background: #f87171;
    box-shadow: 0 0 6px #f87171;
}

#theme-toggle {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: white;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Hero --- */
.hero {
    padding: 90px 20px 70px 20px;
    text-align: center;
}

.hero-inner {
    max-width: 700px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background: var(--chip-bg);
    color: var(--accent-dark);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero h1 {
    margin: 0 0 18px 0;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--primary);
}

.gradient-text {
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto 32px auto;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.stat span {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Layout --- */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 24px 20px 40px 20px;
}

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(20, 29, 51, 0.04);
}

.upload-card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 30px rgba(20, 29, 51, 0.08);
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.card-icon {
    font-size: 1.3rem;
}

.card h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 700;
}

.hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 4px 0 0 0;
}

.hidden {
    display: none;
}

/* --- Dropzone --- */
.dropzone {
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    padding: 32px 20px;
    margin: 16px 0;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone-active {
    border-color: var(--accent);
    background: var(--chip-bg);
}

.dropzone-icon {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.dropzone-text {
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

.dropzone-browse {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: underline;
}

/* --- Buttons --- */
button {
    padding: 12px 24px;
    margin: 10px 0;
    cursor: pointer;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    width: 100%;
}

button:hover {
    background: var(--accent-dark);
    box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Status messages --- */
#status-message {
    font-style: italic;
    color: var(--text-muted);
    min-height: 1.2em;
    text-align: center;
}

#status-message.loading {
    color: var(--accent-dark);
    font-style: normal;
    font-weight: 500;
}

#status-message.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    animation: dots 1.4s infinite steps(4, end);
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
}

#status-message.error {
    color: var(--danger);
    font-weight: 600;
    font-style: normal;
}

/* --- Agents showcase section --- */
.agents-showcase {
    text-align: center;
    margin: 50px 0 40px 0;
}

.section-title {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.section-sub {
    color: var(--text-muted);
    max-width: 460px;
    margin: 0 auto 28px auto;
    font-size: 0.95rem;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    text-align: left;
}

.agent-showcase-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.agent-showcase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(20, 29, 51, 0.08);
}

.agent-showcase-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
}

.agent-showcase-card h3 {
    margin: 0 0 6px 0;
    font-size: 0.98rem;
    color: var(--primary);
}

.agent-showcase-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

@media (max-width: 700px) {
    .agents-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 460px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Agent progress checklist --- */
.progress-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin: 14px 0 16px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

#agent-progress-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#agent-progress-list li {
    padding: 7px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.agent-status {
    display: inline-block;
    width: 18px;
    text-align: center;
}

.agent-pending {
    color: #b0b6c3;
}

.agent-done {
    color: var(--success);
    font-weight: 600;
}

/* --- Candidate profile --- */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
    margin-top: 10px;
}

.profile-grid p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-grid p.span-2 {
    grid-column: span 2;
}

.profile-grid strong {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 500px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-grid p.span-2 {
        grid-column: span 1;
    }
}

/* --- Empty states --- */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 24px;
}

.empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
}

.initial-placeholder p {
    margin: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Chips / skill tags --- */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.chip {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--chip-bg);
    color: var(--chip-text);
    white-space: nowrap;
}

.chip-success {
    background: var(--success-bg);
    color: var(--success);
}

.chip-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.chip-neutral {
    background: var(--chip-bg);
    color: var(--chip-text);
}

.skills-block {
    margin: 12px 0;
}

.skills-block > strong {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}

/* --- Projects (name highlighted, description muted) --- */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-name {
    font-weight: 700;
    color: var(--accent-dark);
    font-size: 0.95rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* --- Job recommendations --- */
.recommendations-heading {
    color: var(--primary);
    margin: 8px 0 16px 4px;
}

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

.job-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
    background: var(--card-bg);
    animation: cardFadeIn 0.35s ease both;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.job-card:hover {
    box-shadow: 0 6px 18px rgba(20, 29, 51, 0.08);
    transform: translateY(-2px);
}

.job-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.job-title {
    margin: 0 0 4px 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.job-meta {
    color: var(--text-muted);
    margin: 0 0 10px 0;
    font-size: 0.9rem;
}

.score-pill {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.score-high {
    background: var(--success-bg);
    color: var(--success);
}

.score-mid {
    background: var(--warn-bg);
    color: var(--warn);
}

.score-low {
    background: var(--danger-bg);
    color: var(--danger);
}

.experience-compat {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.why-matches {
    font-style: italic;
    margin: 12px 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.apply-btn {
    display: inline-block;
    width: auto;
    padding: 9px 18px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.apply-btn:hover {
    background: var(--primary-dark);
}

/* --- Basic responsiveness --- */
@media (max-width: 600px) {
    .hero {
        padding: 80px 16px 50px 16px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .stats-row {
        gap: 24px;
    }

    main {
        padding: 0 14px 40px 14px;
    }

    .card {
        padding: 18px 18px;
    }

    .job-title-row {
        flex-direction: column;
    }
}
