/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    text-align: center;
    padding: 50px 20px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.attempts-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: 2px solid white;
    font-weight: bold;
}

.attempts-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.score-btn {
    position: absolute;
    top: 20px;
    right: 230px;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: 2px solid white;
    font-weight: bold;
}

.score-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.home-header-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: 2px solid white;
    font-weight: bold;
}

.home-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.home-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
    border: 2px solid white;
    font-weight: bold;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.subject-card {
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
}

.subject-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.subject-card .icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.subject-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Individual subject card colors */
.subjects-grid .subject-card:nth-child(1) {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
}

.subjects-grid .subject-card:nth-child(2) {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.subjects-grid .subject-card:nth-child(3) {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
}

.subjects-grid .subject-card:nth-child(4) {
    background: linear-gradient(135deg, #fd79a8, #e84393);
}

.subjects-grid .subject-card:nth-child(5) {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.topic-card {
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: white;
}

.topic-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* Individual topic card colors */
.topics-grid .topic-card:nth-child(1) {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
}

.topics-grid .topic-card:nth-child(2) {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.topics-grid .topic-card:nth-child(3) {
    background: linear-gradient(135deg, #d299c2, #fef9d7);
}

.topics-grid .topic-card:nth-child(4) {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.topics-grid .topic-card:nth-child(5) {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.topics-grid .topic-card:nth-child(6) {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.topics-grid .topic-card:nth-child(7) {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.topics-grid .topic-card:nth-child(8) {
    background: linear-gradient(135deg, #a8c0ff, #3f2b96);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background 0.3s;
}

.btn:hover {
    background: #5a6fd8;
}

.quiz-btn {
    background: #28a745;
}

.quiz-btn:hover {
    background: #218838;
}

.back-btn {
    display: inline-block;
    margin-top: 10px;
    color: white;
    text-decoration: underline;
}

/* Reading Section */
.reading-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.reading-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.reading-section ul {
    list-style-type: disc;
    padding-left: 20px;
}

.reading-section li {
    margin-bottom: 10px;
}

/* Quiz Styles */
.quiz-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.timer-display {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s;
}

#question-number {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    color: #333;
    font-weight: bold;
}

.question-container {
    margin-bottom: 30px;
}

.question-container h2 {
    margin-bottom: 20px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.options label {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.options label:hover {
    background: #e9e9e9;
}

.options input[type="radio"] {
    margin-right: 10px;
}

.navigation {
    text-align: center;
}

.navigation button {
    padding: 10px 20px;
    margin: 0 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.navigation button:hover:not(:disabled) {
    background: #5a6fd8;
}

.navigation button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.result-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.result-container h2 {
    margin-bottom: 20px;
}

.result-container p {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.review-question {
    text-align: left;
    margin-bottom: 15px;
}

.review-question p {
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    .attempts-btn {
        right: 10px;
    }
    .score-btn {
        right: 130px;
    }
}

/* Score Dashboard Styles */
.score-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.stats-summary {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.stats-summary h2 {
    margin-bottom: 20px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: white;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0 0 0;
}

.scores-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.scores-list h2 {
    margin-bottom: 20px;
    color: #333;
}

.score-table {
    width: 100%;
    border-collapse: collapse;
}

.score-table thead {
    background: #667eea;
    color: white;
}

.score-table th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.score-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.score-table tbody tr:hover {
    background: #f5f5f5;
}

.subject-stats {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.subject-stats h2 {
    margin-bottom: 20px;
    color: #333;
}

.subject-wise-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.subject-stat-card {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    border-radius: 10px;
    padding: 20px;
    color: white;
}

.subject-stat-card h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.subject-stat-card p {
    margin-bottom: 8px;
}

.action-buttons {
    text-align: center;
    padding: 20px;
}

.action-buttons button {
    padding: 12px 30px;
    margin: 0 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.action-buttons button:hover {
    background: #5a6fd8;
}