:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #10b981;
    --error: #ef4444;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Cairo', 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background: radial-gradient(circle at top left, #1e1b4b 0%, #0f172a 100%);
}

/* Background Glow Animation */
.bg-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
    animation: moveGlow 10s infinite alternate;
}

@keyframes moveGlow {
    from {
        transform: translate(-40%, -40%);
    }

    to {
        transform: translate(-60%, -60%);
    }
}

.container {
    width: 100%;
    max-width: 550px;
    padding: 20px;
    z-index: 1;
}

/* Card Transitions */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Icons & Header */
.icon-box {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 25px;
    box-shadow: 0 10px 20px var(--primary-glow);
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.6;
}

p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.quiz-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.quiz-info span {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-white);
}

.quiz-info i {
    color: var(--primary);
    margin-left: 8px;
}

/* Buttons */
/* Category Selection */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.category-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 25px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.category-card h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.category-card span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.category-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn {
    padding: 15px 35px;
    border-radius: 15px;
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:not(:disabled):hover {
    background: var(--primary);
}

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

/* Quiz UI Components */
.quiz-header {
    margin-bottom: 30px;
}

.progress-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

.header-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 5px 15px;
    border-radius: 10px;
    font-weight: bold;
}

.timer i {
    margin-left: 5px;
}

/* Options Container */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.option {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--border);
    padding: 15px 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
}

.option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.option.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--secondary) !important;
}

.option.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: var(--error) !important;
}

.option.disabled {
    cursor: default;
    opacity: 0.8;
}

/* Results UI */
.result-icon {
    font-size: 5rem;
    color: #fbbf24;
    margin-bottom: 20px;
}

.score-box {
    margin: 30px 0;
}

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

.score-circle small {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-white);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite ease-in-out;
}

/* Responsive */
@media (max-width: 480px) {
    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* ==================== Mobile Navigation & Controls ==================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, rgba(10, 10, 10, 0.95));
    padding: 15px 20px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 8px;
    border: 1px solid var(--border);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    color: var(--text-muted);
    background: none;
    border: none;
    font-size: 11px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: inherit;
}

.mobile-nav-item i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.15);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.4));
}

/* Quick Actions Bar */
.quick-actions {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    gap: 10px;
}

.quick-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    color: var(--text-white);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quick-action-btn:active {
    transform: scale(0.9);
    background: var(--primary);
}

/* Touch-friendly options */
@media (hover: none) and (pointer: coarse) {
    .option {
        min-height: 60px;
        font-size: 1.1rem;
        padding: 18px 25px;
    }
    
    .category-card {
        min-height: 150px;
    }
    
    .btn {
        min-height: 55px;
        font-size: 1.1rem;
    }
}

/* Mobile Layout */
@media (max-width: 768px) {
    .mobile-nav {
        display: block;
    }
    
    .quick-actions {
        display: flex;
    }
    
    .container {
        padding: 20px;
        padding-bottom: 120px;
    }
    
    .card {
        padding: 25px 20px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .option {
        font-size: 1rem;
        padding: 18px 20px;
    }
}
