/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #064e3b, #0f172a);
    background-size: 400% 400%;
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    animation: gradientShift 15s ease infinite;
}

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

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Glassmorphism Card Styles */
.start-card,
.quiz-card,
.result-card,
.report-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    transition: all 0.3s ease;
}

/* Start Screen Styles */
.start-card {
    text-align: center;
}

.start-card h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
}

/* Button Styles */
.primary-btn,
.secondary-btn,
.next-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #0f172a;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn:hover,
.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 222, 128, 0.3);
}

.secondary-btn {
    background: transparent;
    color: #4ade80;
    border: 2px solid #4ade80;
}

.secondary-btn:hover {
    background: rgba(74, 222, 128, 0.1);
    transform: translateY(-2px);
}

.next-btn {
    margin-top: 2rem;
    width: 100%;
}

/* Progress Section */
.progress-section {
    margin-bottom: 2rem;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.timer-display {
    color: #f59e0b;
    font-weight: 600;
    animation: timerPulse 1s ease infinite;
}

.timer-display.warning {
    color: #ef4444;
    animation: timerWarning 0.5s ease infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes timerWarning {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-fill.timer-warning {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    animation: progressPulse 1s ease infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Question Section */
.question-section h2 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
    line-height: 1.4;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4ade80;
    transform: translateX(5px);
}

.option.correct {
    background: rgba(74, 222, 128, 0.2);
    border-color: #4ade80;
    animation: correctPulse 0.6s ease;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

.option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

@keyframes correctPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Explanation Section */
.explanation-section {
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.explanation-section.show {
    opacity: 1;
    transform: translateY(0);
}

.explanation-content {
    background: rgba(74, 222, 128, 0.1);
    border-left: 4px solid #4ade80;
    padding: 1.5rem;
    border-radius: 8px;
}

.explanation-content h3 {
    color: #4ade80;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.explanation-content p {
    color: #cbd5e1;
    font-size: 0.95rem;
}

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

.result-card h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-display {
    margin-bottom: 2rem;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 0.5rem;
}

.score-total {
    font-size: 1.5rem;
    color: #64748b;
}

.percentage {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.performance-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.performance-message.excellent {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.performance-message.good {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.performance-message.needs-practice {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.result-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Report Section */
.report-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.report-section.show {
    opacity: 1;
    visibility: visible;
}

.report-card {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.close-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
    background: rgba(239, 68, 68, 0.1);
}

.report-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #64748b;
}

.report-item.correct {
    border-left-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.report-item.incorrect {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.report-question {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #f1f5f9;
}

.report-answer {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.report-answer.correct {
    color: #4ade80;
}

.report-answer.incorrect {
    color: #ef4444;
}

.report-explanation {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #4ade80;
    opacity: 0.8;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.skip-btn {
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #1f2937;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.3);
}

.skip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(250, 204, 21, 0.4);
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.skip-btn:active {
    transform: translateY(0);
}

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

.submit-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Report Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.stats-cards {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.stat-card.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stat-card.skipped {
    border-color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.chart-container {
    max-width: 300px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Report Item Skipped Style */
.report-item.skipped {
    border-left: 5px solid #facc15;
    background: rgba(250, 204, 21, 0.05);
}

.report-item.skipped .report-answer {
    color: #facc15;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .start-card,
    .quiz-card,
    .result-card,
    .report-card {
        padding: 25px;
    }
    
    .start-card h1,
    .result-card h2 {
        font-size: 2rem;
    }
    
    .question-section h2 {
        font-size: 1.2rem;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
    
    .result-buttons {
        flex-direction: column;
    }
    
    .primary-btn,
    .secondary-btn,
    .next-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .start-card,
    .quiz-card,
    .result-card,
    .report-card {
        padding: 20px;
    }
    
    .start-card h1,
    .result-card h2 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .question-section h2 {
        font-size: 1.1rem;
    }
    
    .option {
        padding: 12px 16px;
    }
    
    .score-number {
        font-size: 2rem;
    }
    
    .performance-message {
        font-size: 1.1rem;
    }
}
