/* Bottom Navigation Bar - Mobile Only */

:root {
    --brand1: #15c0ff;
    --brand2: #6f46ff;
    --brand3: #00d4a6;
    --primary-gradient: linear-gradient(135deg, var(--brand1) 0%, var(--brand2) 55%, var(--brand3) 100%);
    --active-accent: #a7f3ff;
    --hover-overlay: rgba(255, 255, 255, 0.10);
}

/* Animation for bottom sheet */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Desktop - Hide bottom nav by default */
.bottom-nav,
.bottom-sheet-overlay,
.bottom-sheet {
    display: none;
}

/* ===== MOBILE ONLY (max-width: 768px) ===== */
@media (max-width: 768px) {

    /* Bottom Navigation Bar */
    .bottom-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--primary-gradient);
        backdrop-filter: blur(20px);
        border-top: 2px solid rgba(255, 255, 255, 0.18);
        box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
        z-index: 800;
        padding: 6px 10px calc(env(safe-area-inset-bottom, 0px));
        margin: 0;
        height: 80px;
        border-top-left-radius: 14px;
        border-top-right-radius: 14px;
    }

    .bottom-nav .nav-items {
        display: flex;
        justify-content: space-around;
        align-items: center;
        list-style: none;
        margin: 0;
        padding: 0;
        height: 100%;
        width: 100%;
    }

    .bottom-nav .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        text-decoration: none;
        color: rgba(255, 255, 255, 0.7);
        font-size: 12px;
        transition: all 0.3s ease;
        border-bottom: 3px solid transparent;
        overflow: hidden;
        padding: 10px 0;
        gap: 6px;
    }

    .bottom-nav .nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        background: linear-gradient(180deg, var(--hover-overlay), transparent);
        transition: opacity 0.3s ease;
        z-index: -1;
    }

    .bottom-nav .nav-item:hover::before {
        opacity: 1;
    }

    .bottom-nav .nav-item:hover {
        color: #ffffff;
    }

    .bottom-nav .nav-item.active {
        color: #ffffff;
        border-bottom-color: var(--active-accent);
        background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
        font-weight: 600;
        box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 6px 16px rgba(0,0,0,0.12);
        border-radius: 10px;
    }

    .bottom-nav .nav-item i {
        font-size: 26px;
        margin-bottom: 0;
        color: inherit;
    }

    .bottom-nav .nav-item span {
        font-size: 11px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        padding: 0 2px;
        line-height: 1;
    }

    /* Adjust main content for bottom nav */
    body {
        padding-bottom: 0;
    }

    .main-content {
        padding-bottom: 96px !important;
        margin-bottom: 0 !important;
    }

    /* Bottom Sheet Menu - More Options */
    .bottom-sheet-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 798;
    }

    .bottom-sheet-overlay.show {
        display: block;
    }

    .bottom-sheet {
        display: none;
        position: fixed;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 34px rgba(0, 0, 0, 0.18);
        z-index: 799;
        max-height: 80vh;
        overflow-y: auto;
    }

    .bottom-sheet.show {
        display: block;
        animation: slideUp 0.3s ease;
    }

    .bottom-sheet-content {
        padding: 20px;
    }

    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 12px auto;
    }

    .bottom-sheet-item {
        display: flex;
        align-items: center;
        padding: 15px 0;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
        transition: all 0.2s ease;
    }

    .bottom-sheet-item:last-child {
        border-bottom: none;
    }

    .bottom-sheet-item i {
        font-size: 20px;
        margin-right: 15px;
        color: #667eea;
        min-width: 24px;
        flex-shrink: 0;
    }

    .bottom-sheet-item span {
        flex: 1;
        font-weight: 500;
    }

    .bottom-sheet-item:hover {
        background: #f8f9fa;
        padding-left: 10px;
    }

    /* RTL Support */
    [dir="rtl"] .bottom-nav {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .bottom-sheet {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .bottom-sheet-item i {
        margin-right: auto;
        margin-left: 15px;
    }

    [dir="rtl"] .bottom-sheet-item:hover {
        padding-left: 0;
        padding-right: 10px;
    }

}

/* Ensure fixed positioning on larger mobile/tablet widths */
@media (max-width: 1024px) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
    }
}

/* Extra small phones (max-width: 480px) */
@media (max-width: 480px) {
    .bottom-nav .nav-item span {
        font-size: 10px;
    }

    .bottom-nav .nav-item i {
        font-size: 20px;
    }

    .main-content {
        padding-bottom: 90px !important;
    }
}
