@charset "utf-8";
@import url("../../font/s-core-dream.css");

/* 변수 정의 */
:root {
    --primary: #14355a;
    --bg-color: #ffffff;
    --text-dark: #222;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 0.5rem;
    --transition: 0.3s ease;
    --font-main: "s-core-dream-regular", sans-serif !important;
}


/* 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body{
  width: 100vw;
  height: 100dvh;
  font-family: "s-core-dream-regular", sans-serif !important;
}

main {
  width: 100vw;
  overflow-x: hidden;
  padding-top: 8vh;
}


ul,
li {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

a:active {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: inherit;
    text-decoration: none;
}

/* 헤더 고정 네비게이션 - 모든 페이지 통일 */
header {
    position: fixed;
    width: 100%;
    height: 70px;
    background: var(--bg-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    top: 0;
    left: 0;
}

/* 어두운 헤더 스타일 (인덱스 페이지 제외) */
header.dark-header {
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

header.dark-header .logo {
    color: #ffffff;
}

header.dark-header #main-logo {
    filter: invert(1);
}

header.dark-header .nav-menu a {
    color: #ffffff;
}

header.dark-header .nav-menu a:hover {
    color: #3498db;
}

header.dark-header .hamburger-btn {
    color: #ffffff;
}


/* 스크롤 시 클래스 */
header.scrolled {
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: saturate(180%) blur(10px); /* 선택 사항 */
}

/* 로고/텍스트 색상 반전이 필요하다면 */
header.scrolled .nav-menu {
    color: var(--bg-color);
}
header.scrolled .logo {
    color: var(--bg-color);
}
/* 헤더가 스크롤된 상태일 때 반전 */
header.scrolled #main-logo {
    filter: invert(1); /* ← 투명도 0.0~1.0 사이로 설정 */
}
header.scrolled .hamburger-btn {
    color: var(--bg-color);
}

.custom-navbar {
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.logo-container {
    display: flex;
    align-items: center;
}

#main-logo {
    width: 80px;
    margin-right: 0.5rem;
    transition: filter 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar-toggle {
    gap: 1rem;
    display: flex;
    align-items: center;
}

/* 공통 */
.navbar-content {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    background-color: transparent;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 0;
    margin: 0;
}

/* 햄버거 버튼 기본 숨김 (데스크탑에서는 안 보임) */
.hamburger-btn {
    color:var(--text-dark);
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
}

.nav-menu li {
    list-style: none;
}

.nav-menu a {
    font-weight: 500;
    transition: color var(--transition);
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary);
}

.navbar-actions select,
.navbar-actions button {
    margin-left: 0.5rem;
}

/* 공통 - 국기만 남게 하는 핵심 */
#lang-select option {
    font-size: 1rem;
}

.lang-wrapper {
    position: relative;
    display: inline-block;
}

/* 데스크탑 스타일 */
@media (min-width: 769px) {
    #lang-flag {
        display: none; /* 국기 버튼은 데스크탑에선 숨김 */
    }

    #lang-select {
        display: inline-block;
        font-size: 1rem;
        height: 32px;
        padding: 0 0.5rem;
    }

    /* 데스크탑에서 모바일 메뉴 숨김 */
    .nav-menu {
        position: static;
        right: auto;
        width: auto;
        height: auto;
        background-color: transparent;
        display: flex;
        flex-direction: row;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
    }

    .nav-menu li {
        margin: 0;
        padding: 0;
    }

    .nav-menu li a {
        padding: 0.5rem 1rem;
        border-radius: 0.4rem;
        transition: all 0.3s ease;
    }

    .nav-menu li a:hover {
        background-color: rgba(0, 0, 0, 0.1);
        color: var(--primary);
        transform: none;
    }
}

/* 반응형 개선 */
@media (max-width: 768px) {
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 70px;
        z-index: 9999; /* ← 다른 요소 위에 오도록 충분히 높게 */
    }

    .logo-container {
        flex-direction: row;
        align-items: center;
    }

    #main-logo {
        width: 50px;
        margin-right: 0.5rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* 햄버거 보이게 */
    .hamburger-btn {
        font-size: 1rem;
        display: block;
        z-index: 1001;
    }

    /* nav-menu를 화면 오른쪽에 숨겨놓음 */
    .nav-menu {
        position: fixed;
        justify-content: flex-start;
        top: 67.5px;
        /* 헤더 아래 */
        right: -500px;
        /* 화면 밖으로 숨김 */
      
        background-color: white;
        display: flex;
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
        border-radius: 0.5rem 0 0.5rem 0.5rem;
        height: auto; /* 자동 높이로 변경 */
        min-height: 200px; /* 최소 높이 설정 */
        max-height: 60vh; /* 최대 높이 제한 */
        transition: right 0.4s ease, opacity 0.4s ease;
        opacity: 0;
        visibility: hidden;
        z-index: 1000;
        margin-top: 0;
        pointer-events: none; /* 숨겨진 상태에서는 클릭 방지 */
        overflow-y: auto; /* 세로 스크롤 허용 */
        overflow-x: hidden; /* 가로 스크롤 숨김 */
    }
    
    header.scrolled .nav-menu {
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: saturate(180%) blur(10px); /* 선택 사항 */
        color: var(--bg-color);
    }

    /* active 클래스가 붙으면 슬라이드됨 */
    .nav-menu.showing {
        right: 0;
        opacity: 1;
        visibility: visible;
        height: auto; /* 자동 높이로 변경 */
        min-height: 200px; /* 최소 높이 설정 */
        max-height: 60vh; /* 최대 높이 제한 */
        pointer-events: auto; /* 보여질 때는 클릭 가능 */
    }

    .nav-menu li {
        margin: 0;
        padding: 0.1rem;
        transition: background-color 0.3s ease;
        width: 100%;
    }

    .nav-menu li a {
        font-size: 0.9rem;
        display: block;
        border-radius: 0.3rem;
        padding: 0.4rem 0.8rem;
        transition: all 0.3s ease;
        color: inherit;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
        cursor: pointer;
    }

    /* showing 클래스가 있을 때만 호버 효과 적용 */
    .nav-menu.showing li a:hover,
    .nav-menu.showing li a:active {
        background-color: #f3f3f3;
        color: var(--primary);
        transform: translateX(5px);
    }

    .nav-menu.showing li a:focus {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    /* 어두운 헤더에서 showing 클래스가 있을 때만 호버 효과 */
    header.dark-header .nav-menu.showing li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #3498db;
    }

    .navbar-toggle {
        justify-content: flex-end;
    }

    .navbar-actions {
        z-index: 1001;
    }

    #lang-select {
        position: absolute;
        opacity: 0;
        pointer-events: auto;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 1;
    }
    
    #lang-flag {
        font-size: 1.5rem;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 2;
    }
    
    .logout-btn{
        font-size:0.5rem;
    }
}

/* 데스크탑: 769px 이상에서 데스크탑용만 표시 */
@media (min-width: 769px) {
    .desktop-only {
        display: block;
    }
}