/* =========================================
   1. Reset & Base Styles
   ========================================= */
body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: var(--primary-gradient);
}

.h2 {
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 30px;
}

/* =========================================
   2. Stats & Progress
   ========================================= */
.progress-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.time-display-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.overall-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--primary-gradient);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* =========================================
   3. Subject Groups
   ========================================= */
.subject-stats {
    margin: 20px 0;
}

.subject-group-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 25px 0 15px 0;
    font-size: 1.3em;
    color: var(--text-main);
}

.group-progress {
    font-weight: normal;
    margin-left: auto;
}

.subject-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.subject-card {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    background: white;
}

/* =========================================
   4. Collapsible Components
   ========================================= */
.collapse-btn {
    width: 100%;
    padding: 15px 20px;
    background: #f8f9fa;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.collapse-btn:hover {
    background: #e9ecef;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    width: 100px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
}

.progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-gradient);
    padding: 5px 15px;
    border-radius: 20px;
    color: white;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.progress-value {
    font-weight: 500;
}

.progress-percent {
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
}

.progress-badge[data-rate="low"] {
    background: var(--rate-low-bg);
}

.progress-badge[data-rate="medium"] {
    background: var(--rate-medium-bg);
}

.progress-badge[data-rate="high"] {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.progress-badge[data-rate="complete"] {
    background: var(--rate-complete-bg);
}

.collapse-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
    display: none;
}

.collapse-content.active {
    display: block;
}

/* =========================================
   5. Lesson Grid
   ========================================= */
.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
}

.lesson-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.lesson-item:hover {
    background: #f8f9fa;
}

.lesson-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.lesson-item input[type="checkbox"]:checked+label {
    text-decoration: line-through;
    color: #6c757d;
}

.collapse-arrow {
    transition: transform 0.3s ease;
}

.collapse-arrow.rotated {
    transform: rotate(180deg);
}

.review-section {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.review-title {
    font-weight: bold;
    color: var(--accent-red);
    margin-bottom: 10px;
}

/* =========================================
   6. Media Queries
   ========================================= */
@media (max-width: 768px) {
    .subject-row {
        flex-direction: column;
    }
}