/* ============================================================
   Resume ATS Score Checker — Styles
   Professional career dark mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0984E3;
    --primary-light: #74B9FF;
    --primary-dark: #0667B5;
    --secondary: #74B9FF;
    --accent: #2ECC71;
    --accent-dark: #27AE60;
    --bg: #0F0F1A;
    --bg-elevated: #1A1A2E;
    --bg-surface: #252540;
    --bg-card: #1E1E35;
    --bg-hover: #2D2D50;
    --text-primary: #F0F0F8;
    --text-secondary: #A0A0C0;
    --text-muted: #6060A0;
    --border: #2A2A50;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #2ECC71;
    --info: #3498DB;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --radius-pill: 50px;
    --shadow: 0 4px 20px rgba(0, 0, 0, .3);
    --transition: 200ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

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

/* --- Layout --- */
.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 100px;
}

/* --- Header --- */
.header {
    text-align: center;
    padding: 40px 0 32px;
}

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

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: var(--text-secondary);
    font-size: .9rem;
    margin-top: 4px;
}

/* --- Input Section --- */
.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.input-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-textarea {
    width: 100%;
    min-height: 240px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
    padding: 16px;
    resize: vertical;
    outline: none;
    line-height: 1.7;
}

.input-textarea::placeholder {
    color: var(--text-muted);
}

.analyze-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: #fff;
    font-size: 1rem;
    padding: 12px 32px;
}

.btn-primary:hover {
    box-shadow: 0 0 20px rgba(9, 132, 227, .3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: .8rem;
}

/* --- Score Section --- */
.score-section {
    display: none;
    margin-bottom: 32px;
}

.score-section.visible {
    display: block;
}

.score-hero {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.score-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(9, 132, 227, .05) 0%, transparent 50%);
    pointer-events: none;
}

.score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease, stroke 0.5s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 800;
}

.score-label {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.score-verdict {
    font-size: .9rem;
    color: var(--text-secondary);
}

/* --- Results Grid --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.result-icon {
    font-size: 1.2rem;
}

.result-title {
    font-size: .9rem;
    font-weight: 700;
    flex: 1;
}

.result-score {
    font-size: .8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
}

.result-score.good {
    background: rgba(46, 204, 113, .1);
    color: var(--success);
}

.result-score.warn {
    background: rgba(243, 156, 18, .1);
    color: var(--warning);
}

.result-score.bad {
    background: rgba(231, 76, 60, .1);
    color: var(--danger);
}

.result-body {
    padding: 16px;
}

/* --- Keywords --- */
.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.keyword-tag {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 500;
}

.keyword-tag.found {
    background: rgba(46, 204, 113, .1);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, .3);
}

.keyword-tag.missing {
    background: rgba(231, 76, 60, .1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, .3);
}

/* --- Progress Bars --- */
.progress-item {
    margin-bottom: 12px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    margin-bottom: 4px;
}

.progress-label span:first-child {
    color: var(--text-secondary);
}

.progress-label span:last-child {
    font-weight: 600;
}

.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.progress-fill.good {
    background: var(--success);
}

.progress-fill.warn {
    background: var(--warning);
}

.progress-fill.bad {
    background: var(--danger);
}

/* --- Checklist --- */
.checklist {
    list-style: none;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: .85rem;
    color: var(--text-secondary);
}

.check-icon {
    font-size: .9rem;
}

.check-icon.pass {
    color: var(--success);
}

.check-icon.fail {
    color: var(--danger);
}

.check-icon.warn {
    color: var(--warning);
}

/* --- Chart --- */
.chart-container {
    height: 120px;
    margin-top: 12px;
}

.chart-canvas {
    width: 100%;
    height: 100%;
}

/* --- Recommendations --- */
.rec-list {
    list-style: none;
}

.rec-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}

.rec-item:last-child {
    border-bottom: none;
}

.rec-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 20px;
    font-size: .85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

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

    .header h1 {
        font-size: 1.4rem;
    }

    .score-ring {
        width: 120px;
        height: 120px;
    }

    .score-value {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}