/* Curriculum Page Specific Styles */

/* Container & Header */
.curriculum-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
}

/* Header Text Spacing Override */
.section-header h2 {
    margin-bottom: 20px !important;
    /* Reduce space below title */
}

.section-header .section-desc {
    margin-bottom: 0 !important;
    /* Remove space below description paragraph */
    line-height: 1.6 !important;
    /* Optimize line height */
}

.curriculum-table-header {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr 3fr;
    background: #3d4c9f;
    color: white;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    font-weight: 800;
    font-size: 1.2rem;
    padding: 25px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border: 2px solid #3d4c9f;
    position: sticky;
    top: 60px;
    /* Adjust based on header height */
    z-index: 50;
    margin-bottom: 5px;
}

.curriculum-table-header div {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.curriculum-table-header div:last-child {
    border-right: none;
}

/* Pair Group Style - The Big Container for Two Levels */
.curriculum-pair-group {
    display: grid;
    grid-template-columns: 4.7fr 3fr;
    /* 1.2+1.5+1+1 = 4.7fr for left, 3fr for right */
    background: #fff;
    margin-bottom: 5px;
    /* Spacing between pairs */
    border: 2px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    transition: transform 0.3s ease;
}

.curriculum-pair-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    z-index: 10;
}

/* Left Side (Level Info Columns) */
.curriculum-left-side {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
}

/* Partial Row for individual levels within the group */
.curriculum-row-partial {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr 1fr;
    /* Matches the first 4 columns of header */
    flex: 1;
    /* Take up half height each */
    min-height: 180px;
    /* Ensuring enough height */
    border-bottom: 1px solid #eee;
}

.curriculum-row-partial:last-child {
    border-bottom: none;
}

/* Right Side (Shared Content Column) */
.curriculum-right-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 30px;
}

/* Level Column (Leftmost) */
.level-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 900;
    font-size: 1.6rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    padding: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Level Colors */
.row-seed .level-col {
    background: #FF7043;
}

.row-starter .level-col {
    background: #FFCA28;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

.row-builder .level-col {
    background: #9CCC65;
}

.row-bridge .level-col {
    background: #29B6F6;
}

.row-explorer .level-col {
    background: #7E57C2;
}

.row-master .level-col {
    background: #EC407A;
}

/* Info Columns */
.info-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    /* Stretch children (groups) to full width */
    padding: 0;
    /* Remove padding to let groups fill the space */
    border-right: 1px solid #e0e0e0;
    font-size: 1.05rem;
    color: #333;
    background: #fff;
    /* Ensure changing background is handled correctly if odd/even rules exist */
}

.info-col>span {
    /* Direct children (single items without group wrapper) need centering */
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    /* Fill the column height */
    padding: 15px;
    /* Add lost padding back for single items */
}

.info-col:nth-child(even) {
    background: #fcfcfc;
}

.info-group {
    flex: 1;
    /* Equally divide height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding: 15px;
    /* Internal padding instead of margin */
    margin: 0;
    /* Remove external margin */
}

.info-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 15px;
    /* Keep consistent padding */
}

.info-group span:first-child {
    font-weight: 800;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
}

.info-group span:last-child {
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}

