/* 헤더 전체 */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    font-family: 'Noto Sans KR', sans-serif;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 내부 */
.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    box-sizing: border-box;
}

/* 왼쪽 그룹 */
.left-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* 로고 */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header .logo img {
    height: 77px !important;
    width: 267px !important;
    vertical-align: initial !important; /* main.css의 vertical-align: middle 차단 */
    max-width: none !important; /* main.css의 max-width: 100% 차단 */
}

/* 메뉴 */
.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #374b5f;
    font-size: 16px;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #2980b9;
}

/* 검색창 */
.search-box {
    position: relative;
    height: 42px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 280px;
    height: 100%;
    padding: 6px 40px 6px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #4ab2e3;
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.search-btn:hover {
    opacity: 0.7;
}

.search-btn img {
    height: 16px;
    width: 16px;
    display: block;
}

/* 유저 메뉴 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 시작하기 버튼 */
.start-btn {
    background-color: #4ab2e3 !important;
    color: #ffffff !important;
    border-radius: 6px;
    font-size: 16px;
    height: 42px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.start-btn:hover {
    background-color: #3a9bc1 !important;
}

.start-btn img {
    height: 14px;
}

/* 로그아웃 상태 (비로그인) - 로그인/회원가입 버튼들 */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-buttons a {
    color: #374B5F;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.login-link {
    background-color: transparent;
    border: 1px solid #4ab2e3;
    color: #4ab2e3 !important;
}

.login-link:hover {
    background-color: #4ab2e3;
    color: #ffffff !important;
}

.register-link {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #374B5F !important;
}

.register-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* 로그인 상태 - 사용자 정보 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header .user-info .username {
    color: #374B5F !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
    background-color: #f8f9fa !important;
    border-radius: 6px !important;
    border: 1px solid #e9ecef !important;
    white-space: nowrap !important;
    margin-bottom: 0 !important; /* 랭킹 페이지 스타일 차단 */
}

.logout-btn {
    color: #e74c3c !important;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e74c3c;
    background-color: transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.logout-btn:hover {
    background-color: #e74c3c;
    color: #ffffff !important;
}

.mypage-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mypage-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.mypage-btn img {
    height: 20px;
    width: 20px;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .search-box input {
        width: 220px;
    }

    .header-inner {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 12px;
        height: 70px;
    }

    .left-group {
        gap: 16px;
    }

    .logo img {
        height: 60px;
        width: 200px;
    }

    .nav-menu {
        display: none; /* 모바일에서 네비게이션 숨김 */
    }

    .search-box {
        display: none; /* 모바일에서 검색창 숨김 */
    }

    .user-menu {
        gap: 8px;
    }

    .start-btn {
        font-size: 14px;
        height: 36px;
        padding: 0 12px;
    }

    .auth-buttons a {
        font-size: 14px;
        padding: 6px 12px;
    }

    .header .user-info .username {
        font-size: 13px !important;
        padding: 6px 8px !important;
    }

    .logout-btn {
        font-size: 13px;
        padding: 6px 8px;
    }

    .mypage-btn {
        width: 36px;
        height: 36px;
    }

    .mypage-btn img {
        height: 16px;
        width: 16px;
    }
}

@media (max-width: 480px) {
    .header-inner {
        height: 60px;
        padding: 0 8px;
    }

    .logo img {
        height: 50px;
        width: 160px;
    }

    .user-menu {
        gap: 6px;
    }

    .start-btn {
        font-size: 13px;
        height: 32px;
        padding: 0 10px;
    }

    .auth-buttons {
        gap: 6px;
    }

    .auth-buttons a {
        font-size: 13px;
        padding: 5px 8px;
    }

    .header .user-info .username {
        font-size: 12px !important;
        padding: 5px 6px !important;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logout-btn {
        font-size: 12px;
        padding: 5px 6px;
    }

    .mypage-btn {
        width: 32px;
        height: 32px;
    }
}