/* ==========================================================================
   부가학습 페이지 스타일
   ========================================================================== */

/* 학습 헤더 */
.learning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.learning-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #121212;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.learning-title i {
    color: #8105ED;
}

.view-guide {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #8105ed;
    border-radius: 50px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #8105ed;
    text-decoration: none;
    transition: background 0.2s;
}

.view-guide i {
    font-size: 18px;
}

.view-guide:hover {
    background: rgba(129, 5, 237, 0.05);
    text-decoration: none;
    color: #8105ed;
}

/* ==========================================================================
   탭 버튼 (tabs.css 오버라이드)
   ========================================================================== */

.learning-tabs {
    margin-bottom: 24px;
    border: 2px solid #8105ed;
    border-radius: 50px;
    padding: 0;
    display: flex;
    gap: 0;
}

.learning-tabs .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    font-family: 'Jua', sans-serif;
    font-size: 18px !important;
    color: #121212;
    padding: 16px 20px !important;
    border-radius: 50px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.learning-tabs .tab-btn.active {
    background: #8105ed;
    color: white;
    border-radius: 50px !important;
}

.learning-tabs .tab-btn:hover:not(.active) {
    background: rgba(129, 5, 237, 0.1);
}

/* 필터 버튼 */
.learning-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #808080;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #8105ED;
    color: white;
    border-color: #8105ED;
}

.filter-btn:hover:not(.active) {
    background: #f8f8f8;
    border-color: #8105ED;
}

/* 학습 콘텐츠 영역 */
.learning-content {
    min-height: 400px;
}

/* 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.empty-character {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F3F3;
    border-radius: 50%;
}

.empty-character i {
    font-size: 48px;
    color: #D9D9D9;
}

.empty-character img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.empty-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    color: #808080;
    margin: 0;
}

/* 학습 리스트 */
.learning-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==========================================================================
   학습 카드 — Figma 디자인 기반
   모든 셀렉터에 .learning-card 스코프 적용 (theme.css 충돌 방지)
   ========================================================================== */

.learning-card {
    background: white;
    border: 1.5px solid #d9d9d9;
    border-radius: 20px;
    padding: 17.5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.25s ease;
}

.learning-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* 카드 헤더 — 배경 흰색, 여백 없음 */
.learning-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 10px 0;
    margin: 0;
    border-bottom: 1px solid #d9d9d9;
    background: white;
}

.learning-card .card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #121212;
}

.learning-card .header-label {
    font-weight: 400;
}

.learning-card .header-value {
    font-weight: 700;
}

.learning-card .header-type {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(129, 5, 237, 0.05);
    color: #8105ed;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 400;
}

/* 상태 텍스트 */
.learning-card .card-status-badge {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #8105ed;
}

/* 강의 정보 — 수직 중앙 정렬 */
.learning-card .card-class-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

/* 썸네일 (교재 이미지 — 직사각형 라운드 박스) */
.learning-card .class-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d9d9d9;
    background: #f3f3f3;
}

.learning-card .class-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 강사 아바타 — 원형, 수직 중앙 */
.learning-card .teacher-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d9d9d9;
    background: #f3f3f3;
    margin: 0;
}

/* 강의 상세 */
.learning-card .class-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* 강사명 + 태그 줄 */
.learning-card .class-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.learning-card .class-title {
    font-family: 'Noto Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #121212;
    margin: 0;
    line-height: 1.4;
}

.learning-card .subject-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(129, 5, 237, 0.05);
    color: #8105ed;
    padding: 4px 6px;
    border-radius: 50px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

/* 메타 정보 (교재명, 시간, 기간) */
.learning-card .class-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.learning-card .meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 12px;
    color: #121212;
}

.learning-card .meta-row i {
    font-size: 10px;
    color: #999;
    width: 12px;
    text-align: center;
}

.learning-card .meta-text {
    font-weight: 400;
}

/* 구분선 */
.learning-card .card-divider {
    width: 100%;
    height: 1px;
    background: #d9d9d9;
}

/* 결제 정보 — 한 줄 인라인 */
.learning-card .card-payment-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
    align-items: center;
}

.learning-card .payment-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #121212;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.learning-card .payment-label {
    font-weight: 700;
}

.learning-card .payment-value {
    font-weight: 400;
}

/* 버튼 영역 */
.learning-card .card-buttons {
    display: flex;
    gap: 10px;
}

.learning-card .card-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.learning-card .card-btn-outline {
    background: white;
    border: 1px solid #8105ed;
    color: #8105ed;
}

.learning-card .card-btn-outline:hover {
    background: #8105ed;
    color: white;
}

.learning-card .card-btn-disabled {
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
    color: #bbb;
    cursor: not-allowed;
}

.learning-card .card-btn-disabled:hover {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #bbb;
}

/* ==========================================================================
   복습관리(AI) 탭
   ========================================================================== */