/* Content Area */
.book-display {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.book-cover {
    width: 180px;
    height: 260px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    transition: transform 0.3s;
}

.book-cover:hover {
    transform: translateY(-5px) scale(1.05);
}

.learning-points {
    list-style: none;
    padding: 0;
    margin: 0;
    width: fit-content;
    text-align: left;
}

.learning-points li {
    font-size: 1rem;
    color: #444;
    font-weight: 500;
    margin-bottom: 12px;
    position: relative;
    padding-left: 24px;
    line-height: 1.6;
}

.learning-points li i {
    position: absolute;
    left: 0;
    top: 4px;
    font-size: 1.1rem;
}

/* Tab Switcher Styles */
.curriculum-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.curriculum-tab-btn {
    padding: 15px 40px;
    font-size: 1.15rem;
    font-weight: 800;
    border: 2px solid #eee;
    background: #f8f9fa;
    color: #888;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.curriculum-tab-btn:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

.curriculum-tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(255, 114, 66, 0.3);
}

/* Tab Content Visibility */
.curriculum-tab-content {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.curriculum-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Academy Table Header Specifics */
.academy-header {
    grid-template-columns: 1.2fr 1.2fr 1.2fr 3fr 3fr !important;
    background: #3d4c9f !important;
    border-color: #3d4c9f !important;
    position: relative !important;
    top: 0 !important;
    margin-bottom: 10px !important;
}

/* Academy Level Row Layout */
.academy-level-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 1.2fr 3fr 3fr;
    background: white;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-height: 120px;
}

.academy-level-row:hover {
    transform: translateX(10px);
    border-color: #2b9acb;
    box-shadow: 0 10px 25px rgba(43, 154, 203, 0.1);
}

.academy-level-row>div {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    border-right: 1px solid #f0f0f0;
    font-size: 1rem;
    line-height: 1.6;
    word-break: keep-all;
}

.academy-level-row>div:last-child {
    border-right: none;
}

/* Academy Badge Styling (Course Column) */
.level-badge {
    flex-direction: column !important;
    color: white;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

.level-badge span {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 5px;
    text-shadow: none;
    display: block;
}

.level-grade,
.level-ar {
    font-weight: 800;
    color: #333;
    font-size: 1.1rem !important;
}

.level-goal,
.level-areas {
    text-align: left !important;
    justify-content: flex-start !important;
    font-weight: 500;
    color: #555;
}

/* Academy Specific Colors */
.level-soil .level-badge {
    background: #FFA726;
}

/* Soil: Orange */
.level-seed-ac .level-badge {
    background: #EF5350;
}

/* Seed: Red */
.level-bud .level-badge {
    background: #EC407A;
}

/* Bud: Pink */
.level-trunk .level-badge {
    background: #AB47BC;
}

/* Trunk: Purple */
.level-branch .level-badge {
    background: #5C6BC0;
}

/* Branch: Indigo */
.level-leaf .level-badge {
    background: #42A5F5;
}

/* Leaf: Blue */
.level-flower .level-badge {
    background: #26C6DA;
}

/* Flower: Cyan */
.level-fruit .level-badge {
    background: #66BB6A;
}

/* Fruit: Green */
.level-harvest .level-badge {
    background: #9CCC65;
}

/* Harvest: Lime */

/* Academy Bluebee Image */
.academy-bluebee-wrapper {
    display: flex;
    justify-content: flex-end;
    position: relative;
    margin-bottom: -3px;
    z-index: 60;
    margin-right: -40px;
    margin-top: -60px;
}

.academy-bluebee-img {
    width: 420px;
    height: auto;
    filter: drop-shadow(5px 10px 10px rgba(0, 0, 0, 0.1));
    transform: translateX(-20px);
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
    .curriculum-tab-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .curriculum-wrapper {
        padding: 0 15px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Keep the original table width and allow horizontal scroll edge-to-edge */
    .curriculum-tab-content {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        margin: 0 -15px;
        /* Pull it out to edges */
        padding: 0 15px 20px 15px;
    }

    /* Ensure tables have enough space so contents don't get crushed, but small enough to peek */
    .curriculum-table-header,
    .curriculum-pair-group,
    .academy-level-row,
    .academy-header {
        width: 950px !important;
        min-width: 950px !important;
        max-width: none !important;
    }

    /* Wrap the floating blue bee so it scrolls with the table */
    .curriculum-tab-content>div:first-child {
        width: 950px !important;
        min-width: 950px !important;
    }

    .book-cover {
        flex-shrink: 0;
        width: 160px !important;
        /* Slightly scale down books to fit safely */
        height: 231px !important;
    }

    /* Restore hidden columns since we have horizontal scroll now */
    .mb-hidden {
        display: flex !important;
    }

    /* Force strict column widths so individual row text won't distort the grid alignment */
    .curriculum-table-header:not(.academy-header) {
        grid-template-columns: 148px 185px 124px 124px 369px !important;
    }

    .curriculum-pair-group {
        grid-template-columns: 581px 369px !important;
    }

    .curriculum-row-partial {
        grid-template-columns: 148px 185px 124px 124px !important;
    }

    /* Override column heights and alignments for horizontal scroll */
    .academy-header,
    .academy-level-row {
        grid-template-columns: 120px 120px 120px 295px 295px !important;
    }

    /* Scale down the Blue Bee image on mobile, or hide it */
    .academy-bluebee-wrapper {
        display: none !important;
    }

    /* Wrap the floating blue bee so it scrolls with the table */
    .curriculum-tab-content>div:first-child.academy-bluebee-wrapper {
        display: none !important;
    }

    .academy-bluebee-img {
        display: none !important;
    }
}