/* 공통 헤더 CSS */

/* 폰트 로딩 - 통일된 방식 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css');

/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body {
    padding-top: 80px;
    overflow-x: hidden;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* 네비게이션 바 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 3px solid #333;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.navbar.scrolled {
    background: #ffffff;
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #333;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: #333;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-menu li {
    list-style: none;
}

.nav-menu a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #667eea;
}

.nav-menu a.active {
    color: #667eea;
    font-weight: 600;
}

/* 네비게이션 버튼 초기 상태 숨기기 (깜빡임 방지) */
#navAuthBtn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#navAuthBtn.loaded {
    opacity: 1;
}

/* 로그인 버튼 스타일 */
.nav-cta {
    background: linear-gradient(135deg, #FF8C42 0%, #E6753A 100%);
    color: white !important;
    padding: 0.7rem 1.6rem;
    border: 2.5px solid #333;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.nav-cta:hover {
    background: linear-gradient(135deg, #333 0%, #222 100%);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
    border: 3px solid #000;
    scale: 1.05;
}

/* 관리자 드롭다운 스타일 */
.admin-dropdown {
    position: relative;
}

.admin-btn-with-dropdown {
    background: linear-gradient(135deg, #FF8C42 0%, #E6753A 100%);
    color: white !important;
    padding: 0.7rem 1.6rem;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2.5px solid #333;
    display: inline-block;
    text-decoration: none;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.admin-btn-with-dropdown:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: white;
    border: 3px solid #333;
    border-radius: 15px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 340px;
    z-index: 1001;
    animation: dropdownSlide 0.3s ease;
    overflow: hidden;
    margin-right: 5px;
}

.admin-dropdown-menu.active {
    display: block;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    right: 25px;
    width: 16px;
    height: 16px;
    background: white;
    border-top: 3px solid #333;
    border-left: 3px solid #333;
    transform: rotate(45deg);
    z-index: 1002;
}

.admin-dropdown-menu.show {
    display: block;
}

.dropdown-service-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dropdown-service-grid {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.dropdown-service-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.dropdown-service-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: #f8fdfd;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 55px;
    box-sizing: border-box;
    gap: 10px;
}

.dropdown-service-item:hover {
    background: linear-gradient(135deg, #a8d5ba 0%, #8cc8a0 100%);
    transform: scale(1.02);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.dropdown-service-item.coming-soon {
    opacity: 0.7;
    background: #f0f0f0;
    cursor: not-allowed;
}

.dropdown-service-item.coming-soon:hover {
    transform: none;
    background: #f0f0f0;
    box-shadow: none;
}

.dropdown-service-item.logout-btn {
    grid-column: span 2;
}

.dropdown-service-icon {
    font-size: 1.4rem;
    min-width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-service-content {
    flex: 1;
}

.dropdown-service-name {
    font-weight: 700;
    color: #333;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-service-desc {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* 모바일용 드롭다운 애니메이션 */
@keyframes dropdownSlideMobile {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .admin-dropdown-menu {
        /* 중앙 배치 - 초기 위치부터 중앙 고정 */
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        min-width: 280px;
        max-width: 85vw;
        margin-right: 0;
        /* 아래로 열리도록 변경 */
        top: calc(100% + 12px);
        bottom: auto;
        max-height: 60vh;
        overflow-y: auto;
        /* 모바일 전용 애니메이션 적용 */
        animation: dropdownSlideMobile 0.3s ease !important;
    }

    .admin-dropdown-menu::before {
        /* 모바일에서 화살표 제거 */
        display: none;
    }

    /* 모바일에서 서비스 그리드를 1열로 변경 */
    .dropdown-service-grid {
        grid-template-columns: 1fr;
        padding: 0.4rem;
        gap: 0.2rem;
    }

    /* 모바일에서 서비스 아이템 크기 조정 - 더욱 컴팩트하게 */
    .dropdown-service-item {
        padding: 8px 10px;
        min-height: 45px;
    }

    /* 모바일에서 아이콘 크기 조정 */
    .dropdown-service-icon {
        font-size: 1.2rem;
        min-width: 28px;
    }

    /* 모바일에서 텍스트 크기 조정 */
    .dropdown-service-name {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
    }

    .dropdown-service-desc {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    /* 로그아웃 버튼 전체 너비 유지 */
    .dropdown-service-item.logout-btn {
        grid-column: span 1;
    }
}