@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&family=Varela+Round&display=swap');

:root {
    /* Colors - Soft UI Evolution (Lavender & Emerald) */
    --primary: #8B5CF6;
    /* Violet/Lavender */
    --primary-hover: #7C3AED;
    --primary-light: #C4B5FD;
    --secondary: #10B981;
    /* Emerald CTA */
    --secondary-hover: #059669;

    --bg-color: #FAF5FF;
    --bg-card: #FFFFFF;

    --text-main: #4C1D95;
    /* Deep Purple Text */
    --text-muted: #7E22CE;

    --border-color: #E9D5FF;

    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    /* Shadows - Soft UI */
    --shadow-sm: 0 1px 2px 0 rgba(139, 92, 246, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(139, 92, 246, 0.1), 0 2px 4px -1px rgba(139, 92, 246, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(139, 92, 246, 0.1), 0 4px 6px -2px rgba(139, 92, 246, 0.05);
    --shadow-inner: inset 0 2px 4px 0 rgba(139, 92, 246, 0.06);

    /* Fonts & Structure */
    --font-heading: 'Varela Round', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

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

a:hover {
    color: var(--primary-hover);
}

.hidden {
    display: none !important;
}

/* Layout */
.app-header {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-text span {
    color: var(--primary);
}

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

.nav-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.app-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    width: 100%;
}

.screen {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 800px;
}

.center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 2rem;
}

.color-primary {
    color: var(--primary);
}

/* Buttons */
.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    text-align: center;
}

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

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-cta {
    background-color: var(--secondary);
    color: white;
}

.btn-cta:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Forms */
.user-form,
.lookup-form {
    max-width: 500px;
    margin: 2rem auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

input[type="text"],
input[type="email"],
input[type="number"],
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background-color: var(--bg-card);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn .prefix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.feature-box {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feature-box .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Progress Area */
.progress-area {
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-color);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}

.section-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.section-dot {
    width: 24px;
    height: 8px;
    background-color: var(--bg-color);
    border-radius: var(--radius-pill);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.section-dot.filled {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.section-dot.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Question Area */
.question-container {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.question-text {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    text-align: center;
    color: var(--text-main);
    line-height: 1.4;
}

/* Likert Scale */
.likert-options {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.likert-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.likert-btn .vector-icon {
    width: 32px;
    height: 32px;
    stroke: var(--primary-light);
    stroke-width: 1.5;
    fill: none;
    transition: var(--transition);
}

.likert-btn .label {
    font-size: 0.85rem;
    font-family: var(--font-body);
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
}

.likert-btn:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.likert-btn:hover .vector-icon {
    stroke: var(--primary);
}

.likert-btn.selected {
    border-color: var(--primary);
    background-color: var(--bg-color);
    box-shadow: var(--shadow-inner);
    transform: translateY(2px);
}

.likert-btn.selected .vector-icon {
    stroke: var(--primary);
    fill: rgba(139, 92, 246, 0.1);
}

.likert-btn.selected .label {
    color: var(--primary);
}

.keyboard-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.question-footer {
    margin-top: 1rem;
}

.question-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.question-nav-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Mini result in section complete */
.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.mini-result {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.result-bar-bg {
    height: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-pill);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-pill);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Results Dashboard */
.dashboard {
    max-width: 900px !important;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.highlight {
    color: var(--primary);
    font-weight: 700;
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* Domains Overview */
.domains-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.domain-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-align: center;
}

.domain-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.score-text {
    font-size: 2.5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary);
}

.level-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
}

.level-very-low {
    background: #fee2e2;
    color: #b91c1c;
}

.level-low {
    background: #ffedd5;
    color: #c2410c;
}

.level-avg {
    background: #f3f4f6;
    color: #4b5563;
}

.level-high {
    background: #dcfce3;
    color: #15803d;
}

.level-very-high {
    background: #dbeafe;
    color: #1d4ed8;
}

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

/* Charts */
.chart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.chart-label {
    width: 150px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: right;
}

.chart-bar-bg {
    flex: 1;
    height: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.chart-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-value {
    width: 40px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

/* Accordion */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--bg-color);
}

.accordion-chevron {
    transition: transform 0.3s;
    color: var(--primary);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-color);
}

.accordion-item.open .accordion-content {
    max-height: 2000px;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.accordion-item.open .accordion-chevron {
    transform: rotate(180deg);
}

/* Raw Answers List */
.raw-answers-list {
    list-style: none;
    margin-top: 1rem;
}

.raw-answer-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

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

.raw-answer-item.reversed {
    background: rgba(139, 92, 246, 0.03);
}

.raw-a {
    font-weight: 700;
}

.a1 {
    color: var(--error);
}

.a2 {
    color: var(--warning);
}

.a3 {
    color: var(--text-muted);
}

.a4 {
    color: var(--success);
}

.a5 {
    color: var(--primary);
}

/* Footers/CTAs */
.save-result-action,
.consultation-action {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* Resume Banner */
.resume-banner {
    background: linear-gradient(135deg, var(--primary-light), #E9D5FF);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    animation: slideInRight 0.4s ease;
}

.resume-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.resume-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.resume-info {
    flex: 1;
}

.resume-title {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

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

.resume-actions {
    display: flex;
    gap: 0.75rem;
}

.resume-actions .btn {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

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

    .card {
        padding: 1.5rem;
    }

    .domains-overview {
        grid-template-columns: 1fr;
    }

    .likert-options {
        flex-direction: column;
    }

    .likert-btn {
        flex-direction: row;
        padding: 1rem;
        justify-content: flex-start;
    }

    .likert-btn .label {
        margin-left: 1rem;
        text-align: left;
    }
}