/* 隱藏舊的 header 樣式 */
#header {
    display: none !important;
}

/* 重置樣式 - 移除白色區塊 */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    background: transparent !important;
}

body.is-preload {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

#page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    background: transparent !important;
}

#wrapper {
    background: transparent !important;
}

/* 現代化導航欄 */
#modern-header {
    background: transparent;
    backdrop-filter: blur(10px);
    box-shadow: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
}

/* 沒有 banner 的頁面 - 深色背景 */
#modern-header.no-banner {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 1)) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: none;
}

/* 滾動後的樣式 */
#modern-header.scrolled {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98));
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.modern-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.modern-logo {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 180px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.modern-logo:hover {
    color: #3498db;
    transform: scale(1.05);
}

.modern-logo span {
    color: #3498db;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* 桌面版導航 - 分為三個區域 */
.nav-menu-desktop {
    display: flex;
    align-items: center;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
    justify-content: flex-end;
}

.nav-menu-desktop li {
    position: relative;
}

.nav-menu-desktop a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.nav-menu-desktop a:hover {
    background: rgba(52, 152, 219, 0.3);
    color: #3498db;
    transform: translateY(-2px);
}

/* 下拉選單樣式 */
.nav-center .dropdown {
    position: relative;
}

.nav-center .dropdown-toggle {
    cursor: pointer;
    position: relative;
}

/* 隱藏 Bootstrap 或其他可能自動添加的箭頭 */
.nav-center .dropdown-toggle::after,
.nav-center .dropdown-toggle::before,
.nav-center .dropdown-toggle .caret,
.nav-center .dropdown-toggle .fa-caret-down {
    display: none !important;
}

.nav-center .dropdown-toggle i.fa-chevron-down {
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 5px;
    font-size: 0.7em;
}

.nav-center .dropdown.open .dropdown-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.nav-center .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    background: #fff !important;
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10001;
    list-style: none;
    margin: 0;
    display: block !important;
}

.nav-center .dropdown.open .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.nav-center .dropdown-menu li {
    margin: 0;
    padding: 0;
}

.nav-center .dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333 !important;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.2s ease;
    background: #fff !important;
    text-shadow: none !important;
    border-radius: 0;
}

.nav-center .dropdown-menu a:hover {
    background: #f8f9fa !important;
    color: #3498db !important;
    padding-left: 25px;
    transform: none;
}

/* 通知圖標和下拉框 */
.notification-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-notification-icon {
    position: relative;
    color: #fff;
    font-size: 0.95em;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    height: 32px;
    min-width: 40px;
}

.nav-notification-icon:hover {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.1) !important;
    transform: translateY(-2px);
    border: none !important;
    box-shadow: none !important;
}

.nav-notification-icon:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-notification-icon:active {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.nav-notification-icon i.fa-bell {
    display: block;
    line-height: 1;
}

/* Bootstrap 風格通知徽章 - 小紅點 */
.notification-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    background: #dc3545;
    color: transparent;
    font-size: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(30, 30, 30, 0.95);
    pointer-events: none;
    z-index: 1;
    box-sizing: border-box;
}

/* Bootstrap 風格通知下拉框 */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 15px;
    background: #fff !important;
    border-radius: 10px !important;
    min-width: 380px;
    max-width: 420px;
    box-shadow: 0 5px 20px -3px rgba(0, 0, 0, 0.16) !important;
    border: 0 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 500px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10001;
}

/* 三角箭頭 */
.notification-dropdown:after {
    content: "";
    position: absolute;
    top: -15px;
    right: 15px;
    border-top: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
    border-left: 8px solid transparent;
}

.notification-wrapper.active .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 15px 20px !important;
    border-bottom: 1px solid #ddd !important;
    font-weight: 500;
    color: #333 !important;
    font-size: 1em;
    background: #fff !important;
    text-align: center;
}

.notification-dropdown-content {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px !important;
    transition: background 0.15s ease;
    cursor: pointer;
    border-bottom: 1px solid #ddd !important;
    position: relative;
    margin: 0 20px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: #fff !important;
}

/* 未讀通知左側藍色條 */
.notification-item.unread {
    border-left: 2px solid #29B6F6 !important;
    padding-left: 18px !important;
    margin-left: 0 !important;
}

.notification-item:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

