/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

.nav-brand i {
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.search-container {
    position: relative;
}

.search-container input {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    placeholder-color: rgba(255,255,255,0.7);
    width: 250px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    outline: none;
    background: rgba(255,255,255,0.3);
    width: 300px;
}

.search-container input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-back {
    background: #6c757d;
    color: white;
    padding: 0.5rem 1rem;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.math-animation {
    position: relative;
    width: 300px;
    height: 300px;
}

.floating-formula {
    position: absolute;
    background: rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    animation: float 6s ease-in-out infinite;
}

.floating-formula:nth-child(1) {
    top: 20px;
    left: 50px;
    animation-delay: 0s;
}

.floating-formula:nth-child(2) {
    top: 120px;
    right: 30px;
    animation-delay: 2s;
}

.floating-formula:nth-child(3) {
    bottom: 50px;
    left: 30px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Chapters Section */
.chapters-section {
    padding: 80px 0;
    background: white;
}

.chapters-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.chapter-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.chapter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.chapter-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.chapter-icon i {
    font-size: 1.5rem;
    color: white;
}

.chapter-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.chapter-card p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}

/* Chapter Content Section */
.chapter-content-section {
    padding: 100px 0 80px;
    background: white;
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.chapter-header h2 {
    font-size: 2.5rem;
    color: #333;
}

.content-navigation {
    margin-bottom: 2rem;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
}

.tab-button {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.content-area {
    min-height: 400px;
    padding: 2rem 0;
}

.content-navigation-bottom {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

/* Quiz Section */
.quiz-section {
    padding: 80px 0;
    background: #f8fafc;
}

.quiz-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-type-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.quiz-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.quiz-type-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.quiz-type-card p {
    color: #666;
    margin-bottom: 2rem;
}

/* Quiz Container */
.quiz-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    overflow-y: auto;
}

.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.quiz-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

/* Progress Section */
.progress-section {
    padding: 80px 0;
    background: white;
}

.progress-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.progress-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.progress-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.progress-card h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.circular-progress {
    display: flex;
    justify-content: center;
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(white 0deg, rgba(255,255,255,0.3) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: absolute;
}

.progress-percentage {
    font-size: 1.5rem;
    font-weight: 600;
    z-index: 1;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 10px;
}

.stat-item i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

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

.chapter-progress-list {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 15px;
}

.chapter-progress-list h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        order: 3;
        gap: 1rem;
    }
    
    .search-container input {
        width: 200px;
    }
    
    .search-container input:focus {
        width: 220px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-overview {
        grid-template-columns: 1fr;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .content-navigation-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .chapters-section h2,
    .quiz-section h2,
    .progress-section h2 {
        font-size: 2rem;
    }
    
    .chapter-card,
    .quiz-type-card {
        padding: 1.5rem;
    }
    
    .quiz-content {
        padding: 1rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Content Styling */
.content-section {
    margin-bottom: 2rem;
}

.content-section h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.formula-box {
    background: #f8fafc;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
}

.example-box {
    background: #e8f5e8;
    border-left: 4px solid #28a745;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0 10px 10px 0;
}

.note-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}

.interactive-element {
    background: white;
    border: 2px solid #667eea;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.interactive-element:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Question Styles */
.question-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

.question-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.question-type {
    background: #e8f5e8;
    color: #28a745;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #333;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.option:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.option.correct {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.2);
}

.option.incorrect {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.2);
}

.option-letter {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.option.correct .option-letter {
    background: #28a745;
}

.option.incorrect .option-letter {
    background: #dc3545;
}

.explanation {
    background: #f8fafc;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 0 10px 10px 0;
    display: none;
}

.explanation.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

.explanation h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

/* Essay Question Styles */
.essay-input {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.essay-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Loading and Error States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #c3e6cb;
}

