/* ======================================================
   base.css - 테마·헤더·카드·버튼 공통 (로딩 1순위)
====================================================== */

/* ======================================================
   THEME VARIABLES
====================================================== */
:root {
    --bg-main: #eef2ff;      /* 메인 배경: 아주 옅은 블루-그레이 */
    --bg-panel: #ffffff;     /* 카드 배경: 흰색 */
    --bg-soft: #f3f4f6;      /* 리스트/디테일 배경: 중성 라이트 그레이 */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #14b8a6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #d1d5db;       /* 경계선: 회색 */
}

.board-scope {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #7a1f2b;
}
/* ======================================================
   GLOBAL RESET
====================================================== */

* {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    height: 100%;
    font-family: system-ui, -apple-system, "Noto Sans KR", sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}


/* ======================================================
   GLOBAL LINK STYLE
====================================================== */

a {
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s ease;
}

a:hover {
    opacity: 0.85;
}


/* ======================================================
   HEADER (로고·주요메뉴·개인메뉴)
====================================================== */
.site-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    position: relative;
    z-index: 1000;
    overflow: visible;
}

/* Accent line */
.site-header::after {
    content: none; /* 헤더 밑 파란선 제거 */
}

.header-inner {
    width: 100%;
    max-width: 1470px;
    margin: 0 auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    gap: 20px;
    box-sizing: border-box;
}

/* 좌: 로고 + 주요 메뉴 (첫 번째 사진 스타일) */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

/* 데스크톱: 왼쪽 메뉴 간격 50px 더 넓게 */
@media (min-width: 769px) {
    .nav-left {
        gap: 60px;  /* 기존보다 약 50% 넓게 */
    }
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.header-logo-img {
    height: 38px;  /* 약 20% 확대 (32 → 38) */
    width: auto;
    object-fit: contain;
    display: block;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.nav-left a {
    font-size: 1.2rem;       /* 약 20% 확대 */
    font-weight: 700;        /* 굵게 */
    letter-spacing: 0.03em;
    padding-bottom: 4px;   /* 호버 밑줄용 여백 */
    border-bottom: 2px solid transparent;
}

/* 가운데: 여백 (좌·우를 양 끝으로) */
.header-center {
    flex: 1;
    min-width: 24px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-right a,
.nav-right .nav-logout-btn {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.nav-right a:hover,
.nav-right .nav-logout-btn:hover {
    color: var(--primary);
}

.site-header .nav-left a {
    color: var(--text-main);
}

.site-header .nav-left a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);  /* 호버 시 밑줄 강조 */
}

.user-name {
    font-weight: 600;
    color: var(--text-muted);
}

/* 회원정보 링크: 인물 아이콘 + 아이디 */
.user-info-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-main);
}
.user-info-link:hover {
    color: var(--primary);
}
.user-info-link .user-name {
    margin: 0;
}
.user-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
}
.user-info-link:hover .user-info-icon {
    background: var(--primary);
    color: #fff;
}

/* 헤더 로그아웃: 텍스트 링크처럼 자연스럽게 */
.nav-right .nav-logout-form {
    display: inline;
    margin: 0;
}
.nav-logout-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}
.nav-logout-btn:hover {
    color: var(--primary);
}

/* ----------------------------------------
   헤더: 햄버거 + 모바일 드롭다운 (900px 이하)
---------------------------------------- */
.header-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-main);
}
.header-menu-btn:hover {
    background: var(--bg-soft);
    color: var(--primary);
}
.header-menu-icon {
    display: block;
    width: 22px;
    height: 18px;
    position: relative;
    background: linear-gradient(
        to bottom,
        currentColor 0 2px,
        transparent 2px 7px,
        currentColor 7px 9px,
        transparent 9px 14px,
        currentColor 14px 16px
    );
    border-radius: 1px;
}

/* 드롭다운: 기본 숨김, 열리면 fixed로 헤더 아래 고정 */
.header-dropdown {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 120px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 12px 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 9999;
    -webkit-overflow-scrolling: touch;
}
.header-dropdown.is-open,
.header-dropdown[data-state="open"] {
    display: block !important;
}

@media (min-width: 901px) {
    .header-dropdown,
    .header-dropdown.is-open,
    .header-dropdown[data-state="open"] {
        display: none !important;
    }
}
.header-dropdown-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.header-dropdown-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.header-dropdown-section a,
.header-dropdown-link {
    display: block;
    padding: 12px 24px;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
}
.header-dropdown-section a:hover,
.header-dropdown-link:hover {
    background: var(--bg-soft);
    color: var(--primary);
}
.header-dropdown-logout {
    margin: 0;
    padding: 0;
}
.header-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

@media (max-width: 900px) {
    .header-menu-btn {
        display: flex;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 12px;
        padding: 10px 16px;
    }

    .header-left .nav-left,
    .header-center {
        display: none !important;
    }

    /* 로그인 시 상단에 아이디·인물 아이콘·알림 유지 */
    .nav-right {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    .header-left {
        gap: 0;
        flex: 1;
        min-width: 0;
    }

    .header-logo-img {
        height: 36px;
    }

    .user-name {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 드롭다운 열림 시 확실히 표시 */
    .site-header .header-dropdown.is-open,
    .site-header .header-dropdown[data-state="open"] {
        display: block !important;
    }
}


/* ======================================================
   MAIN LAYOUT
====================================================== */

.site-main {
    flex: 1;
    display: flex;
    min-height: 0;
    width: 100%;
    max-width: 1470px;
    margin: 8px auto 20px auto;
    padding: 12px 20px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.side-panel {
    background: var(--bg-soft);
    border-right: 1px solid var(--border); }

/* ======================================================
   CARD / PANEL STYLE
   - 카드: 흰색 배경
   - 경계선: 회색 1px
====================================================== */

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);  /* 회색 경계선 */
    border-radius: 12px;
    box-shadow: none;
}
.card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: 0.2s ease;
}

/* 패널 카드 안쪽의 .card는 테두리/카드 형태 제거 (가장 밖 카드만 테두리) */
.side-panel-card .card,
.detail-panel-card .card {
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.side-panel,
.detail-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 0;
}

/* ======================================================
   BUTTON OVERRIDE (Bootstrap 확장)
====================================================== */

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); }
/* ======================================================
        tab
====================================================== */
.tab {
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: 0.2s ease;
}

.tab.active {
    background: var(--primary);
    color: white; }
/* ======================================================
   NOTIFICATION
====================================================== */

.noti-wrap {
    position: relative;
}

.noti-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.noti-badge {
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    border-radius: 999px;
    padding: 2px 6px;
    margin-left: 4px;
}

.noti-dropdown {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    width: 260px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: 10px 0;
    z-index: 2000;
}

.noti-item {
    padding: 8px 12px;
    cursor: pointer;
}

.noti-item:hover {
    background: var(--bg-soft);
}

.noti-empty {
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.dot {
    color: #ef4444;
    margin-right: 6px;
}