/* Global Styles */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white: #ffffff;
    --gray: #6c757d;
    --light-gray: #f1f1f1;
    --timer-color: #ff6b6b;
    --correct-bg: rgba(40, 167, 69, 0.1);
    --wrong-bg: rgba(220, 53, 69, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #6852c9;
    color: #333;
    line-height: 1.6;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screen {
    display: none;
    background-color: var(--white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

h1, h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

p {
    color: var(--gray);
    margin-bottom: 30px;
    text-align: center;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(74, 107, 255, 0.3);
}

.btn:hover {
    background-color: #3a5bef;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 107, 255, 0.4);
}

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

.btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-btn {
    background-color: var(--secondary-color);
    margin-top: 20px;
}

.back-btn:hover {
    background-color: #5a6268;
}

/* Welcome Screen Styles */
.welcome-screen {
    text-align: center;
}

.welcome-icon {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

.start-btn {
    margin: 0 auto;
}

/* Category Screen Styles */
.categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.category {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.category i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.category:nth-child(1) i { color: #e34c26; } /* HTML */
.category:nth-child(2) i { color: #264de4; } /* CSS */
.category:nth-child(3) i { color: #f0db4f; } /* JS */
.category:nth-child(4) i { color: #61dbfb; } /* React */
.category:nth-child(5) i { color: #68a063; } /* Express */
.category:nth-child(6) i { color: #4db33d; } /* MongoDB */

.category span {
    font-weight: 600;
    color: var(--dark-color);
}

/* Question Count Screen Styles */
.question-counts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.count-option {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.count-option:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Quiz Screen Styles */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.quiz-info {
    display: flex;
    flex-direction: column;
}

.category-name, .question-count {
    font-size: 14px;
    color: var(--gray);
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--timer-color);
}

.question-container {
    margin-bottom: 30px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.5;
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.option {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    font-weight: 500;
}

.option:hover {
    background-color: #e9ecef;
}

.option.correct {
    background-color: var(--correct-bg);
    border-color: var(--success-color);
    color: var(--success-color);
}

.option.wrong {
    background-color: var(--wrong-bg);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.quiz-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

.next-btn {
    min-width: 180px;
}

/* Results Screen Styles */
.results-content {
    text-align: center;
}

.result-icon {
    font-size: 80px;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.score-container {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(var(--success-color) 0%, var(--light-gray) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    background-color: var(--white);
    border-radius: 50%;
}

.score-text {
    position: relative;
    z-index: 1;
    font-size: 36px;
    font-weight: 700;
}

.correct-answers {
    color: var(--success-color);
}

.total-questions {
    color: var(--dark-color);
}

.score-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.detail {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.detail.correct {
    border-top: 4px solid var(--success-color);
}

.detail.wrong {
    border-top: 4px solid var(--danger-color);
}

.detail.accuracy {
    border-top: 4px solid var(--info-color);
}

.detail-label {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 5px;
}

.detail-value {
    font-size: 20px;
    font-weight: 700;
}

.correct-count {
    color: var(--success-color);
}

.wrong-count {
    color: var(--danger-color);
}

.accuracy-percent {
    color: var(--info-color);
}

.feedback-message {
    margin: 30px 0;
    padding: 20px;
    border-radius: 10px;
    background-color: var(--light-color);
    font-size: 18px;
    font-weight: 500;
}

.stars {
    color: var(--warning-color);
    font-size: 24px;
    margin-top: 10px;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.restart-btn {
    background-color: var(--primary-color);
}

.home-btn {
    background-color: var(--secondary-color);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question-counts {
        grid-template-columns: 1fr;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }
    
    .result-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    .categories {
        grid-template-columns: 1fr;
    }
    
    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .next-btn {
        width: 100%;
    }
}

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

.pulse {
    animation: pulse 1.5s infinite;
}

.time-warning {
    animation: pulse 0.5s infinite;
}