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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    padding: 20px;
    padding-bottom: 80px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

.subject-selection-screen {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: fadeIn 0.6s ease;
}

.subject-selection-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #60a5fa;
}

.subject-selection-screen p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 40px;
    line-height: 1.6;
}

.subject-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.subject-card {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 15px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-5px);
    border-color: #60a5fa;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.subject-card:hover::before {
    transform: scaleX(1);
}

.subject-card.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.subject-card.selected::before {
    transform: scaleX(1);
}

.subject-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.subject-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f1f5f9;
}

.subject-info {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 5px;
}

.mode-selection-screen {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: fadeIn 0.6s ease;
}

.mode-selection-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #60a5fa;
}

.mode-selection-screen p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 40px;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.mode-card {
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
}

.mode-card.review-mode:hover {
    border-color: #22c55e;
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.3);
}

.mode-card.quiz-mode:hover {
    border-color: #60a5fa;
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.3);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.mode-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #f1f5f9;
}

.mode-card.review-mode .mode-name {
    color: #22c55e;
}

.mode-card.quiz-mode .mode-name {
    color: #60a5fa;
}

.mode-description {
    color: #cbd5e1;
    margin-bottom: 20px;
    font-size: 1rem;
}

.mode-features {
    text-align: left;
    list-style: none;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.8;
}

.review-screen {
    animation: fadeIn 0.6s ease;
}

.review-header-section {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 30px;
}

.review-header-section h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, #22c55e 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.review-header-section p {
    color: #94a3b8;
    font-size: 1rem;
}

.search-container {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.search-info {
    color: #94a3b8;
    font-size: 0.9rem;
}

.review-questions-container {
    margin-bottom: 30px;
}

.review-question-item {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: fadeIn 0.5s ease;
}

.review-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.review-question-number {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
}

.review-question-text {
    font-size: 1.15rem;
    margin-bottom: 20px;
    line-height: 1.7;
    color: #f1f5f9;
}

.review-options-list {
    margin-bottom: 15px;
}

.review-option-item {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.review-option-item.correct-answer {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.review-option-letter {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.review-option-item.correct-answer .review-option-letter {
    background: #22c55e;
}

.review-option-check {
    color: #22c55e;
    font-size: 1.3rem;
    font-weight: bold;
    margin-left: auto;
}

.review-explanation-box {
    background: rgba(59, 130, 246, 0.12);
    border-left: 4px solid #60a5fa;
    border-radius: 10px;
    padding: 15px 20px;
    margin-top: 15px;
    color: #cbd5e1;
    line-height: 1.7;
}

.review-explanation-box strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 8px;
}

.toggle-answer-btn {
    padding: 10px 20px;
    border: 2px solid #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.toggle-answer-btn:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: scale(1.05);
}

.toggle-answer-btn.hide {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toggle-answer-btn.hide:hover {
    background: rgba(239, 68, 68, 0.25);
}

.review-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 30px 0;
}

.selected-subject-info {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid #60a5fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.selected-subject-info h3 {
    color: #60a5fa;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.start-screen {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: fadeIn 0.6s ease;
}

.start-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #60a5fa;
}

.start-screen p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    line-height: 1.6;
}

.settings {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.settings label {
    display: block;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
}

.settings input {
    width: 100%;
    padding: 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.settings input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
    border-color: #60a5fa;
}

.quiz-screen {
    animation: fadeIn 0.6s ease;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.progress-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.question-counter {
    background: rgba(30, 41, 59, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.timer {
    background: linear-gradient(135deg, #ef4444 0%, #f59e0b 100%);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    transition: width 0.5s ease;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.question-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #f1f5f9;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    background: rgba(15, 23, 42, 0.6);
    padding: 18px 25px;
    border-radius: 12px;
    border: 2px solid rgba(148, 163, 184, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    background: rgba(51, 65, 85, 0.6);
    border-color: #60a5fa;
    transform: translateX(5px);
}

.option-letter {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.result-screen {
    animation: fadeIn 0.6s ease;
}

.result-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px 40px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 30px;
}

.result-score {
    font-size: 5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-align: center;
}

.result-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #cbd5e1;
    text-align: center;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.9rem;
}

.correct-stat .stat-value {
    color: #22c55e;
}

.incorrect-stat .stat-value {
    color: #ef4444;
}

.time-stat .stat-value {
    color: #f59e0b;
}

.review-section {
    margin-top: 40px;
}

.review-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #60a5fa;
    text-align: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
}

.review-question {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    border: 3px solid rgba(148, 163, 184, 0.2);
    animation: fadeIn 0.5s ease;
}

.review-question.correct-answer {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.review-question.incorrect-answer {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.review-number {
    font-weight: 600;
    color: #94a3b8;
    font-size: 1.1rem;
}

.review-status {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.review-status.correct {
    background: #22c55e;
    color: white;
}

.review-status.incorrect {
    background: #ef4444;
    color: white;
}

.review-question-text {
    font-size: 1.15rem;
    margin-bottom: 20px;
    line-height: 1.7;
    color: #f1f5f9;
    font-weight: 500;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.review-option {
    padding: 15px 20px;
    border-radius: 10px;
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.review-option.correct-option {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
}

.review-option.wrong-option {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.review-option-icon {
    font-size: 1.3rem;
    font-weight: bold;
    min-width: 25px;
}

.review-option.correct-option .review-option-icon {
    color: #22c55e;
}

.review-option.wrong-option .review-option-icon {
    color: #ef4444;
}

.review-explanation {
    margin-top: 20px;
    padding: 18px;
    background: rgba(59, 130, 246, 0.12);
    border-left: 5px solid #60a5fa;
    border-radius: 10px;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.7;
}

.review-explanation strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 8px;
}

.result-actions {
    text-align: center;
    margin-top: 30px;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    padding: 15px 20px;
    text-align: center;
    z-index: 1000;
}

.footer p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

.footer a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.footer a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

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

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

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .subject-selection-screen,
    .start-screen,
    .mode-selection-screen {
        padding: 40px 20px;
    }

    .subject-cards {
        grid-template-columns: 1fr;
    }

    .mode-cards {
        grid-template-columns: 1fr;
    }

    .question-card {
        padding: 25px;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .result-score {
        font-size: 3.5rem;
    }

    .quiz-controls,
    .review-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .review-question,
    .review-question-item {
        padding: 20px;
    }

    .search-box {
        flex-direction: column;
    }
}

.hidden {
    display: none !important;
}