/* ========================================================================== */
/* Coach Navbar                                                               */
/* 고정형 내비게이션 레이아웃 및 탭 전환 UI                                 */
/* ========================================================================== */

:root {
    --coach-navbar-max-width: 1536px;
    --coach-navbar-horizontal-padding: 16px;
    --coach-navbar-gap: 46px;
    --coach-navbar-tab-gap: 0px;
    --coach-navbar-tab-padding-vertical: 0px;
    --coach-navbar-tab-padding-horizontal: 14px;
    --coach-navbar-border-radius: 18px;
    --coach-navbar-tab-radius: 14px;
    --coach-navbar-shadow: var(--st-shadow-sm);
    --coach-navbar-tab-active: hsl(var(--st-brand));
    --coach-navbar-tab-muted: hsl(var(--st-fg) / 0.6);
    --coach-navbar-tab-hover: hsl(var(--st-muted));
}

.coach-navbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--coach-navbar-height);
    background: hsl(var(--st-bg));
    border-bottom: 1px solid hsl(var(--st-line));
}

.coach-navbar__inner {
    height: 100%;
    max-width: var(--coach-navbar-max-width);
    margin: 0 auto;
    padding: 0 var(--coach-navbar-horizontal-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--coach-navbar-gap);
}

.coach-navbar__brand {
    flex: 1;
    display: flex;
    align-items: center;
}

.coach-navbar__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.375rem;
    color: hsl(var(--st-fg));
    text-decoration: none;
}

.coach-navbar__brand-link i {
    font-size: 1.3rem;
    color: hsl(var(--st-brand));
}

.coach-navbar__tabs {
    display: none;
}

@media (max-width: 768px) {

    /* 모바일에서는 로고를 숨김 (로고 + 텍스트 모두) */
    .coach-navbar__brand,
    .coach-navbar__brand-link span {
        display: none;
    }

    :root {
        --coach-navbar-horizontal-padding: 12px;
    }

    .coach-navbar__inner {
        gap: 12px;
    }

    .coach-navbar__tabs {
        display: flex;
        height: var(--coach-navbar-height);
        align-items: flex-end;
        justify-content: center;
        gap: var(--coach-navbar-tab-gap);
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: none;
    }

    /* 버튼 모양 */
    .coach-navbar__tab {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        /* 모바일에서 탭 버튼 패딩 (탭 버튼 가로 크기) */
        padding: 0 10px 0px;
        border: none;
        background: transparent;
        color: hsl(var(--st-fg));
        /* 모바일에서 선택되지 않은 탭의 폰트 크기 */
        font-size: 16px;
        font-weight: 400;
        cursor: pointer;
        transition: color 0.2s ease;
        white-space: nowrap;
    }

    .coach-navbar__tab[aria-pressed="true"],
    .coach-navbar__tab--active {
        /* 모바일에서 선택된 탭의 폰트 크기 */
        font-size: 16px;
        font-weight: 900;
        color: hsl(var(--st-brand));
    }

    .coach-navbar__tab::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        /* 탭 버튼 하단 선 */
        height: 5px;   
        border-radius: 2px;
        background: transparent;
        transition: background 0.2s ease;
    }

    .coach-navbar__tab i {
        font-size: 1.05rem;
    }

    .coach-navbar__actions {
        gap: 1px;
    }

    .coach-navbar__action,
    .coach-navbar__dropdown .dropdown-toggle {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .coach-navbar__tab[aria-pressed="true"]::after,
    .coach-navbar__tab--active::after {
        background: hsl(var(--st-brand));
    }
}

 .coach-navbar__actions {
     flex: 1;
     display: flex;
     align-items: center;
     justify-content: flex-end;
     gap:1px;
 }
 
 .coach-navbar__action {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     width: 32px;
     height: 32px;
     border-radius: 10px;
     border: none;
     background: transparent;
     color: hsl(var(--st-fg));
     font-size: 1.25rem;
     cursor: pointer;
     transition: background 0.2s ease, color 0.2s ease;
 }

/* 모바일 전용 아이템: 기본은 숨기고, 모바일에서만 보이도록 처리 */
.coach-navbar__mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .coach-navbar__mobile-only {
        display: inline-flex;
    }
}

.coach-navbar__action:hover {
    background: hsl(var(--st-muted));
    color: hsl(var(--st-brand));
}

.coach-navbar__auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coach-navbar__dropdown {
    position: relative;
}

.coach-navbar__dropdown .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: hsl(var(--st-fg));
    cursor: pointer;
    transition: color 0.2s ease;
}

.coach-navbar__dropdown .dropdown-toggle:hover {
    color: hsl(var(--st-brand));
}

.coach-navbar__dropdown .gear-icon {
    display: inline-block;
    transition: transform 0.3s ease-in-out !important;
    transform-origin: center !important;
}

.coach-navbar__dropdown .gear-icon i {
    font-size: 1.0rem;
}

/* 메뉴 크기 */
.coach-navbar__dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    width: auto;
    background: hsl(var(--st-card));
    border: 1px solid hsl(var(--st-line));
    border-radius: 14px;
    box-shadow: var(--st-shadow-card);
    overflow: hidden;
    z-index: 120;
}

[dir="rtl"] .coach-navbar__dropdown .dropdown-menu {
    right: auto;
    left: 0;
}

.dropdown-menu__header {
    padding: 10px 16px;
    border-bottom: 1px solid hsl(var(--st-line));
}

