/* ========================================
   STUDIQ GAMES - PLAY & EARN STYLES
   Gamification with animations
======================================== */

:root {
    --primary: #C6A7FF;
    --secondary: #6C63FF;
    --success: #66ffb2;
    --danger: #ff79da;
    --warning: #ffd600;
    --dark: #1a1a2e;
    --light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Navbar Styles */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(198, 167, 255, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: rgba(198, 167, 255, 0.2);
    transform: translateY(-2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(198, 167, 255, 0.5);
}

.user-xp {
    background: linear-gradient(135deg, #ffd600, #ff9100);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
    animation: glow-pulse 2s ease-in-out infinite;
}

.xp-icon {
    font-size: 1.3rem;
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-section h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* XP Info Banner */
.xp-info-banner {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.info-item {
    background: rgba(198, 167, 255, 0.15);
    border: 2px solid var(--primary);
    padding: 1rem 2rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(198, 167, 255, 0.25);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(198, 167, 255, 0.4);
}

.info-icon {
    font-size: 1.5rem;
}

/* Class Selection Grid */
.class-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.class-card {
    background: linear-gradient(135deg, rgba(198, 167, 255, 0.2), rgba(108, 99, 255, 0.2));
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* Removed shimmer effect - was too distracting */

.class-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 60px rgba(198, 167, 255, 0.6);
    border-color: var(--success);
}

.class-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.class-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.class-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-slide-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: rgba(255, 121, 218, 0.2);
    border: 2px solid var(--danger);
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

/* Subject Grid */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: linear-gradient(135deg, rgba(102, 255, 178, 0.2), rgba(72, 219, 251, 0.2));
    border: 2px solid var(--success);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subject-card:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(102, 255, 178, 0.5);
}

.subject-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Quiz Container */
.quiz-container {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(22, 33, 62, 0.9));
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 2rem;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.quiz-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.stat-item {
    background: rgba(198, 167, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
}

.quit-btn {
    background: rgba(255, 121, 218, 0.2);
    border: 2px solid var(--danger);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quit-btn:hover {
    background: var(--danger);
    transform: scale(1.05);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--primary));
    width: 10%;
    transition: width 0.5s ease;
}

/* Question Container */
.question-container {
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.option-btn {
    background: rgba(198, 167, 255, 0.15);
    border: 2px solid var(--primary);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover {
    background: rgba(198, 167, 255, 0.3);
    transform: translateX(10px);
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--success);
}

.option-btn.correct {
    background: linear-gradient(135deg, var(--success), #48dbfb);
    border-color: var(--success);
    animation: tada 0.6s ease;
}

.option-btn.wrong {
    background: linear-gradient(135deg, var(--danger), #ff6b9d);
    border-color: var(--danger);
    animation: shake 0.5s ease;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Next Button */
.next-btn-container {
    text-align: center;
}

.next-btn {
    background: linear-gradient(135deg, var(--success), #48dbfb);
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.next-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 255, 178, 0.5);
}

.next-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Results Modal */
.results-content {
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

.score-display {
    margin-bottom: 2rem;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 40px rgba(198, 167, 255, 0.6);
    animation: elastic-bounce 0.8s ease;
}

.xp-earned {
    background: rgba(255, 214, 0, 0.15);
    border: 2px solid var(--warning);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.xp-animation {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--warning);
    margin-bottom: 1rem;
    animation: heartbeat 1s ease infinite;
}

.xp-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.results-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Powerup Selection Modal Styles */
.powerups-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.powerup-option {
    background: linear-gradient(135deg, rgba(198, 167, 255, 0.1), rgba(108, 99, 255, 0.1));
    border: 2px solid rgba(198, 167, 255, 0.3);
    border-radius: 1rem;
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.powerup-option:hover {
    transform: translateY(-5px);
    border-color: #C6A7FF;
    box-shadow: 0 10px 30px rgba(198, 167, 255, 0.4);
}

.powerup-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.powerup-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #C6A7FF;
}

.activate-powerup-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #66ffb2, #48dbfb);
    border: none;
    border-radius: 0.75rem;
    color: #0a1929;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.activate-powerup-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 255, 178, 0.5);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-secondary {
    background: rgba(198, 167, 255, 0.2);
    border: 2px solid var(--primary);
    color: white;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(198, 167, 255, 0.5);
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 4rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.leaderboard-item {
    background: rgba(198, 167, 255, 0.1);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateX(10px);
    background: rgba(198, 167, 255, 0.2);
}

.leaderboard-item.top3 {
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.2), rgba(255, 145, 0, 0.2));
    border-color: var(--warning);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-rank {
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    text-align: center;
}

.player-name {
    font-size: 1.2rem;
}

.player-xp {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--warning);
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .welcome-section h1 {
        font-size: 2rem;
    }
    
    .xp-info-banner {
        gap: 1rem;
    }
    
    .class-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .quiz-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========================================
   FULLSCREEN MODE ENHANCEMENTS
   Immersive gaming experience
======================================== */

/* Fullscreen enhancements */
:fullscreen,
:-webkit-full-screen,
:-moz-full-screen,
:-ms-fullscreen {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
}

:fullscreen .main-container,
:-webkit-full-screen .main-container,
:-moz-full-screen .main-container,
:-ms-fullscreen .main-container {
    padding: 1rem;
    max-width: 100%;
}

:fullscreen .navbar,
:-webkit-full-screen .navbar,
:-moz-full-screen .navbar,
:-ms-fullscreen .navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
}

:fullscreen .quiz-container,
:-webkit-full-screen .quiz-container,
:-moz-full-screen .quiz-container,
:-ms-fullscreen .quiz-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Fullscreen button hover effect */
#fullscreen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(198,167,255,0.4);
    border-color: #C6A7FF;
}

/* Fix cursor issue - only apply custom cursor in specific contexts, not globally */
.quiz-container {
    cursor: default;
}

.class-card,
.option-btn,
.btn-primary,
.btn-secondary,
button {
    cursor: pointer;
}

/* Ensure no cursor conflicts */
body {
    cursor: default;
}
