/* ============================================================
   Career Guidance App — Main Stylesheet
   Target: Greek high school students (15-18)
   Aesthetic: Modern, warm, encouraging — not clinical
   ============================================================ */

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

/* ── Variables ── */
:root {
    /* Primary palette — warm indigo/violet */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);

    /* Accent — warm amber */
    --accent: #f59e0b;
    --accent-light: #fbbf24;

    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Neutrals */
    --bg: #fafafe;
    --bg-card: #ffffff;
    --bg-subtle: #f1f0fb;
    --text: #1e1b4b;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(30, 27, 75, 0.06);
    --shadow-md: 0 4px 12px rgba(30, 27, 75, 0.08);
    --shadow-lg: 0 12px 40px rgba(30, 27, 75, 0.12);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);

    /* Radius */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Category colors */
    --color-holland: #6366f1;
    --color-personality: #10b981;
    --color-soft: #f59e0b;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background texture */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(99,102,241,0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(245,158,11,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: 'Outfit', 'Manrope', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Layout ── */
.container {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--wide { max-width: 900px; }

.screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card--elevated {
    box-shadow: var(--shadow-md);
    border: none;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn--primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn--primary:active { transform: translateY(0); }

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

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn--ghost:hover { background: var(--bg-subtle); }

.btn--lg { padding: 18px 40px; font-size: 1.1rem; }
.btn--sm { padding: 10px 20px; font-size: 0.875rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 12px; border-radius: var(--radius-sm); }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Progress Bar ── */
.progress-wrap {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 20px 12px;
    background: rgba(250, 250, 254, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width 0.5s var(--ease);
    position: relative;
}

.progress-bar__fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    border-radius: var(--radius-full);
}

/* ── Likert Scale ── */
.likert {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.likert__option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.likert__option input { display: none; }

.likert__btn {
    width: 100%;
    aspect-ratio: 1;
    max-width: 72px;
    border-radius: var(--radius-sm);
    border: 2.5px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.likert__btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    border-radius: inherit;
}

.likert__option:hover .likert__btn {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.likert__option input:checked + .likert__btn {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.likert__label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
    line-height: 1.3;
}

/* ── Module Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--holland { background: rgba(99,102,241,0.1); color: var(--color-holland); }
.badge--personality { background: rgba(16,185,129,0.1); color: var(--color-personality); }
.badge--soft_skills { background: rgba(245,158,11,0.1); color: var(--color-soft); }

/* ── Question Card ── */
.question-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 80px);
    padding: 20px;
    text-align: center;
}

.question-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.question-text {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.25rem, 4vw, 1.7rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 40px;
    max-width: 520px;
    color: var(--text);
}

.question-category {
    margin-bottom: 20px;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOutUp {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-24px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-in { animation: fadeInUp 0.45s var(--ease) both; }
.animate-out { animation: fadeOutUp 0.3s var(--ease) both; }
.animate-fade { animation: fadeIn 0.4s var(--ease) both; }
.animate-scale { animation: scaleIn 0.4s var(--ease-spring) both; }

/* Stagger children */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }
.stagger > *:nth-child(9) { animation-delay: 480ms; }
.stagger > *:nth-child(10) { animation-delay: 540ms; }

/* ── Results Page ── */
.results-header {
    text-align: center;
    padding: 48px 20px 32px;
}

.holland-code {
    display: inline-flex;
    gap: 4px;
    margin: 16px 0;
}

.holland-code__letter {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.holland-code__letter:nth-child(2) { background: var(--primary-light); }
.holland-code__letter:nth-child(3) { background: #a5b4fc; color: var(--primary-dark); }

/* Chart containers */
.chart-section {
    margin-bottom: 32px;
}

.chart-section h3 {
    margin-bottom: 16px;
    padding-left: 4px;
}

.chart-wrap {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.chart-wrap canvas {
    max-height: 320px;
}

/* Profession cards */
.profession-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profession-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s var(--ease);
}

.profession-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.profession-rank {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.profession-card:nth-child(1) .profession-rank {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.profession-card:nth-child(2) .profession-rank {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
}
.profession-card:nth-child(3) .profession-rank {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

.profession-info { flex: 1; min-width: 0; }

.profession-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.profession-study {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profession-match {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    flex-shrink: 0;
}

.profession-match span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Match bar (mini) */
.match-bar {
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    margin-top: 8px;
    overflow: hidden;
}

.match-bar__fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.8s var(--ease);
}

/* Interpretation cards */
.interp-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    margin-bottom: 12px;
}

.interp-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.interp-card__label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
}

.interp-card__score {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

.interp-card__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Section tabs */
.section-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.section-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s var(--ease);
    white-space: nowrap;
}

.section-tab.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* PDF Export Button Area */
.export-area {
    text-align: center;
    padding: 32px 0 48px;
}

/* ── Welcome Page ── */
.welcome {
    text-align: center;
    max-width: 520px;
}

.welcome__icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.welcome h1 {
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome__subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.welcome__stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 36px;
}

.welcome__stat {
    text-align: center;
}

.welcome__stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
}

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

.welcome__form {
    margin-bottom: 28px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s var(--ease);
    outline: none;
}

.input-field:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

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

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ── Navigation Buttons (quiz) ── */
.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 32px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(250, 250, 254, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    max-width: 640px;
    margin: 0 auto;
}

/* ── Loading Spinner ── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    gap: 16px;
    color: var(--text-secondary);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .likert { gap: 6px; }
    .likert__btn { max-width: 58px; font-size: 1.3rem; }
    .likert__label { font-size: 0.65rem; }
    .profession-card { padding: 16px; gap: 12px; }
    .profession-rank { width: 38px; height: 38px; font-size: 0.95rem; }
    .profession-match { font-size: 1rem; }
    .card { padding: 20px; }
    .quiz-nav { padding: 12px 16px 24px; }
    .section-tabs { gap: 2px; }
    .section-tab { padding: 8px 12px; font-size: 0.8rem; }
}

/* ── Print / PDF ── */
@media print {
    body::before { display: none; }
    .progress-wrap, .quiz-nav, .export-area, .btn { display: none !important; }
    .card, .profession-card, .interp-card, .chart-wrap {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ===================================================
   AI ANALYSIS — CSS STYLES
   Add these to css/style.css
   =================================================== */

.ai-analysis-wrapper {
    padding: 8px 0;
}

.ai-analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 12px;
    border: 1px solid #c7d2fe;
}

.ai-analysis-paragraph {
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.85;
    margin: 0 0 16px 0;
    text-align: justify;
}

.ai-analysis-disclaimer {
    margin-top: 20px;
    padding: 12px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #92400e;
    line-height: 1.6;
}
