/* ==========================================
   마이페이지 V3 레이아웃
   사이드메뉴를 컨테이너 밖에 배치하여
   콘텐츠 영역이 1140px 전체를 사용
   ========================================== */

/* ========== FOUC 방지 ========== */
.mypage-sidemenu{animation:sidebarFadeIn .2s ease-out forwards}
@keyframes sidebarFadeIn{from{opacity:0}to{opacity:1}}

/* ========== 마이페이지 문서 영역 ========== */
section.document.mypage-document {
    background: #f8f9fb;
    min-height: calc(100vh - 200px);
    overflow: visible !important; /* sticky 포지셔닝을 위해 base.css의 overflow: auto 오버라이드 */
}

/* ========== 새 래퍼 - 전체 화면 중앙 정렬 ========== */
.mypage-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
    gap: var(--edu-spacing-5);
}

/* ========== 좌측 사이드메뉴 ========== */
.mypage-sidemenu {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    margin-top: 70px;
    height: fit-content;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    z-index: 100;
    white-space: nowrap;
	margin-bottom: 70px;
}

/* ========== 콘텐츠 영역 - 1140px 제한 ========== */
.mypage-content-area {
    flex: 1;
    max-width: 1140px;
    min-width: 0;
	margin-top: 70px;
	margin-bottom: 70px;
}

/* ========== 우측 콘텐츠 영역 ========== */
.mypage-content {
    width: 100%;
    min-width: 0;
}

/* 콘텐츠 영역 내 요소들 전체 너비 */
.mypage-content > * {
    width: 100%;
}

/* 사이드메뉴 헤더 */
.sidemenu-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.sidemenu-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

/* 프로필 영역 */
.sidemenu-profile {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.sidemenu-profile__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidemenu-profile__info {
    flex: 1;
    min-width: 0;
}

.sidemenu-profile__name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidemenu-profile__badge {
    color: #2563eb;
    font-size: 16px;
}

.sidemenu-profile__email {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidemenu-profile__id {
    font-size: 14px;
    color: #6b7280;
    margin-top: 2px;
}

.sidemenu-profile__badge--verified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--edu-primary-600, #0073E6);
    margin-top: 8px;
}

.sidemenu-profile__badge--verified i {
    font-size: 16px;
}

.sidemenu-profile__badge--unverified {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #dc2626;
    text-decoration: none;
    margin-top: 8px;
    transition: color 0.15s ease;
}

.sidemenu-profile__badge--unverified:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.sidemenu-profile__badge--unverified i {
    font-size: 16px;
}

/* ========== 과목 선택 드롭다운 ========== */
.course-switch {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.course-switch__label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 8px;
}

.course-switch select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    color: #111827;
}

.course-switch select:hover {
    border-color: #9ca3af;
}

.course-switch select:focus {
    outline: none;
    border-color: var(--edu-primary-600, #0073E6);
    box-shadow: 0 0 0 3px rgba(0, 115, 230, 0.1);
}

/* 과목 1개일 때 링크 스타일 */
.course-switch__current {
    display: block;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.course-switch__current:hover {
    color: var(--edu-primary-600, #0073E6);
    border-color: var(--edu-primary-300, #80BFFF);
}

/* 네비게이션 */
.sidemenu-nav {
    padding: 12px 0;
}

.sidemenu-nav__group {
    margin-bottom: 8px;
}

.sidemenu-nav__group:last-child {
    margin-bottom: 0;
}

.sidemenu-nav__label {
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 20px 8px;
    margin-top: 8px;
}

.sidemenu-nav__group:first-child .sidemenu-nav__label {
    margin-top: 0;
}

.sidemenu-nav__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #4b5563;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.15s ease;
}

.sidemenu-nav__item i {
    font-size: 20px;
    width: 20px;
    text-align: center;
}

.sidemenu-nav__item:hover {
    background: #f3f4f6;
    color: #111827;
}

.sidemenu-nav__item.active {
    background: var(--edu-primary-50, #E6F4FF);
    color: var(--edu-primary-600, #0073E6);
    font-weight: 500;
    border-left: 3px solid var(--edu-primary-600, #0073E6);
    padding-left: 17px;
}

/* ========== 반응형: 뷰포트 < 1424px ========== */
@media (max-width: 1424px) {
    .mypage-wrapper {
        padding: 0 16px;
    }

    .mypage-content-area {
        max-width: none;
        flex: 1;
    }
}

/* ========== 반응형 (태블릿) ========== */
@media (max-width: 1024px) {
    .mypage-wrapper {
        gap: 24px;
    }

    .mypage-sidemenu {
        width: 220px;
    }
}

/* ========== 반응형 (모바일 - 사이드바 세로 레이아웃) ========== */
@media (max-width: 860px) {
    .mypage-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 0 16px;
    }

    .mypage-sidemenu {
        width: 100%;
        position: static;
    }

    .sidemenu-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
    }

    .sidemenu-nav__group {
        display: contents;
    }

    .sidemenu-nav__label {
        display: none;
    }

    .sidemenu-nav__item {
        padding: 8px 12px;
        border-radius: 6px;
        background: #f3f4f6;
        font-size: 15px;
    }

    .sidemenu-nav__item.active {
        border-left: none;
        padding-left: 12px;
    }
}

/* ========== 반응형 (모바일 - 사이드바 숨김) ========== */
@media (max-width: 768px) {
    .mypage-sidemenu {
        display: none;
    }

    .mypage-wrapper {
        padding: 0;
    }

    .mypage-content-area {
        max-width: 100%;
    }
}

/* ========== 스킵 메뉴 (접근성) ========== */
.skip-menu {
    position: absolute;
    top: -100px;
    left: 0;
    width: 100%;
    background: var(--edu-neutral-900, #111827);
    z-index: 2000;
}

.skip-menu a {
    display: block;
    padding: 16px;
    color: white;
    text-decoration: none;
    text-align: center;
}

.skip-menu a:focus {
    position: absolute;
    top: 100px;
}