.dropdown-menu__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-menu__avatar {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: hsl(var(--st-brand));
    color: hsl(var(--st-brand-fg));
    font-size: 1.2rem;
}

.dropdown-menu__username {
    font-weight: 600;
    color: hsl(var(--st-fg));
}

.dropdown-menu__meta {
    font-size: 0.8rem;
    color: hsl(var(--st-fg) / 0.7);
}

.dropdown-menu__body {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

/* 메뉴 아이템 모양 */
.dropdown-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 10px;
    border-radius: 10px;
    color: hsl(var(--st-fg));
    font-size: 14px;
    text-decoration: none;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

/* RTL 환경에서 메뉴 아이템 텍스트 정렬 */
[dir="rtl"] .dropdown-menu__item {
    text-align: right;
}

.dropdown-menu__item i {
    font-size: 1rem;
    color: hsl(var(--st-fg) / 0.7);
}

.dropdown-menu__item:hover {
    background: hsl(var(--st-muted));
    color: hsl(var(--st-brand));
}

.dropdown-menu__item--danger {
    color: hsl(var(--st-danger, 0 84% 60%));
}

.dropdown-menu__divider {
    height: 1px;
    background: hsl(var(--st-line));
    margin: 6px 0;
}

/* -------------------------------------------------------------------------- */
/* Samsung Variant                                                            */
/* -------------------------------------------------------------------------- */


.coach-navbar--samsung .coach-navbar__brand-link span {
    font-size: 1.3125rem;
}

.coach-navbar--samsung .coach-navbar__brand-link {
    color: hsl(var(--st-fg));
    gap: 12px;
}

.coach-navbar--samsung .coach-navbar__brand-logo {
    height: 28px;
    width: auto;
}

.coach-navbar--samsung .coach-navbar__tabs {
    background: rgba(0, 82, 204, 0.08);
    border-color: rgba(0, 82, 204, 0.2);
}

.coach-navbar--samsung .coach-navbar__tab[aria-pressed="true"],
.coach-navbar--samsung .coach-navbar__tab--active {
    color: #0052CC;
}

.coach-navbar--samsung .coach-navbar__tab[aria-pressed="true"]::after,
.coach-navbar--samsung .coach-navbar__tab--active::after {
    background: #0052CC;
}

.coach-navbar--samsung .coach-navbar__primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #0052CC;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s ease;
}

.coach-navbar--samsung .coach-navbar__primary:hover {
    background: #0B63E6;
}

.coach-navbar--samsung .dropdown-menu__avatar {
    background: #0052CC;
    color: #ffffff;
}

.coach-navbar--samsung .dropdown-menu__item--danger {
    color: #CC1F1A;
}

/* -------------------------------------------------------------------------- */
/* Chatbot 전용: PC에서도 모바일 네비게이션 스타일 강제                      */
/* - body[data-lesson-type="chatbot"] 에만 적용                               */
/* -------------------------------------------------------------------------- */
@media (min-width: 769px) {

    /* 챗봇 페이지에서는 상단 로고 영역 숨기기 (모바일과 동일한 인지 구조) */
    body[data-lesson-type="chatbot"] .coach-navbar__brand,
    body[data-lesson-type="chatbot"] .coach-navbar__brand-link span {
        display: none;
    }

    /* 챗봇 페이지에서는 탭을 항상 표시 (데스크톱에서도 모바일 탭 UI 사용) */
    body[data-lesson-type="chatbot"] .coach-navbar__tabs {
        display: flex;
        height: var(--coach-navbar-height);
        align-items: flex-end;
        justify-content: center;
        gap: var(--coach-navbar-tab-gap);
        padding: 0;
        border-radius: 0;
        background: transparent;
        border: none;
    }

    /* 버튼 모양 및 타이포그래피 - 모바일 탭과 동일하게 */
    body[data-lesson-type="chatbot"] .coach-navbar__tab {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        padding: 0 10px 0;
        border: none;
        background: transparent;
        color: hsl(var(--st-fg));
        font-size: 16px;
        font-weight: 400;
        cursor: pointer;
        transition: color 0.2s ease;
        white-space: nowrap;
    }

    body[data-lesson-type="chatbot"] .coach-navbar__tab[aria-pressed="true"],
    body[data-lesson-type="chatbot"] .coach-navbar__tab--active {
        font-size: 16px;
        font-weight: 900;
        color: hsl(var(--st-brand));
    }

    body[data-lesson-type="chatbot"] .coach-navbar__tab::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 5px;
        border-radius: 2px;
        background: transparent;
        transition: background 0.2s ease;
    }

    body[data-lesson-type="chatbot"] .coach-navbar__tab i {
        font-size: 1.05rem;
    }

    body[data-lesson-type="chatbot"] .coach-navbar__tab[aria-pressed="true"]::after,
    body[data-lesson-type="chatbot"] .coach-navbar__tab--active::after {
        background: hsl(var(--st-brand));
    }

    /* 액션 버튼 크기 및 모바일 전용 아이콘 정렬 보정 */
    body[data-lesson-type="chatbot"] .coach-navbar__actions {
        gap: 1px;
    }

    body[data-lesson-type="chatbot"] .coach-navbar__action,
    body[data-lesson-type="chatbot"] .coach-navbar__dropdown .dropdown-toggle {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    /* 챗봇에서는 홈 아이콘(모바일 전용)을 항상 노출해도 무방하면
       아래 주석을 해제할 수 있음
    body[data-lesson-type="chatbot"] .coach-navbar__mobile-only {
        display: inline-flex;
    }
    */
}