/* CBSE Class 10 Social Science - Styles */

:root {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fbbf24;
    --secondary-color: #1e293b;
    --accent-color: #fef3c7;
    --text-color: #334155;
    --text-light: #64748b;
    --background: #fffbeb;
    --card-bg: #ffffff;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --history-color: #dc2626;
    --geography-color: #059669;
    --civics-color: #7c3aed;
    --economics-color: #2563eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

/* Subject Navigation Bar */
.subject-nav {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #334155 100%);
    padding: 0.5rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: var(--shadow);
}

.subject-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subject-nav-label {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.subject-links {
    display: flex;
    gap: 0.5rem;
}

.subject-link {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.subject-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.subject-link.active {
    background: var(--primary-color);
    color: #fff;
}

.subject-link i {
    font-size: 0.9rem;
}

/* Main Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.nav-toggle {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Sections */
.section {
    display: none;
    padding: 7rem 2rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
}

.section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.section-header h2 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 4rem;
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero h1 i {
    margin-right: 0.5rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

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

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-hint {
    background: var(--accent-color);
    color: var(--primary-dark);
}

.btn-hint:hover {
    background: #fde68a;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-card:nth-child(1) .feature-icon { background: linear-gradient(135deg, var(--history-color), #fca5a5); }
.feature-card:nth-child(2) .feature-icon { background: linear-gradient(135deg, var(--geography-color), #6ee7b7); }
.feature-card:nth-child(3) .feature-icon { background: linear-gradient(135deg, var(--civics-color), #c4b5fd); }
.feature-card:nth-child(4) .feature-icon { background: linear-gradient(135deg, var(--economics-color), #93c5fd); }

.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.feature-icon i {
    font-size: 2rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--text-light);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 1rem;
}

/* Chapters Grid */
.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.chapter-card.history { border-left-color: var(--history-color); }
.chapter-card.geography { border-left-color: var(--geography-color); }
.chapter-card.civics { border-left-color: var(--civics-color); }
.chapter-card.economics { border-left-color: var(--economics-color); }

.chapter-number {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.chapter-card.history .chapter-number { background: #fef2f2; color: var(--history-color); }
.chapter-card.geography .chapter-number { background: #ecfdf5; color: var(--geography-color); }
.chapter-card.civics .chapter-number { background: #f5f3ff; color: var(--civics-color); }
.chapter-card.economics .chapter-number { background: #eff6ff; color: var(--economics-color); }

.chapter-title {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.chapter-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.chapter-topics {
    font-size: 0.85rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

/* Practice Section */
.practice-controls {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-group label {
    font-weight: 500;
    color: var(--text-color);
}

.control-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.practice-stats {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.stat-item i {
    color: var(--primary-color);
}

.progress-bar-container {
    flex: 1;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 5px;
    transition: width 0.5s ease;
    width: 0%;
}

.problem-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.problem-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-light);
}

.problem-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.problem-number {
    font-weight: 600;
    color: var(--text-color);
}

.problem-subject {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.problem-subject.history { background: #fef2f2; color: var(--history-color); }
.problem-subject.geography { background: #ecfdf5; color: var(--geography-color); }
.problem-subject.civics { background: #f5f3ff; color: var(--civics-color); }
.problem-subject.economics { background: #eff6ff; color: var(--economics-color); }

.problem-question h3 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.problem-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: var(--primary-color);
    background: var(--accent-color);
}

.option.selected {
    border-color: var(--primary-color);
    background: var(--accent-color);
}

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

.option.incorrect {
    border-color: var(--error-color);
    background: #fee2e2;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-color);
}

.option.selected .option-letter {
    background: var(--primary-color);
    color: white;
}

.option.correct .option-letter {
    background: var(--success-color);
    color: white;
}

.option.incorrect .option-letter {
    background: var(--error-color);
    color: white;
}

.problem-hint {
    background: var(--accent-color);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.problem-hint i {
    font-size: 1.25rem;
}

.problem-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.problem-explanation {
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.problem-explanation h4 {
    color: var(--success-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.problem-explanation p {
    color: var(--text-color);
}

/* Results */
.results-container {
    text-align: center;
    padding: 2rem;
}

.results-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 3rem;
}

.result-excellent .results-icon {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.result-good .results-icon {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.result-average .results-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.result-needs-work .results-icon {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}

.results-container h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.results-score {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.results-percentage {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.results-message {
    color: var(--text-color);
    margin-bottom: 2rem;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-large {
    max-width: 900px;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--text-color);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
}

#chapter-content h2,
#timeline-content h2,
#map-content h2 {
    font-size: 1.75rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#chapter-content h2 i,
#timeline-content h2 i,
#map-content h2 i {
    color: var(--primary-color);
}

.chapter-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.chapter-section {
    margin-bottom: 1.5rem;
}

.chapter-section h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chapter-section h3 i {
    color: var(--primary-color);
}

.topics-list,
.key-points-list,
.events-list {
    list-style: none;
}

.topics-list li,
.key-points-list li,
.events-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-color);
}

.topics-list li i {
    color: var(--success-color);
    margin-top: 0.25rem;
}

.key-points-list li i {
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.events-list li i {
    color: var(--history-color);
    margin-top: 0.25rem;
}

.chapter-actions,
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--card-bg);
}

.timeline-date {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.timeline-description {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Map Skills */
.map-info {
    background: var(--accent-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.map-locations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.location-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
}

.location-name {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.location-type {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Important Dates Section */
.important-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.date-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 1rem;
    border-left: 3px solid var(--history-color);
}

.date-year {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--history-color);
}

.date-event {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .subject-nav {
        padding: 0.5rem 1rem;
    }

    .subject-nav-label {
        display: none;
    }

    .subject-link span {
        display: none;
    }

    .subject-link {
        padding: 0.5rem;
    }

    .subject-link i {
        font-size: 1.1rem;
    }

    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .section {
        padding: 7rem 1rem 2rem;
    }

    .hero {
        padding: 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .practice-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .chapters-grid {
        grid-template-columns: 1fr;
    }

    .results-score {
        font-size: 2.5rem;
    }
}
