/* ========================================
   TOP BAR STYLES
   index.html과 sundayschool.html에서만 사용
   ======================================== */

/* Top Bar Container */
.top-bar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.top-bar-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Top Bar Auth Container */
.top-bar-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Top Bar Links */
.top-bar-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    padding: 8px 0;
    display: inline-block;
    position: relative;
    transition: color 0.2s ease;
}

.top-bar-link:hover {
    color: white;
}

.top-bar-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 1px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.top-bar-link:hover::after {
    transform: scaleX(1);
}

/* Top Bar Login Button */
.top-bar-login-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-family: inherit;
    display: inline-block;
    position: relative;
    transition: color 0.2s ease;
}

.top-bar-login-btn:hover {
    color: white;
}

.top-bar-login-btn::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    height: 1px;
    background: white;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.top-bar-login-btn:hover::after {
    transform: scaleX(1);
}

/* Top Bar Divider */
.top-bar-divider {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* Top Bar User Info (로그인 후) */
.top-bar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
}

.top-bar-user-name {
    font-weight: 500;
}

.top-bar-admin-badge {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Top Bar Logout Button */
.top-bar-logout-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-bar-logout-btn:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

/* ========================================
   NAVIGATION BAR STYLES
   index.html에서 사용
   ======================================== */

.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: 70px;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 15;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Desktop Menu */
.navbar-menu-desktop {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 5px;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.navbar-menu-desktop li a,
.navbar-menu-desktop li .popup-trigger {
    display: block;
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.navbar-menu-desktop li a:hover,
.navbar-menu-desktop li .popup-trigger:hover {
    color: var(--primary-color);
    background-color: rgba(44, 90, 160, 0.05);
}

/* Mobile Menu (숨김 처리) */
.navbar-menu {
    display: none;
}

/* ========================================
   MOBILE LOGIN ITEM (사이드 메뉴용)
   ======================================== */

.mobile-login-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.mobile-login-link {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e4a7a 100%) !important;
    color: white !important;
    border-radius: 10px;
    margin: 0 20px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media screen and (max-width: 768px) {
    /* Top Bar */
    .top-bar-container {
        padding: 6px 15px;
    }
    
    .top-bar-left {
        display: none;
    }
    
    .top-bar-link {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .top-bar-user-name {
        font-size: 0.75rem;
    }
    
    .top-bar-admin-badge {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    /* Navigation Bar */
    .navbar {
        height: 0;
        overflow: visible;
        box-shadow: none;
    }

    .navbar-menu-desktop {
        display: none;
    }
    
    /* 햄버거 메뉴 버튼 표시 */
    .menu-toggle {
        display: flex !important;
    }
    
    /* 메뉴 X 버튼 표시 */
    .menu-close {
        display: flex;
    }
    
    /* Mobile Menu Activation */
    .navbar-menu {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background-color: var(--white);
        padding: 80px 0 20px;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 46;
    }

    .navbar-menu.active {
        right: 0;
    }

    .navbar-menu li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar-menu li:last-child {
        border-bottom: none;
    }

    .navbar-menu li a,
    .navbar-menu li .popup-trigger {
        display: block;
        width: 100%;
        padding: 15px 30px;
        text-align: left;
        font-size: 1rem;
        border-radius: 0;
        transition: background-color 0.2s ease;
    }

    .navbar-menu li a:hover,
    .navbar-menu li .popup-trigger:hover {
        background-color: rgba(44, 90, 160, 0.06);
    }

    /* 메뉴 오버레이 */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 45;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}