/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
   :root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    
    --success: #10b981;
    --error: #ef4444;
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* Domains Colors */
    --c-iad: #3b82f6; /* Blue */
    --c-cc:  #8b5cf6; /* Purple */
    --c-ccd: #ec4899; /* Pink */
    --c-seg: #10b981; /* Green */
    --c-pro: #f59e0b; /* Yellow */
}

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

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

/* Background animated gradient */
.background-animation {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
    z-index: -1;
    animation: bgPulse 10s infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* ==========================================================================
   Layout & Screens
   ========================================================================== */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    position: relative;
}

.screen {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}
.screen.active {
    display: block;
}

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

/* ==========================================================================
   Components: Glass Card
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

/* ==========================================================================
   Typography & Elements
   ========================================================================== */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

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

.icon-container {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.categories-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: #334155;
    border: 1px solid rgba(255,255,255,0.2);
}

.badge-iad { background: var(--c-iad); }
.badge-cc  { background: var(--c-cc); }
.badge-ccd { background: var(--c-ccd); }
.badge-seg { background: var(--c-seg); }
.badge-pro { background: var(--c-pro); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

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

/* ==========================================================================
   Quiz Screen Elements
   ========================================================================== */
.quiz-card {
    text-align: left;
}

.progress-wrapper {
    margin-bottom: 20px;
}
.progress-bar-container {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ec4899);
    width: 0%;
    transition: width 0.3s ease;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 30px;
}

.option-btn {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 1rem;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    font-family: inherit;
}
.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.option-btn.selected {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.quiz-footer {
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   Result Screen Elements
   ========================================================================== */
.result-card {
    text-align: center;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glass-bg), transparent);
    border: 4px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

#score-text {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
}
.total-score {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-top: 20px;
}

#feedback-message {
    color: var(--primary);
    margin-bottom: 10px;
}

.review-list {
    margin-top: 30px;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 10px;
}
/* Scrollbar custom */
.review-list::-webkit-scrollbar { width: 6px; }
.review-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 10px; }
.review-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }


.review-item {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid transparent;
}
.review-item h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}
.review-item .your-ans,
.review-item .correct-ans {
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.review-item.correct {
    border-left-color: var(--success);
}
.review-item.incorrect {
    border-left-color: var(--error);
}
.text-success { color: var(--success); font-weight: 600; }
.text-error { color: var(--error); font-weight: 600; }

/* Responsive */
@media (max-width: 600px) {
    .glass-card { padding: 30px 20px; }
    h1 { font-size: 2rem; }
    .score-circle { width: 120px; height: 120px; }
    #score-text { font-size: 3rem; }
}
