/* ============================================
   AI Resume Tailor — Modern Gradient Palette
   Primary: #6C63FF | Secondary: #A78BFA
   Accent: #F472B6 | Background: #0F0A1A
   ============================================ */

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

:root {
    --primary: #6C63FF;
    --primary-glow: rgba(108, 99, 255, 0.15);
    --secondary: #A78BFA;
    --accent: #F472B6;
    --accent-glow: rgba(244, 114, 182, 0.12);
    --bg: #0F0A1A;
    --bg-card: #1a1230;
    --bg-card-hover: #221840;
    --bg-input: #120d20;
    --border: #2a2045;
    --border-focus: #6C63FF;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --success: #34d399;
    --error: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px rgba(108, 99, 255, 0.12);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

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

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 10, 26, 0.88);
    backdrop-filter: blur(16px) saturate(1.8);
    -webkit-backdrop-filter: blur(16px) saturate(1.8);
    border-bottom: 1px solid var(--border)
}

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

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-glow), var(--accent-glow));
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: var(--radius-sm);
    color: var(--primary);
    transition: var(--transition)
}

.logo-icon:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow)
}

.logo-title {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2
}

.logo-subtitle {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    background: none;
    color: var(--text)
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #5b52e0);
    color: white;
    border-color: rgba(108, 99, 255, 0.3);
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.3)
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c74ff, #5246d4);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.4);
    transform: translateY(-1px)
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted)
}

.btn-ghost:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05)
}

.btn-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600
}

.btn-full {
    width: 100%;
    justify-content: center
}

/* Main */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem
}

/* Steps Bar */
.steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem 0
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: var(--transition)
}

.step.active {
    color: var(--primary);
    background: var(--primary-glow)
}

.step.done {
    color: var(--success)
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0
}

.step.active .step-num {
    background: var(--primary);
    color: white;
    border-color: var(--primary)
}

.step.done .step-num {
    background: var(--success);
    color: white;
    border-color: var(--success)
}

.step-label {
    display: inline
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border);
    flex-shrink: 0
}

.step-connector.done {
    background: var(--success)
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start
}

.input-panel,
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition)
}

.card:hover {
    border-color: rgba(108, 99, 255, 0.15)
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02)
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem
}

.card-title-group h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text)
}

.card-icon {
    font-size: 1.125rem
}

.card-body {
    padding: 1rem
}

.char-count {
    font-size: 0.6875rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums
}

/* Text Input */
.text-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8125rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: var(--transition);
    min-height: 120px
}

.text-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15)
}

.text-input::placeholder {
    color: var(--text-dim);
    opacity: 0.5
}

/* Keywords */
.keywords-empty,
.output-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    gap: 0.5rem;
    color: var(--text-dim);
    text-align: center
}

.empty-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    margin-bottom: 0.25rem
}

.keywords-empty p,
.output-empty p {
    font-size: 0.8125rem;
    max-width: 280px
}

.keywords-content {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.keyword-section {}

.keyword-heading {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted)
}

.found-heading {
    color: var(--success)
}

.missing-heading {
    color: var(--error)
}

.suggestion-heading {
    color: var(--warning)
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition)
}

.keyword-tag.found {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: var(--success)
}

.keyword-tag.missing {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--error)
}

.suggestion-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.375rem
}

.suggestion-list li {
    padding: 0.5rem 0.75rem;
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-xs);
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5
}

/* Match Score */
.match-score {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums
}

.match-score.low {
    background: rgba(248, 113, 113, 0.12);
    color: var(--error)
}

.match-score.medium {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning)
}

.match-score.high {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success)
}

/* Output Content */
.output-content {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word
}

.output-actions {
    display: flex;
    gap: 0.25rem
}

.output-content .section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 1.25rem 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em
}

.output-content .section-title:first-child {
    margin-top: 0
}

.output-content .highlight {
    background: rgba(108, 99, 255, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--secondary)
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: 0.8125rem;
    color: var(--text);
    animation: toast-in 0.3s ease
}

.toast.success {
    border-color: rgba(52, 211, 153, 0.3)
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.3)
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15)
}

/* Responsive */
@media(max-width:768px) {
    .header-inner {
        padding: 0.625rem 1rem
    }

    .main {
        padding: 1rem;
        gap: 1rem
    }

    .content-grid {
        grid-template-columns: 1fr
    }

    .step-label {
        display: none
    }

    .steps-bar {
        gap: 0
    }
}

@media(max-width:480px) {
    .card-body {
        padding: 0.75rem
    }

    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 0.875rem
    }
}