/* ==========================================================================
   CSS Variables & Tokens
   ========================================================================== */
:root {
    /* Colors */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-secondary: #ec4899;
    --color-bg-start: #0f172a;
    --color-bg-end: #312e81;
    --color-glass: rgba(255, 255, 255, 0.08);
    --color-glass-border: rgba(255, 255, 255, 0.15);
    --color-text: #f8fafc;
    --color-text-muted: #cbd5e1;
    
    /* Specific Colors */
    --color-hbo: #10b981;
    --color-wo: #8b5cf6;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* Spacing & Layout */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Global Resets
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg-start);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* ==========================================================================
   Animated Background
   ========================================================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end), #1e1b4b);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -2;
}

.background-animation::before, .background-animation::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: floatBlob 20s infinite alternate;
}

.background-animation::before {
    background: var(--color-primary);
    top: 10%;
    left: 10%;
}

.background-animation::after {
    background: var(--color-secondary);
    bottom: 10%;
    right: 10%;
    animation-delay: -5s;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.2); }
}

/* ==========================================================================
   Glassmorphism Containers
   ========================================================================== */
.app-container {
    width: 90%;
    max-width: 800px;
    min-height: 500px;
    margin: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--color-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 3rem;
}

.glass-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

/* ==========================================================================
   Screens & Transitions
   ========================================================================== */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
    flex: 1;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

p {
    line-height: 1.6;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: white;
    padding: 1rem 2rem;
    border-radius: 999px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Quiz Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.option-btn:active {
    transform: translateX(2px) scale(0.98);
}

.option-btn.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--color-primary);
}

/* ==========================================================================
   Quiz Layout & Progress
   ========================================================================== */
.quiz-header {
    margin-bottom: 2rem;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#question-counter {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.question-container {
    flex: 1;
}

/* ==========================================================================
   Results Layout
   ========================================================================== */
.results-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

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

.level-bar-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.level-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.level-bar-bg {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

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

.hbo-fill { background: var(--color-hbo); }
.wo-fill { background: var(--color-wo); }

.level-score {
    align-self: flex-end;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.domain-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.domain-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-primary);
    animation: fadeIn 0.5s ease backwards;
}

.domain-info h4 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.domain-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.domain-score {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-primary);
}

.results-actions {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Responsiveness
   ========================================================================== */
@media (max-width: 600px) {
    .glass-panel {
        padding: 2rem 1.5rem;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    .primary-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Marketing Funnel
   ========================================================================== */
.marketing-block {
    margin-top: 1rem;
    padding: 2rem;
}

.special-highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(236, 72, 153, 0.3);
    position: relative;
    overflow: hidden;
}

.special-highlight::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
}

.marketing-content h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.marketing-content p {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.marketing-content .results-actions {
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}
