/* ========================================
   HEADER CSS
   ======================================== */

.header-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.1);
}

.header-logo svg {
    width: 48px;
    height: 48px;
}

.header-logo svg path {
    stroke: #FFFFFF;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* header-auth Flex 컨테이너 */
.header-auth {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.header-auth > div {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.nav-pill {
    padding: 12px 24px;
    border-radius: 14px;
    text-decoration: none;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.nav-pill::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #FFFFFF;
    transition: width 0.3s;
}

.nav-pill:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    transform: translateY(-2px);
}

.nav-pill:hover::after {
    width: 60%;
}

.nav-pill.active {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

.nav-pill.active::after {
    width: 60%;
}

.btn-login {
    padding: 12px 28px;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-login:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-signup {
    padding: 12px 28px;
    border-radius: 14px;
    background-color: #FFFFFF;
    color: #667eea;
    border: 2px solid #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-signup:hover {
    background-color: transparent;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ========================================
   햄버거 메뉴 버튼
   ======================================== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    transition: background-color 0.2s;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #FFFFFF;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-close-btn {
    display: none;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   모바일 반응형 (768px 이하)
   ======================================== */
@media (max-width: 768px) {
    .header-custom {
        padding: 12px 16px;
        gap: 10px;
    }

    .hamburger-btn {
        display: flex;
        order: 3;
        width: 44px;
        height: 44px;
    }

    .header-logo {
        order: 1;
    }

    .header-logo svg {
        width: 36px;
        height: 36px;
    }

    /* header-auth 컨테이너 - 가로 정렬 */
    .header-auth {
        order: 2;
        margin-left: auto;
        flex-direction: row !important;
        align-items: center;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
        gap: 6px;
    }

    /* header-auth 내부 div */
    .header-auth > div[style*="flex"] {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        align-items: center !important;
    }

    .btn-login,
    .btn-signup {
        padding: 8px 14px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 24px 30px;
        gap: 10px;
        z-index: 999;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .header-nav.active {
        right: 0;
    }

    .mobile-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .nav-pill {
        padding: 16px 24px;
        font-size: 17px;
        border-radius: 12px;
        text-align: left;
        justify-content: flex-start;
    }

    .nav-pill::after {
        display: none;
    }

    .nav-pill:hover {
        transform: none;
        background-color: rgba(255, 255, 255, 0.2);
    }

    .header-logo:hover {
        transform: none;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .header-custom {
        padding: 14px 16px;
    }

    .btn-login,
    .btn-signup {
        padding: 8px 12px;
        font-size: 12px;
    }

    .header-logo svg {
        width: 32px;
        height: 32px;
    }

    .hamburger-btn {
        width: 40px;
        height: 40px;
    }
}