.notification-item:last-child {
    border-bottom: none !important;
}

.notification-item-title {
    color: #333 !important;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9em;
    line-height: 1.3;
}

.notification-item-title i {
    font-size: 1em;
    margin-top: 2px;
    flex-shrink: 0;
}

.notification-item-content {
    color: #666 !important;
    font-size: 0.85em;
    line-height: 1.4;
    margin-left: 24px;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 0.9em;
}

/* Bootstrap 風格滾動條 */
.notification-dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-dropdown-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.notification-dropdown-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 會員下拉選單 */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(52, 152, 219, 0.15);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.user-dropdown-toggle:hover {
    background: rgba(52, 152, 219, 0.25);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.user-dropdown-toggle i.fa-user-circle {
    font-size: 0.95em;
    color: #3498db;
}

.user-name {
    font-size: 0.8em;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.user-dropdown-toggle .fa-chevron-down {
    font-size: 0.65em;
    transition: transform 0.3s ease;
}

.user-dropdown.active .fa-chevron-down {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    backdrop-filter: blur(15px);
    border-radius: 10px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(52, 152, 219, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.user-dropdown-menu a:first-child {
    border-radius: 10px 10px 0 0;
}

.user-dropdown-menu a:last-child {
    border-radius: 0 0 10px 10px;
    color: #e74c3c;
}

.user-dropdown-menu a:hover {
    background: rgba(52, 152, 219, 0.2);
    padding-left: 25px;
    transform: none;
}

.user-dropdown-menu i {
    font-size: 1em;
    width: 20px;
}

/* 登入/註冊按鈕 */
.nav-btn {
    padding: 5px 16px;
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.85em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.nav-btn-primary {
    background: linear-gradient(135deg, #3498db, #9b59b6);
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.nav-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #8e44ad);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
}

.nav-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

@keyframes bell-ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

/* 移動端漢堡選單 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: #3498db;
    transform: scale(1.1);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.98));
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.mobile-menu.active {
    max-height: 600px;
    padding: 20px 0;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu a {
    display: block;
    padding: 15px 30px;
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    transition: all 0.3s ease;
}

.mobile-menu a:hover {
    background: rgba(52, 152, 219, 0.2);
    padding-left: 40px;
    color: #3498db;
}

.mobile-menu .nav-btn {
    margin: 10px 30px;
    text-align: center;
    border-radius: 25px;
    font-weight: 600;
}

/* 響應式設計 */
@media screen and (max-width: 992px) {
    .nav-menu-desktop {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .modern-navbar {
        padding: 8px 20px;
    }
}

@media screen and (max-width: 576px) {
    .modern-logo {
        font-size: 1.1em;
    }
    
    .modern-navbar {
        padding: 6px 15px;
    }
    
    .mobile-menu {
        top: 42px;
    }
    
    body #page-wrapper {
        padding-top: 0 !important;
    }
    
    #banner,
    section#banner {
        padding-top: 42px !important;
    }
    
    /* 手機版通知下拉框調整 */
    .notification-dropdown {
        min-width: 300px;
        max-width: 90vw;
        right: -10px;
    }
    
    .notification-dropdown:after {
        right: 25px;
    }
}

/* 確保桌面版正確顯示 */
@media screen and (min-width: 993px) {
    .mobile-menu-toggle {
        display: none;
    }
    
    .mobile-menu {
        display: none !important;
    }
}

/* 為了避免內容被固定導航遮擋 */
body #page-wrapper {
    padding-top: 0 !important;
    margin-top: 0 !important;
    background: transparent !important;
}

/* 沒有 banner 的頁面，內容區域需要上方間距 */
body:not(:has(#banner)) #wrapper,
body:not(:has(section#banner)) #wrapper,
body:not(:has(#banner)) #main,
body:not(:has(section#banner)) #main {
    margin-top: 80px !important;
    padding-top: 20px !important;
}

@media screen and (max-width: 768px) {
    body:not(:has(#banner)) #wrapper,
    body:not(:has(section#banner)) #wrapper,
    body:not(:has(#banner)) #main,
    body:not(:has(section#banner)) #main {
        margin-top: 60px !important;
        padding-top: 15px !important;
    }
}

#banner,
section#banner {
    margin-top: 0 !important;
    padding-top: 45px !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

