/* ==================== STUDY HUB STYLES ==================== */

.subjects-grid, .tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.subject-card, .test-subject {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.subject-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s ease;
}

.test-subject .subject-header {
    background: linear-gradient(135deg, #f6ad55 0%, #f687b3 100%);
}

.subject-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.subject-header h2 { margin: 0; font-size: 1.5rem; }

.expand-icon { transition: transform 0.3s ease; font-size: 1rem; }

.subject-content, .papers-list {
    padding: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 3000px; }
}

.exam-type h3 {
    margin: 1rem 0;
    color: #2d3748;
    font-size: 1.2rem;
    border-left: 4px solid #667eea;
    padding-left: 1rem;
}

.topics-list { display: flex; flex-direction: column; gap: 1rem; }

.topic-item {
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: start;
    background: #f7fafc;
}

.topic-item:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.topic-item h4 { margin: 0 0 0.5rem 0; color: #2d3748; font-size: 1.1rem; }
.topic-item p  { margin: 0; color: #718096; font-size: 0.95rem; }
.topic-arrow   { color: #667eea; font-size: 1.5rem; margin-left: 1rem; }

/* Topic Detail */
.topic-detail {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: #edf2f7;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: #667eea;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-btn:hover { background: #667eea; color: white; }

.topic-header { margin-bottom: 2rem; text-align: center; }
.topic-header h1 { font-size: 2.5rem; color: #2d3748; margin: 0; }
.topic-header p  { font-size: 1.1rem; color: #718096; margin-top: 0.5rem; }

.sections-nav { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }

.section-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #4a5568;
}

.section-btn:hover { border-color: #667eea; color: #667eea; }
.section-btn.active { background: #667eea; color: white; border-color: #667eea; }

.section-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-content h2 { margin-top: 0; color: #2d3748; margin-bottom: 1.5rem; }
.intro-section p { font-size: 1.1rem; line-height: 1.8; color: #4a5568; }

.formulas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.formula-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.formula-math {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    word-break: break-word;
}

.formula-explanation { margin: 0; font-size: 1rem; }

.steps-list { display: flex; flex-direction: column; gap: 1rem; }
.step { display: flex; gap: 1rem; align-items: start; }

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.step p { margin: 0; color: #4a5568; font-size: 1.05rem; line-height: 1.6; }

/* Practice questions */
.practice-section { margin-top: 2rem; }
.questions-container { display: flex; flex-direction: column; gap: 2rem; }

.question-card {
    border: 2px solid #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    background: #f7fafc;
}

.question-card h3 { margin: 0 0 1.5rem 0; color: #2d3748; font-size: 1.1rem; }
.options { display: flex; flex-direction: column; gap: 1rem; }

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover { background: #edf2f7; }
.option input { cursor: pointer; }

.submit-btn, .retry-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover, .retry-btn:hover { transform: translateY(-2px); }

.results { margin-top: 2rem; }

.score-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 2rem;
}

.score { font-size: 3rem; font-weight: bold; margin: 0; }
.percentage { font-size: 1.5rem; margin: 0.5rem 0 0 0; opacity: 0.9; }

.result-item {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #cbd5e0;
    background: #f7fafc;
    border-radius: 6px;
}

.result-item.correct   { border-left-color: #48bb78; background: #f0fff4; }
.result-item.incorrect { border-left-color: #f56565; background: #fff5f5; }
.result-item h4 { margin: 0 0 0.5rem 0; color: #2d3748; }
.result-item p  { margin: 0.5rem 0; color: #4a5568; }

.explanation {
    margin-top: 1rem !important;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    color: #667eea;
}

/* Past papers */
.paper-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.paper-card:hover { border-color: #f6ad55; background: #fffaf0; }
.paper-info { flex: 1; min-width: 200px; }
.paper-info h3 { margin: 0 0 0.5rem 0; color: #2d3748; font-size: 1.1rem; }
.paper-details { margin: 0; color: #718096; font-size: 0.95rem; }

.download-btn {
    background: linear-gradient(135deg, #f6ad55 0%, #f687b3 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    transition: transform 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover { transform: translateY(-2px); }

.info-box {
    background: #edf2f7;
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin-top: 2rem;
}

.info-box h3 { margin-top: 0; color: #2d3748; }
.info-box ul { margin: 1rem 0; padding-left: 1.5rem; }
.info-box li { margin: 0.5rem 0; color: #4a5568; }

/* Progress page */
.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.card h3 { margin: 1rem 0; color: #2d3748; font-size: 1.1rem; }
.big-number { font-size: 2rem; font-weight: bold; color: #667eea; margin: 0.5rem 0; }
.card-subtitle { font-size: 0.9rem; color: #718096; margin: 0; }

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
}

.stats-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-section h2 { margin-top: 0; color: #2d3748; margin-bottom: 2rem; }

.subject-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.subject-stat { display: flex; flex-direction: column; align-items: center; }
.subject-stat h4 { margin: 0 0 1rem 0; color: #2d3748; }
.perf-value { font-size: 3rem; color: #667eea; font-weight: bold; }

.hidden-view { display: none !important; }
.study-hub-subtitle { font-size: 1.1rem; color: #718096; margin-bottom: 2rem; }

@media (max-width: 768px) {
    .subjects-grid, .tests-grid { grid-template-columns: 1fr; }
    .sections-nav { flex-direction: column; }
    .section-btn { width: 100%; }
    .paper-card { flex-direction: column; align-items: flex-start; }
    .download-btn { width: 100%; text-align: center; }
}