/* Subjects page styles */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
}

/* Hero header — compact */
.subjects-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1.25rem 0 1rem;
    text-align: center;
}

.subjects-hero h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subjects-hero__sub {
    font-size: 0.92rem;
    opacity: 0.9;
    max-width: 540px;
    margin: 0 auto 0.75rem;
}

/* Quick action strip */
.subjects-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.subjects-actions .btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
}

.subjects-actions .btn-light {
    background: rgba(255,255,255,0.95);
    color: #4f46e5;
    border: none;
}

.subjects-actions .btn-light:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.subjects-actions .btn-outline-light {
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
    background: transparent;
}

.subjects-actions .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}

/* Main content area */
.subjects-main {
    background: #f8fafc;
    min-height: calc(100vh - 160px);
    padding: 1.5rem 0;
}

.subjects-main .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section header */
.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.35rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin: 0;
}

/* Two-column layout: tips sidebar + subjects grid */
.subjects-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Tips sidebar (left) */
.subjects-tips-sidebar {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.subjects-tips-sidebar h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.subjects-tips-sidebar .tip-card {
    background: #fff;
    border: 1px solid #f0f1f3;
    border-radius: 12px;
    padding: 1rem;
    text-align: left;
    transition: transform 0.2s;
}

.subjects-tips-sidebar .tip-card:hover {
    transform: translateY(-2px);
}

.subjects-tips-sidebar .tip-card i {
    font-size: 1.1rem;
    color: #4f46e5;
    margin-bottom: 0.4rem;
    display: block;
}

.subjects-tips-sidebar .tip-card h5 {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.2rem;
}

.subjects-tips-sidebar .tip-card p {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.4;
}

/* Subjects grid */
.subjects-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 100%;
    width: 100%;
    padding: 0;
}

.subject-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: fadeInCard 0.5s ease-out forwards;
    opacity: 0;
}

.subject-card {
    width: 100%;
    min-height: 150px;
    border-radius: 14px;
    padding: 1rem 1rem 0.85rem;
    background: #fff;
    color: #333;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f1f3;
    transition: all 0.25s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.subject-card:hover::before {
    opacity: 1;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.25);
}

.subject-icon {
    font-size: 2rem;
    margin-bottom: 0.4rem;
    opacity: 0.9;
}

.subject-card h3 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

/* Progress display */
.progress-container {
    width: 100%;
    margin-top: 0.5rem;
}

.progress-stats {
    font-size: 0.82rem;
    color: #555;
    text-align: center;
    line-height: 1.4;
    background: rgba(102, 126, 234, 0.06);
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.loading-progress {
    font-size: 0.82rem;
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    color: #999;
}


/* Empty / error states */
.loading-message,
.error-message,
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.error-message {
    color: #ef4444;
}

.subject-exam-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
}

.subject-exam-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

/* Animations */
@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1000px) {
    .subjects-layout {
        grid-template-columns: 1fr;
    }

    .subjects-tips-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .subjects-tips-sidebar h3 {
        width: 100%;
    }

    .subjects-tips-sidebar .tip-card {
        flex: 1;
        min-width: 200px;
    }

    .subjects-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .subjects-hero {
        padding: 2rem 0 1.5rem;
    }

    .subjects-hero h1 {
        font-size: 1.7rem;
    }

    .subjects-actions {
        flex-direction: column;
        align-items: center;
    }

    .subjects-tips-sidebar .tip-card {
        min-width: 100%;
    }
}

@media (max-width: 600px) {
    .subjects-container {
        grid-template-columns: 1fr;
    }
}
