/* ============================================
   GRADE 1 MATH - FUN & COLORFUL THEME
   ============================================ */

.g1math-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Comic Sans MS', 'Chalkboard', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(180deg, #e8f4fc 0%, #fff9e6 100%);
    min-height: 100vh;
}

/* Header Section */
.g1math-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 25px;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    position: relative;
}

.g1math-title {
    color: #fff;
    font-size: 32px;
    font-weight: bold;
    text-shadow: 3px 3px 0 #5a67d8, 4px 4px 8px rgba(0,0,0,0.2);
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.g1math-subtitle {
    color: #fff;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin: 0;
}

.g1math-icons {
    font-size: 28px;
    margin-top: 10px;
}

/* Breadcrumb */
.g1math-breadcrumb {
    text-align: center;
    margin-bottom: 25px;
    font-size: 14px;
    color: #666;
}

.g1math-breadcrumb a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.g1math-breadcrumb a:hover {
    text-decoration: underline;
}

.g1math-breadcrumb .separator {
    margin: 0 8px;
    color: #764ba2;
}

/* Unit Section */
.g1math-unit {
    background: #fff;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 3px solid transparent;
}

.g1math-unit:nth-child(16n+1) { border-color: #667eea; }
.g1math-unit:nth-child(16n+2) { border-color: #f093fb; }
.g1math-unit:nth-child(16n+3) { border-color: #4facfe; }
.g1math-unit:nth-child(16n+4) { border-color: #43e97b; }
.g1math-unit:nth-child(16n+5) { border-color: #fa709a; }
.g1math-unit:nth-child(16n+6) { border-color: #fee140; }
.g1math-unit:nth-child(16n+7) { border-color: #30cfd0; }
.g1math-unit:nth-child(16n+8) { border-color: #a8edea; }
.g1math-unit:nth-child(16n+9) { border-color: #ff9a9e; }
.g1math-unit:nth-child(16n+10) { border-color: #fbc2eb; }
.g1math-unit:nth-child(16n+11) { border-color: #a18cd1; }
.g1math-unit:nth-child(16n+12) { border-color: #fad0c4; }
.g1math-unit:nth-child(16n+13) { border-color: #84fab0; }
.g1math-unit:nth-child(16n+14) { border-color: #8fd3f4; }
.g1math-unit:nth-child(16n+15) { border-color: #d299c2; }
.g1math-unit:nth-child(16n+16) { border-color: #6a11cb; }

/* Unit Header */
.unit-header {
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
}

.g1math-unit:nth-child(16n+1) .unit-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.g1math-unit:nth-child(16n+2) .unit-header { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.g1math-unit:nth-child(16n+3) .unit-header { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.g1math-unit:nth-child(16n+4) .unit-header { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.g1math-unit:nth-child(16n+5) .unit-header { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.g1math-unit:nth-child(16n+6) .unit-header { background: linear-gradient(135deg, #fee140 0%, #fa709a 100%); }
.g1math-unit:nth-child(16n+7) .unit-header { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.g1math-unit:nth-child(16n+8) .unit-header { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.g1math-unit:nth-child(16n+9) .unit-header { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.g1math-unit:nth-child(16n+10) .unit-header { background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); }
.g1math-unit:nth-child(16n+11) .unit-header { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.g1math-unit:nth-child(16n+12) .unit-header { background: linear-gradient(135deg, #fad0c4 0%, #ffd1ff 100%); }
.g1math-unit:nth-child(16n+13) .unit-header { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }
.g1math-unit:nth-child(16n+14) .unit-header { background: linear-gradient(135deg, #8fd3f4 0%, #84fab0 100%); }
.g1math-unit:nth-child(16n+15) .unit-header { background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%); }
.g1math-unit:nth-child(16n+16) .unit-header { background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); }

.unit-icon {
    font-size: 36px;
    background: rgba(255,255,255,0.3);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unit-info {
    flex: 1;
}

.unit-number {
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.unit-title {
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    margin: 0;
}

.unit-title a {
    color: #fff;
    text-decoration: none;
}

.unit-title a:hover {
    text-decoration: underline;
}

.unit-count {
    background: rgba(255,255,255,0.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

/* Lesson List */
.lesson-list {
    padding: 15px 25px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.lesson-item {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border-left: 4px solid #ddd;
}

.g1math-unit:nth-child(16n+1) .lesson-item { border-left-color: #667eea; }
.g1math-unit:nth-child(16n+2) .lesson-item { border-left-color: #f093fb; }
.g1math-unit:nth-child(16n+3) .lesson-item { border-left-color: #4facfe; }
.g1math-unit:nth-child(16n+4) .lesson-item { border-left-color: #43e97b; }
.g1math-unit:nth-child(16n+5) .lesson-item { border-left-color: #fa709a; }
.g1math-unit:nth-child(16n+6) .lesson-item { border-left-color: #fee140; }
.g1math-unit:nth-child(16n+7) .lesson-item { border-left-color: #30cfd0; }
.g1math-unit:nth-child(16n+8) .lesson-item { border-left-color: #a8edea; }
.g1math-unit:nth-child(16n+9) .lesson-item { border-left-color: #ff9a9e; }
.g1math-unit:nth-child(16n+10) .lesson-item { border-left-color: #fbc2eb; }
.g1math-unit:nth-child(16n+11) .lesson-item { border-left-color: #a18cd1; }
.g1math-unit:nth-child(16n+12) .lesson-item { border-left-color: #fad0c4; }
.g1math-unit:nth-child(16n+13) .lesson-item { border-left-color: #84fab0; }
.g1math-unit:nth-child(16n+14) .lesson-item { border-left-color: #8fd3f4; }
.g1math-unit:nth-child(16n+15) .lesson-item { border-left-color: #d299c2; }
.g1math-unit:nth-child(16n+16) .lesson-item { border-left-color: #6a11cb; }

.lesson-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
}

.lesson-link:hover {
    background: #fff;
}

.g1math-unit:nth-child(16n+1) .lesson-link:hover { color: #667eea; }
.g1math-unit:nth-child(16n+2) .lesson-link:hover { color: #f093fb; }
.g1math-unit:nth-child(16n+3) .lesson-link:hover { color: #4facfe; }
.g1math-unit:nth-child(16n+4) .lesson-link:hover { color: #38c96a; }
.g1math-unit:nth-child(16n+5) .lesson-link:hover { color: #fa709a; }
.g1math-unit:nth-child(16n+6) .lesson-link:hover { color: #e6a800; }
.g1math-unit:nth-child(16n+7) .lesson-link:hover { color: #30cfd0; }
.g1math-unit:nth-child(16n+8) .lesson-link:hover { color: #7ed6d3; }
.g1math-unit:nth-child(16n+9) .lesson-link:hover { color: #ff9a9e; }
.g1math-unit:nth-child(16n+10) .lesson-link:hover { color: #d9a3d0; }
.g1math-unit:nth-child(16n+11) .lesson-link:hover { color: #a18cd1; }
.g1math-unit:nth-child(16n+12) .lesson-link:hover { color: #e0b0a8; }
.g1math-unit:nth-child(16n+13) .lesson-link:hover { color: #5dce88; }
.g1math-unit:nth-child(16n+14) .lesson-link:hover { color: #6bbce0; }
.g1math-unit:nth-child(16n+15) .lesson-link:hover { color: #c080a8; }
.g1math-unit:nth-child(16n+16) .lesson-link:hover { color: #6a11cb; }

.lesson-number {
    background: #e9ecef;
    color: #666;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.lesson-text {
    flex: 1;
    line-height: 1.4;
}

/* Footer Box */
.g1math-footer-box {
    background: #fff;
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
    color: #444;
    text-align: center;
    border: 3px solid #667eea;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.g1math-footer-box h3 {
    font-size: 22px;
    margin: 0 0 15px 0;
    color: #667eea;
}

.g1math-footer-box p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.6;
}

.g1math-footer-box .emoji-row {
    font-size: 30px;
    margin-top: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .g1math-container {
        padding: 15px;
    }
    
    .g1math-title {
        font-size: 24px;
    }
    
    .g1math-subtitle {
        font-size: 14px;
    }
    
    .unit-header {
        padding: 15px 18px;
        gap: 12px;
    }
    
    .unit-icon {
        font-size: 28px;
        width: 45px;
        height: 45px;
    }
    
    .unit-title {
        font-size: 16px;
    }
    
    .unit-count {
        display: none;
    }
    
    .lesson-list {
        padding: 12px 15px 15px;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .lesson-link {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .g1math-header {
        padding: 20px 15px;
    }
    
    .g1math-title {
        font-size: 20px;
    }
    
    .g1math-icons {
        font-size: 24px;
    }
    
    .unit-title {
        font-size: 15px;
    }
    
    .unit-number {
        font-size: 11px;
    }
}
/* Lesson toggle button */
.lesson-toggle {
    margin-left: auto;
    font-size: 20px;
    font-weight: bold;
    transition: transform 0.3s;
}

.lesson-link {
    cursor: pointer;
}

/* Submenu (hidden by default) */
.lesson-submenu {
    display: none;
    padding: 8px 15px 12px 55px;
    background: #fff;
}

.lesson-submenu.active {
    display: block;
}

.submenu-link {
    display: block;
    padding: 8px 12px;
    margin: 4px 0;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.submenu-link:hover {
    background: #e9ecef;
    padding-left: 16px;
}

/* Rotate toggle icon when active */
.lesson-item.active .lesson-toggle {
    transform: rotate(45deg);
}