/* ==========================================================================
   Resume ATS Scanner — Design System & Styles
   Theme: Dark mode with Blue/Green palette, glassmorphism accents
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --color-primary: #3B82F6;
    --color-primary-glow: rgba(59, 130, 246, 0.25);
    --color-secondary: #10B981;
    --color-secondary-glow: rgba(16, 185, 129, 0.2);
    --color-accent: #F59E0B;
    --color-accent-glow: rgba(245, 158, 11, 0.2);
    --color-bg: #0F172A;
    --color-bg-raised: #1E293B;
    --color-bg-card: rgba(30, 41, 59, 0.6);
    --color-bg-input: rgba(15, 23, 42, 0.8);
    --color-surface: rgba(51, 65, 85, 0.4);
    --color-border: rgba(148, 163, 184, 0.12);
    --color-text: #F1F5F9;
    --color-text-secondary: #94A3B8;
    --color-text-muted: #64748B;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-purple: #8B5CF6;
    --color-teal: #14B8A6;
    --color-rose: #F43F5E;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 250ms ease;
    --transition-fast: 150ms ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 40px rgba(16, 185, 129, 0.15);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Background Glows --- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.bg-glow--1 {
    width: 600px;
    height: 600px;
    background: var(--color-primary-glow);
    top: -150px;
    right: -100px;
    animation: float 12s ease-in-out infinite;
}

.bg-glow--2 {
    width: 500px;
    height: 500px;
    background: var(--color-secondary-glow);
    bottom: -100px;
    left: -80px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -20px);
    }
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

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

.header__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.header__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

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

.header__tagline {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* --- Main --- */
.main {
    padding: 24px 0 48px;
}

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

.input-panel {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-panel:hover {
    border-color: rgba(148, 163, 184, 0.2);
}

.input-panel:focus-within {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow-blue);
}

.input-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.input-panel__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}

.input-panel__label svg {
    color: var(--color-primary);
}

.input-panel__hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.input-panel__textarea {
    width: 100%;
    min-height: 240px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-input);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--transition);
    outline: none;
}

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

.input-panel__textarea:focus {
    border-color: var(--color-primary);
}

/* --- Action Bar --- */
.action-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

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

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), #2563EB);
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
}

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

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: rgba(148, 163, 184, 0.25);
}

/* --- Loading State --- */
.btn--loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn--loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Hidden Utility --- */
.hidden {
    display: none !important;
}

/* --- Results Section --- */
.results-section {
    animation: slideUp 500ms ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

/* --- Score Overview --- */
.score-overview {
    display: flex;
    align-items: center;
    gap: 32px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

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

.score-ring__bg {
    fill: none;
    stroke: var(--color-surface);
    stroke-width: 8;
}

.score-ring__fill {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.2s ease;
}

.score-ring__value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-ring__number {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.score-ring__label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 4px;
}

.score-summary__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-summary__verdict {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform var(--transition), box-shadow var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.metric-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.metric-card__icon--blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
}

.metric-card__icon--green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-secondary);
}

.metric-card__icon--amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-accent);
}

.metric-card__icon--purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-purple);
}

.metric-card__icon--teal {
    background: rgba(20, 184, 166, 0.15);
    color: var(--color-teal);
}

.metric-card__icon--rose {
    background: rgba(244, 63, 94, 0.15);
    color: var(--color-rose);
}

.metric-card__body {
    display: flex;
    flex-direction: column;
}

.metric-card__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.metric-card__title {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* --- Details Grid --- */
.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-panel {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.detail-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text);
}

.detail-panel__title svg {
    color: var(--color-text-muted);
}

.detail-panel__content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-panel__empty {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* --- Tags --- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    transition: transform var(--transition-fast);
}

.tag:hover {
    transform: scale(1.05);
}

.tag--match {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tag--missing {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* --- Section Checklist Items --- */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.85rem;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
}

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

.checklist-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.checklist-icon--found {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.checklist-icon--missing {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

.checklist-item__label {
    color: var(--color-text-secondary);
}

.checklist-item__label--found {
    color: var(--color-text);
}

/* --- ATS Tip Item --- */
.tip-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    font-size: 0.85rem;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.5;
}

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

.tip-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.tip-icon--good {
    color: var(--color-success);
}

.tip-icon--warn {
    color: var(--color-accent);
}

.tip-icon--bad {
    color: var(--color-danger);
}

.tip-item__text {
    color: var(--color-text-secondary);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

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

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

    .score-overview {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .header__title {
        font-size: 1.4rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        justify-content: center;
    }

    .header__brand {
        flex-direction: column;
        gap: 8px;
    }
}