/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Particles Background Animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    top: 80%;
    left: 20%;
    animation-delay: 1s;
}

.particle:nth-child(3) {
    top: 40%;
    left: 70%;
    animation-delay: 2s;
}

.particle:nth-child(4) {
    top: 60%;
    left: 90%;
    animation-delay: 3s;
}

.particle:nth-child(5) {
    top: 10%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.score-display, .question-counter {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

.label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

#score, #current-question, #total-questions {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Welcome Card */
.welcome-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.welcome-card p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.feature {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn.primary {
    background: linear-gradient(135deg, #FF6B6B, #FFD93D);
    color: #333;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Timer */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.timer-circle {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin-bottom: 15px;
    animation: timerPulse 1s ease-in-out infinite;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.timer-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.timer-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #FF6B6B, #FFD93D);
    width: 100%;
    transition: width 1s linear;
}

@keyframes timerPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

/* Question Card */
.question-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: cardSlide 0.5s ease;
}

@keyframes cardSlide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-text {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 500;
    line-height: 1.5;
}

/* Answers */
.answers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.answer-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.answer-btn:hover::before {
    left: 100%;
}

.answer-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.answer-btn.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    animation: correctPulse 0.6s ease;
}

.answer-btn.wrong {
    background: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
    animation: wrongShake 0.6s ease;
}

.answer-btn.disabled {
    pointer-events: none;
    opacity: 0.7;
}

@keyframes correctPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes wrongShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Feedback */
.feedback {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    animation: feedbackSlide 0.5s ease;
}

@keyframes feedbackSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.feedback.wrong {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 2px solid rgba(244, 67, 54, 0.3);
}

/* Results Card */
.results-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.results-card h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.final-score {
    margin-bottom: 30px;
}

.score-circle {
    display: inline-block;
    width: 150px;
    height: 150px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    margin: 0 auto;
    animation: scoreReveal 1s ease;
}

#final-score {
    font-size: 3rem;
    font-weight: 700;
    color: #FFD93D;
}

.out-of {
    font-size: 1.2rem;
    opacity: 0.7;
}

@keyframes scoreReveal {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.performance-message {
    font-size: 1.3rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.results-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    min-width: 120px;
}

.stat-label {
    display: block;
    opacity: 0.8;
    margin-bottom: 5px;
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Review Screen */
.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
    flex-wrap: wrap;
    gap: 20px;
}

.review-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

.review-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    color: white;
}

.review-question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #FFD93D;
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.review-answer {
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

.review-answer.user-correct {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid rgba(76, 175, 80, 0.5);
}

.review-answer.user-wrong {
    background: rgba(244, 67, 54, 0.2);
    border: 2px solid rgba(244, 67, 54, 0.5);
}

.review-answer.correct-answer {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.review-result {
    font-weight: 600;
    font-size: 1.1rem;
}

.review-result.correct {
    color: #4CAF50;
}

.review-result.wrong {
    color: #f44336;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .features {
        flex-direction: column;
        gap: 15px;
    }
    
    .question-text {
        font-size: 1.3rem;
    }
    
    .answers-container {
        grid-template-columns: 1fr;
    }
    
    .results-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .review-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .welcome-card, .question-card, .results-card {
        padding: 25px;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    #final-score {
        font-size: 2.5rem;
    }
    
    .timer-circle {
        width: 60px;
        height: 60px;
    }
    
    .timer-display {
        font-size: 1.2rem;
    }
}
