/* static\css\style.css */

/* ==================== 全局樣式 ==================== */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #f94144;
    
    --dark-bg: #212529;
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
}

body {
    padding-top: 72px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #f8f9fa 100%);
    line-height: 1.6;
}

/* ==================== 導航欄 ==================== */
.navbar {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2b3035 100%) ;
    box-shadow: var(--shadow-md);
    padding: 0.75rem 0;
	position: relative;
    z-index: 999; 
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #fff, #e9ecef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem 
    margin: 0 0.25rem;
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease;
    color: rgba(255,255,255,0.85) 
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white !important;
    transform: translateY(-1px);
}

.navbar .dropdown-menu {
    z-index: 1000;  
}

/* ==================== 頂部工具列 ==================== */
.top-toolbar {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #3C3C3C 100%) !important;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1000;  /* 提高 z-index */
}

/* 用戶下拉選單容器 */
.top-toolbar .dropdown {
    
    z-index: 1001;  /* 比工具列本身高 */
}

/* 下拉選單本體 */
.top-toolbar .dropdown-menu {
    z-index: 10000 !important;  /* 最高層 */
}

/* 中間區域和導航選單可以維持較低層級 */
.middle-header,
.main-navbar {
    position: relative;
    z-index: auto;  /* 正常層級 */
}

/* ==================== 卡片設計 ==================== */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: var(--card-bg);
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* ==================== 按鈕設計 ==================== */
.btn {
    border-radius: var(--border-radius-md);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==================== 徽章設計 ==================== */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 30px;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #4cc9f0, #4895ef) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #f8961e, #f3722c) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #f72585) !important;
}

/* ==================== 章節標題 ==================== */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.section-title.light::after {
    background: linear-gradient(135deg, #fff, #e9ecef);
}

/* ==================== 分頁設計 ==================== */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    border: none;
    background: white;
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

/* ==================== 搜尋框 ==================== */
.search-form {
    width: 300px;
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.search-input {
    height: 40px;
    border-radius: 20px 0 0 20px;
    border: 1px solid rgba(255,255,255,0.2);
    border-right: none;
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0 1rem;
    flex: 1;
    min-width: 0; /* 防止 flex 溢出 */
}

.search-input:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
    box-shadow: none;
    outline: none;
    color: white;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-btn {
    height: 40px;
    border-radius: 0 20px 20px 0;
    border: 1px solid rgba(255,255,255,0.2);
    border-left: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 500;
    padding: 0 1.2rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 手機版響應式 */
@media (max-width: 768px) {
    .search-form {
        width: 100%;
        max-width: 280px;
    }
    
    .search-input {
        height: 36px;
        font-size: 0.9rem;
    }
    
    .search-btn {
        height: 36px;
        font-size: 0.9rem;
        padding: 0 1rem;
    }
}

@media (max-width: 576px) {
    .search-form {
        max-width: 220px;
    }
}

/* ==================== 搜索建議下拉選單 ==================== */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-top: 0.5rem;
    overflow: hidden;
    z-index: 1000;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--light-bg);
}

.suggestion-cover {
    width: 40px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    margin-right: 1rem;
}

.suggestion-info {
    flex: 1;
}

.suggestion-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.suggestion-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==================== 消息顯示 ==================== */

.notification-bell {
    position: relative;
    color: #6c757d;
    font-size: 1.2rem;
    text-decoration: none;
}
.notification-bell:hover {
    color: #0d6efd;
}
.notification-badge {
    position: absolute;
    top: -8px;
    right: -12px;
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
}

/* ==================== 頁尾 ==================== */
footer {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2b3035 100%);
    color: white;
    margin-top: 4rem;
    padding: 3rem 0;
}

footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: white;
    text-decoration: none;
}

/* ==================== 工具類 ==================== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--danger-color));
}

.gender-switch {
    display: flex;
    align-items: center;
}

.gender-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.gender-link i {
    margin-right: 4px;
}

.gender-link:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.03);
}

.gender-link.active {
    color: #667eea;
    font-weight: 600;
}

/* 男生模式 */
.male-mode .gender-link[href*="gender=male"] {
    color: #3a86ff;
}

/* 女生模式 */
.female-mode .gender-link[href*="gender=female"] {
    color: #e83e8c;
}

.female-mode .gender-link[href*="gender=female"] i {
    color: #e83e8c;
}

.male-mode .gender-link[href*="gender=male"] i {
    color: #3a86ff;
}

/* ==================== 響應式設計 ==================== */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    
    .search-form {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .card-img-top {
        height: 160px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-img-top {
        height: 140px;
    }
}

/* 書籍封面佔位 */
.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.book-cover-placeholder span {
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* Slide 封面佔位 */
.slide-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.slide-cover-placeholder span {
    font-size: 3rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* 頭像佔位 */
.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* 男生圖標顏色 */
.gender-tab .fa-mars {
    color: #3a86ff;
}

.gender-tab.active .fa-mars {
    color: white;
}

/* 女生圖標顏色 */
.gender-tab .fa-venus {
    color: #e83e8c;
}

.gender-tab.active .fa-venus {
    color: white;
}