/* 레벨 네비게이션 */
.review-level-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 0 8px;
}

.level-range-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 13px;
    color: #999;
}

.level-nav-control {
    display: flex;
    align-items: center;
    gap: 20px;
}

.level-nav-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.level-nav-btn:hover:not(:disabled) {
    background: rgba(129, 5, 237, 0.08);
}

.level-nav-btn:disabled {
    color: #d9d9d9;
    cursor: not-allowed;
}

.level-grade {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #121212;
}

/* AI 복습평가 버튼 */
.review-action-bar {
    display: flex;
    justify-content: center;
    padding: 8px 0 20px;
}

.review-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 32px;
    background: linear-gradient(135deg, #f5a623, #f7c948);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.review-cta-btn:hover {
    background: linear-gradient(135deg, #e6951a, #f5b92e);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 166, 35, 0.45);
    text-decoration: none;
    transform: translateY(-1px);
}

/* 레벨 카드 그리드 */
.review-level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 0 20px;
}

/* 레벨 카드 — Figma 기반 */
.level-card {
    background: white;
    border: 1px solid #d9d9d9;
    border-radius: 20px;
    padding: 17px 21px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.level-card:hover {
    box-shadow: 0 6px 36px rgba(0, 0, 0, 0.14);
}

/* 레벨 뱃지 — Figma: 보라 테두리 pill, 흰배경, 보라 텍스트 */
.level-card .level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border: 1px solid #8105ed;
    border-radius: 50px;
    font-family: 'Jua', sans-serif;
    font-size: 20px;
    color: #8105ed;
    background: white;
    white-space: nowrap;
}

/* 점수 영역 */
.level-scores {
    display: flex;
    gap: 16px;
    width: 100%;
}

.score-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.score-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #121212;
    font-weight: 700;
    text-align: center;
}

/* 점수 뱃지 — 별(톱니) 모양, Figma 디자인 */
.score-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Jua', sans-serif;
    font-size: 20px;
    position: relative;
}

/* 별(톱니바퀴) 모양 배경 — CSS clip-path */
.score-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(
        50% 0%, 63% 8%, 78% 2%, 83% 18%, 98% 22%, 93% 38%,
        100% 50%, 93% 63%, 98% 78%, 83% 83%, 78% 98%, 63% 93%,
        50% 100%, 37% 93%, 22% 98%, 17% 83%, 2% 78%, 7% 63%,
        0% 50%, 7% 38%, 2% 22%, 17% 18%, 22% 2%, 37% 8%
    );
}

.score-badge span {
    position: relative;
    z-index: 1;
}

.score-high::before {
    background: #f5a623;
}
.score-high {
    color: white;
}

.score-mid::before {
    background: #f5a623;
}
.score-mid {
    color: white;
}

.score-low::before {
    background: #ff5252;
}
.score-low {
    color: white;
}

.score-none::before {
    background: #e8e8e8;
}
.score-none {
    color: #bbb;
    font-size: 14px;
}

/* 반응형 — 복습관리 */
@media (max-width: 768px) {
    .review-level-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .level-grade {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .review-level-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .level-card {
        padding: 16px 12px;
    }

    .score-badge {
        width: 48px;
        height: 48px;
        font-size: 12px;
    }
}

/* ==========================================================================
   페이지네이션
   ========================================================================== */

.learning-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: #8105ED;
    color: #8105ED;
}

.page-num {
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.page-num:hover {
    border-color: #8105ED;
    color: #8105ED;
}

.page-num.active {
    background: #8105ED;
    border-color: #8105ED;
    color: white;
}

/* ==========================================================================
   반응형 디자인
   ========================================================================== */

@media (max-width: 834px) {
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
        border-radius: 16px;
    }

    .learning-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .learning-title {
        font-size: 20px;
    }

    .learning-card .card-class-info {
        gap: 10px;
    }

    .learning-card .class-thumbnail {
        width: 70px;
        height: 52px;
    }

    .learning-card .teacher-avatar {
        width: 44px;
        height: 44px;
    }

    .learning-card .card-payment-info {
        gap: 10px;
    }

    .learning-card .card-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        border-radius: 14px;
    }

    .learning-card {
        padding: 14px;
    }

    .learning-title {
        font-size: 18px;
    }

    .filter-btn {
        font-size: 13px;
        padding: 6px 16px;
    }

    .learning-card .card-header-left {
        font-size: 12px;
        gap: 6px;
    }

    .learning-card .class-title {
        font-size: 15px;
    }

    .learning-card .class-thumbnail {
        width: 60px;
        height: 45px;
    }

    .learning-card .teacher-avatar {
        width: 38px;
        height: 38px;
    }

    .learning-card .payment-item {
        font-size: 12px;
    }

    .learning-card .card-btn {
        font-size: 13px;
        padding: 8px;
    }
}
