/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 25%, #fecfef 50%, #a8edea 75%, #fed6e3 100%);
    min-height: 100vh;
    background-attachment: fixed;
}

header {
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00, #32cd32, #1e90ff, #9370db);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #ff1493;
}

header h1 {
    text-align: center;
    padding: 1rem;
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    background: linear-gradient(45deg, #ff4500, #ff6347, #ffa07a);
    border-radius: 0 0 15px 15px;
}

nav li {
    margin: 0 1rem;
}

nav a {
    display: block;
    padding: 1rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s ease;
}

nav a:hover, nav a.active {
    background: #4a5568;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.8), rgba(255, 165, 0, 0.8), rgba(255, 255, 0, 0.8));
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Subject Grid */
.subjects h2 {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.subject-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #ff6b6b, #ffa500) border-box;
}

.subject-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: linear-gradient(white, white) padding-box,
                linear-gradient(45deg, #ffff00, #32cd32) border-box;
}

.subject-card h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.subject-card p {
    color: #718096;
}

/* Mock Test Button */
.mock-test {
    text-align: center;
    margin: 3rem 0;
}

.mock-test-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00, #32cd32, #1e90ff, #9370db);
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.mock-test-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
    animation: none;
    background: linear-gradient(45deg, #ff1493, #ff69b4, #ffb6c1);
}

/* Subject Header */
.subject-header {
    text-align: center;
    margin-bottom: 3rem;
}

.subject-header h2 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Topic Grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.topic-card {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: 2px solid #fd79a8;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #fdcb6e, #e17055);
}

.topic-card h3 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

/* Topic Header */
.topic-header {
    text-align: center;
    margin-bottom: 3rem;
}

.topic-header h2 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Reading Section */
.reading-section {
    background: linear-gradient(135deg, #a8edea, #fed6e3, #d299c2, #fef9d7);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 3px solid #ff9ff3;
}

.reading-section h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.reading-content {
    color: #4a5568;
    line-height: 1.8;
}

/* Quiz Section */
.quiz-section {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: white;
    border: 3px solid #00d2d3;
}

.quiz-section h3 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.quiz-info p {
    font-weight: 600;
    color: #2d3748;
}

.progress-bar {
    width: 200px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(45deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.3s ease;
}

/* Question Styles */
.question {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0, #fd79a8, #fdcb6e);
    border-radius: 10px;
    border-left: 5px solid #ff6b6b;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question h4 {
    color: black;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    border-radius: 8px;
    border: 2px solid #ffb6c1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: #ff69b4;
    background: linear-gradient(45deg, #ffe4e1, #e6e6fa);
    transform: scale(1.02);
}

.option input[type="radio"] {
    margin-right: 1rem;
}

.option label {
    cursor: pointer;
    flex: 1;
    color: black;
    font-weight: 500;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00, #32cd32);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
    display: block;
    margin: 2rem auto 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.4);
    animation: none;
}

/* Results Section */
.results {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: white;
    border: 3px solid #00d2d3;
}

.results h3 {
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    border-radius: 10px;
    border-left: 5px solid #48bb78;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-item.incorrect {
    border-left-color: #f56565;
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
}

.result-item h4 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.user-answer, .correct-answer {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
}

.user-answer.correct {
    background: #c6f6d5;
    color: #22543d;
}

.user-answer.incorrect {
    background: #fed7d7;
    color: #742a2a;
}

.correct-answer {
    background: #c6f6d5;
    color: #22543d;
}

.explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: #edf2f7;
    border-radius: 5px;
    color: #4a5568;
}

/* Restart Button */
.restart-btn {
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    display: block;
    margin: 2rem auto 0;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    animation: none;
}

/* Footer */
footer {
    background: linear-gradient(45deg, #ff6b6b, #ffa500, #ffff00, #32cd32, #1e90ff, #9370db);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 3rem;
    border-top: 3px solid #ff1493;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }

    .subject-grid, .topic-grid {
        grid-template-columns: 1fr;
    }

    .subject-card, .topic-card {
        padding: 1.5rem;
    }

    .quiz-info {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .progress-bar {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
    }

    nav li {
        margin: 0;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .subjects h2, .subject-header h2, .topic-header h2 {
        font-size: 2rem;
    }

    .subject-card h3, .topic-card h3 {
        font-size: 1.3rem;
    }

    .mock-test-btn, .submit-btn, .restart-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}