/* header.css - 공통 헤더 스타일 (모든 페이지에서 공유) */

/* ── 헤더 높이 변수 (여기 한 곳만 수정하면 모든 페이지 자동 반영) ── */
:root {
    --header-height: max(15vh, 100px);
    --hc-primary: #14b8a6;
    --hc-primary-dark: #0f766e;
    --hc-primary-soft: #ccfbf1;
    --hc-accent: #2563eb;
    --hc-danger: #e11d48;
    --hc-warning: #f97316;
    --hc-success: #16a34a;
    --hc-bg: #eef7f6;
    --hc-surface: #ffffff;
    --hc-surface-soft: #f7fbfb;
    --hc-line: #d9e8e6;
    --hc-text: #12312f;
    --hc-muted: #64748b;
    --hc-shadow: 0 16px 40px rgba(15, 118, 110, 0.12);
}

/* ── 헤더 ── */
.dashboard-header {
    width: 100%;
    height: var(--header-height);
    min-height: 100px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.875vw;
    border-bottom: 1px solid #E8E8E8;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.back-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.2s;
    flex-shrink: 0;
}

.back-arrow:hover {
    background: #f0f0f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-left .header-logo {
    width: clamp(24px, 2.8vw, 36px);
    height: clamp(24px, 2.8vw, 36px);
    object-fit: contain;
}

.header-logo-text .logo-name {
    font-family: Lexend, sans-serif;
    font-size: clamp(16px, 1.875vw, 24px);
    font-weight: normal;
    color: #2b2b2b;
    display: block;
    line-height: 1.2;
}

.header-logo-text .logo-sub {
    font-family: Inter, sans-serif;
    font-size: 10px;
    font-weight: bold;
    color: rgba(122, 122, 122, 0.8);
    display: block;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-title {
    font-family: Inter, sans-serif;
    font-size: clamp(18px, 1.95vw, 30px);
    font-weight: bold;
    color: #000000;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.56vw, 20px);
}

.header-user-info {
    color: #222222;
    display: flex;
    align-items: flex-start;
    align-self: center;
    gap: 6px;
    white-space: nowrap;
    margin-top: 8px;
}

.header-user-info .user-icon {
    width: 23px;
    height: 23px;
    object-fit: contain;
    filter: brightness(0);
    flex-shrink: 0;
    margin-top: 3px;
}

.header-user-info .user-name-wrap {
    display: flex;
    flex-direction: column;
    margin-right: 20px;
    line-height: 1.3;
}

.header-user-info .user-name-wrap > span:first-child {
    font-size: 16px;
    font-weight: 700;
    color: #222222;
}

.header-user-info .role-label {
    font-size: 11px;
    color: #AAAAAA;
}

/* Zeplin: Line-49 */
.menu-btn {
    background: none;
    border: none;
    margin-right: clamp(16px, 3.125vw, 40px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-btn span {
    display: block;
    width: clamp(24px, 3.125vw, 40px);
    height: clamp(3px, 0.4vw, 5px);
    background-color: #676767;
    border-radius: 2px;
    position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
    content: '';
    display: block;
    width: clamp(24px, 3.125vw, 40px);
    height: clamp(3px, 0.4vw, 5px);
    background-color: #676767;
    border-radius: 2px;
    position: absolute;
    left: 0;
}

.menu-btn span::before { top: -14.5px; }
.menu-btn span::after  { top: 14.5px; }

/* ── 드롭다운 메뉴 ── */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(var(--header-height) - 25px);
    right: 1.875vw;
    width: 230px;
    background: #FFFFFF;
    border-radius: 5px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    padding: 10px 24px 11px 12px;
    z-index: 200;
}

.dropdown-menu.show { display: block; }

.dropdown-menu .menu-section-title {
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #727272;
    text-align: left;
    padding: 0 0 12px;
}

.dropdown-menu .menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #343434;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-menu .menu-item:hover { background: #F5F5F5; }

.dropdown-menu .menu-item img,
.dropdown-menu .menu-item .menu-icon-circle {
    width: 23px;
    height: 23px;
    padding: 3px;
    border: 1.5px solid #343434;
    border-radius: 50%;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-menu .menu-divider {
    height: 1px;
    background: #EEEEEE;
    margin: 8px 0;
}

/* ── 태블릿 (769px ~ 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --header-height: max(11vh, 80px);
    }
}

/* ══════════════════════════════════════════════════════════
   모바일 레이아웃 (≤768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .dashboard-header {
        min-height: 56px;
        padding: 0 10px;
        gap: 6px;
    }

}

/* ══════════════════════════════════════════════════════════
   소형 모바일 (≤480px) - 2줄 헤더 레이아웃
   ══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    :root {
        --header-height: 88px;
    }

    .dashboard-header {
        flex-wrap: wrap;
        height: auto;
        min-height: 88px;
        padding: 8px 12px 0;
        align-items: center;
    }

    .header-left {
        flex: 1;
        min-width: 0;
        order: 1;
        overflow: hidden;
    }

    .header-right {
        flex-shrink: 0;
        order: 2;
    }

    .header-center {
        position: static;
        transform: none;
        width: 100%;
        text-align: center;
        order: 3;
        padding: 0 0 8px;
    }

    .header-title {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-logo-text {
        min-width: 0;
        overflow: hidden;
    }

    .header-logo-text .logo-name {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-logo-text .logo-sub {
        font-size: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-user-info .user-name-wrap > span:first-child {
        font-size: 12px;
    }

    .header-user-info .role-label {
        font-size: 9px;
    }

    .header-user-info .user-icon {
        width: 18px;
        height: 18px;
    }

    .header-user-info .user-name-wrap {
        margin-right: 8px;
    }

    .menu-btn {
        margin-right: 0;
    }

    .menu-btn span,
    .menu-btn span::before,
    .menu-btn span::after {
        width: 22px;
    }

    .dropdown-menu {
        top: 88px;
        right: 0;
    }
}

/* QHD / 4K 초대형 화면 (≥1921px) */
@media (min-width: 1921px) {
    .header-left .header-logo {
        width: 2.8vw;
        height: 2.8vw;
    }

    .header-logo-text .logo-name {
        font-size: 1.875vw;
    }

    .header-title {
        font-size: 1.95vw;
    }

    .header-user-info .user-icon {
        width: 23px;
        height: 23px;
    }

    .menu-btn span,
    .menu-btn span::before,
    .menu-btn span::after {
        width: 3.125vw;
    }
}
