/**
 * 手機版導航優化樣式
 * 改善手機版的導航體驗
 */

/* 手機版導航基礎樣式 */
@media (max-width: 991.98px) {
    /* 導航選單容器 */
    .navbar-collapse {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        padding-bottom: 20px;
    }
    
    /* 導航項目間距 */
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    /* 下拉選單樣式 */
    .navbar-nav .dropdown-menu {
        background: rgba(0, 0, 0, 0.1);
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    
    .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 10px 25px;
        font-size: 0.95rem;
    }
    
    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    .navbar-nav .dropdown-divider {
        border-color: rgba(255, 255, 255, 0.1);
        margin: 5px 15px;
    }
    
    /* 分類標題 */
    .mobile-nav-category {
        display: block;
        padding: 8px 15px;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.5);
        letter-spacing: 0.5px;
        background: rgba(0, 0, 0, 0.2);
    }
    
    /* 快速連結區塊 */
    .mobile-quick-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        margin: 10px 15px;
    }
    
    .mobile-quick-links a {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border-radius: 20px;
        font-size: 0.85rem;
        text-decoration: none;
        transition: background 0.2s;
    }
    
    .mobile-quick-links a:hover {
        background: rgba(255, 255, 255, 0.25);
    }
    
    /* 搜尋框 */
    .mobile-search-box {
        padding: 10px 15px;
        background: rgba(0, 0, 0, 0.1);
    }
    
    .mobile-search-box .form-control {
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 20px;
        padding: 10px 15px;
    }
    
    .mobile-search-box .btn {
        border-radius: 20px;
        padding: 10px 20px;
    }
    
    /* 徽章樣式調整 */
    .navbar-nav .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
        vertical-align: middle;
    }
    
    /* 後台管理區塊 */
    .mobile-admin-section {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .mobile-admin-section .nav-link {
        color: rgba(255, 200, 100, 0.9);
    }
}

/* 桌面版隱藏手機專用元素 */
@media (min-width: 992px) {
    .mobile-only {
        display: none !important;
    }
}

/* 手機版隱藏桌面專用元素 */
@media (max-width: 991.98px) {
    .desktop-only {
        display: none !important;
    }
}

/* ==================== 底部固定導航 ==================== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
        z-index: 1030;
        padding: 6px 4px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        color: #6c757d;
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        transition: all 0.2s ease;
        border-radius: 10px;
        margin: 0 2px;
        min-height: 52px;
        position: relative;
    }
    
    .mobile-bottom-nav a i {
        font-size: 1.35rem;
        transition: transform 0.2s ease;
    }
    
    .mobile-bottom-nav a span {
        line-height: 1;
        white-space: nowrap;
    }
    
    /* Hover 效果 */
    .mobile-bottom-nav a:hover {
        color: #003366;
        background: rgba(0, 51, 102, 0.06);
    }
    
    .mobile-bottom-nav a:hover i {
        transform: translateY(-2px);
    }
    
    /* Active 狀態 */
    .mobile-bottom-nav a.active {
        color: #003366;
        background: linear-gradient(135deg, rgba(0, 91, 154, 0.12) 0%, rgba(0, 51, 102, 0.08) 100%);
    }
    
    .mobile-bottom-nav a.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        background: linear-gradient(90deg, #003366, #005B9A);
        border-radius: 0 0 3px 3px;
    }
    
    .mobile-bottom-nav a.active i {
        transform: scale(1.1);
    }
    
    /* 點擊反饋 */
    .mobile-bottom-nav a:active {
        transform: scale(0.95);
        background: rgba(0, 51, 102, 0.1);
    }
    
    /* Logo 按鈕樣式 */
    .mobile-bottom-nav .mobile-nav-logo {
        justify-content: center;
    }
    
    .mobile-bottom-nav .nav-logo-img {
        width: 26px;
        height: 26px;
        object-fit: contain;
        transition: transform 0.2s ease;
    }
    
    .mobile-bottom-nav .mobile-nav-logo:hover .nav-logo-img {
        transform: scale(1.1);
    }
    
    .mobile-bottom-nav .mobile-nav-logo.active .nav-logo-img {
        transform: scale(1.15);
        filter: drop-shadow(0 2px 4px rgba(0, 51, 102, 0.3));
    }
    
    /* 特殊按鈕高亮 - 大注分析 */
    .mobile-bottom-nav a[href="/big-bet-analysis"] {
        color: #1a5f2a;
    }
    
    .mobile-bottom-nav a[href="/big-bet-analysis"].active {
        color: #1a5f2a;
        background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(26, 95, 42, 0.1) 100%);
    }
    
    .mobile-bottom-nav a[href="/big-bet-analysis"].active::before {
        background: linear-gradient(90deg, #1a5f2a, #28a745);
    }
}

/* ==================== 橫向模式調整 ==================== */
@media (max-width: 767.98px) and (orientation: landscape) {
    .mobile-bottom-nav {
        padding: 4px 8px;
    }
    
    .mobile-bottom-nav a {
        min-height: 44px;
        padding: 4px;
    }
    
    .mobile-bottom-nav a i {
        font-size: 1.2rem;
    }
    
    .mobile-bottom-nav a span {
        font-size: 0.6rem;
    }
}

/* ==================== 大螢幕手機優化 ==================== */
@media (min-width: 414px) and (max-width: 767.98px) {
    .mobile-bottom-nav a {
        font-size: 0.7rem;
    }
    
    .mobile-bottom-nav a i {
        font-size: 1.4rem;
    }
}
