/* 統一的頁眉樣式 */
@import url('https://fonts.googleapis.com/css2?family=Italianno&display=swap');

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    /* border-bottom: 1px solid #eee; */
    background: white;
    /* 移除sticky，現在由sticky-wrapper處理 */
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
}

.back-with-btn {
    gap: 10px;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.logo {
    /* font-size: 35px; */
    font-weight: 400;
    color: #86ebff;
    font-family: 'Italianno', cursive;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    /* line-height: 0.9; */
    /* 移除 margin-top，使用 line-height 調整 */
}

.auth-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.back-btn {
    background: transparent;
    border: none;
    color: black;
    /* width: 40px;
    height: 40px; */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.back-btn:hover {
    /* background: #86ebff; */
    color: white;
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */
}

.settings-btn {
    background: transparent;
    border: none;
    color: black;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.settings-btn:hover {
    background: transparent;
    transform: rotate(90deg);
}

.auth-btn {
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
}

.login-btn {
    background: transparent;
    border: 1px solid black;
    color: black;
}

.logout-btn {
    background: #ff6b6b;
    border: 1px solid #ff6b6b;
    color: white;
}

.register-btn {
    background: #86ebff;
    border: 1px solid #86ebff;
    color: white;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* 用戶信息樣式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 導航欄樣式 */
.main-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
}

.nav-container {
    margin: 0 5%;
    padding: 0px 20px;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 16px;
}

.nav-link:hover {
    color: #86ebff;
    background: #f8f9fa;
    border-bottom-color: #86ebff;
}

.nav-link.active {
    color: #86ebff;
    border-bottom-color: #86ebff;
}

/* 電腦版頁眉樣式優化 */
@media (min-width: 768px) {
    .top-header {
        margin: 0 5%;
        padding: 15px 50px; /* 統一邊距，與主要內容一致 */
    }

    .nav-container {
        margin: 0 5%;
        padding: 0 50px;
    }

    .logo {
        font-size: 45px; /* 放大字體 */
        font-weight: 500; /* 增加字重 */
        margin-top: 10px;
    }

    .logo-img {
        width: 50px; /* 放大 logo */
        height: 50px;
    }

    /* 電腦端始終顯示完整logo */
    .back-with-btn .back-btn {
        display: none; /* 隱藏返回按鈕 */
    }

    .back-with-btn .logo {
        display: block; /* 確保logo文字顯示 */
    }

    /* 強制在所有logo容器中顯示logo圖片 */
    .logo-container .logo-img {
        display: block !important;
    }

    .logo-container .logo {
        display: block !important;
    }

    .auth-buttons {
        gap: 12px; /* 調整間距 */
    }

    .settings-btn {
        width: 35px; /* 縮小設置按鈕 */
        height: 35px;
        font-size: 16px; /* 縮小圖標 */
    }

    .auth-btn {
        padding: 8px 16px; /* 縮小登入按鈕 */
        font-size: 13px; /* 縮小字體 */
    }

    .username {
        font-size: 13px; /* 縮小用戶名稱字體 */
    }
}

/* 設定頁面樣式 */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.settings-header {
    background: linear-gradient(135deg, #86ebff, #6a0dad);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    text-align: center;
}

.settings-body {
    padding: 25px;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-option:hover {
    border-color: #86ebff;
}

.language-option.selected {
    border-color: #86ebff;
}

.language-flag {
    width: 30px;
    height: 35px;
    margin-right: 20px;
    font-size: 22px;
}

.language-name {
    font-weight: bold;
    flex: 1;
    font-size: 16px;
}

.language-check {
    color: #86ebff;
    font-weight: bold;
    font-size: 18px;
}

.settings-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.settings-btn-primary {
    flex: 1;
    background: #86ebff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.settings-btn-secondary {
    flex: 1;
    background: #f0f0f0;
    color: #666;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.settings-btn-primary:hover {
    background: #7a1bd2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.settings-btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* 響應式設計 */
@media (max-width: 767px) {
    .top-header {
        padding: 15px 5%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .logo {
        /* padding: 10px 0px 10px 0px; */
        font-size: 40px;
        height: 100%;
        text-align: center;
        margin-bottom: 14px;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .auth-buttons {
        gap: 10px;
    }

    .back-btn,
    .auth-btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .settings-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    /* 移動版導航欄 */
    .main-nav {
        display: none; /* 移動版隱藏 nav 欄 */
    }

    /* 手機版有返回按鈕時隱藏logo圖片，節省空間 */
    .back-with-btn .logo-img {
        display: none;
    }
}
