/* ============================================
   MOBILE BOTTOM NAVIGATION
   Modern Bottom Menu with Icons
   ============================================ */

/* Bottom Navigation Wrapper */
#mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    width: 100% !important;
    transform: translateY(0) !important;
}

/* Bottom Navigation Container */
.mobile-bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 -8px 32px 0 rgba(31, 38, 135, 0.25),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    padding: 0.5rem 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    min-height: 70px;
    width: 100%;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom Nav Item */
.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    flex: 1;
    max-width: 80px;
    min-height: 60px;
    cursor: pointer;
    border: none;
    background: transparent;
    overflow: visible;
}

/* Premium Ripple Effect */
.mobile-bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
}

.mobile-bottom-nav-item:active::before {
    width: 100px;
    height: 100px;
    opacity: 1;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

.mobile-bottom-nav-item:active {
    transform: scale(0.92) translateY(-2px);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-bottom-nav-item.active {
    color: #2563eb;
    animation: pulseActive 2s ease-in-out infinite;
}

@keyframes pulseActive {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-icon {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
    transform: scale(1.15) translateY(-2px);
    box-shadow: 
        0 8px 16px rgba(37, 99, 235, 0.25),
        0 0 0 4px rgba(37, 99, 235, 0.1);
    animation: iconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.25) translateY(-4px);
    }
    100% {
        transform: scale(1.15) translateY(-2px);
    }
}

/* Icon Container */
.mobile-bottom-nav-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: rgba(243, 244, 246, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    font-size: 1.25rem;
    overflow: visible;
}

.mobile-bottom-nav-icon i {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

.mobile-bottom-nav-item:hover .mobile-bottom-nav-icon {
    background: rgba(37, 99, 235, 0.12);
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
}

.mobile-bottom-nav-item:hover .mobile-bottom-nav-icon i {
    transform: scale(1.1) rotate(5deg);
}

.mobile-bottom-nav-item:active .mobile-bottom-nav-icon {
    background: rgba(37, 99, 235, 0.2);
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-bottom-nav-item:active .mobile-bottom-nav-icon i {
    transform: scale(0.9);
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(99, 102, 241, 0.15));
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.3),
        0 0 0 4px rgba(37, 99, 235, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Label */
.mobile-bottom-nav-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.mobile-bottom-nav-item:hover .mobile-bottom-nav-label {
    transform: translateY(-2px);
    color: #2563eb;
}

.mobile-bottom-nav-item.active .mobile-bottom-nav-label {
    color: #2563eb;
    font-weight: 700;
    transform: translateY(-1px);
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
    animation: labelGlow 2s ease-in-out infinite;
}

@keyframes labelGlow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Badge */
.mobile-bottom-nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 
        0 4px 12px rgba(239, 68, 68, 0.4),
        0 0 0 2px rgba(239, 68, 68, 0.2);
    z-index: 10;
    animation: badgePulse 2s ease-in-out infinite;
    transform-origin: center;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 4px 12px rgba(239, 68, 68, 0.4),
            0 0 0 2px rgba(239, 68, 68, 0.2);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 6px 16px rgba(239, 68, 68, 0.5),
            0 0 0 3px rgba(239, 68, 68, 0.3);
    }
}

.mobile-bottom-nav-badge:not(:empty) {
    display: flex;
    animation: badgeAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeAppear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.mobile-bottom-nav-item:hover .mobile-bottom-nav-badge {
    transform: scale(1.15);
    animation: badgeBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeBounce {
    0%, 100% {
        transform: scale(1.15) translateY(0);
    }
    50% {
        transform: scale(1.25) translateY(-4px);
    }
}

/* More Button */
.mobile-bottom-nav-more .mobile-bottom-nav-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(99, 102, 241, 0.1));
    color: #2563eb;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-bottom-nav-more:hover .mobile-bottom-nav-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(99, 102, 241, 0.15));
    transform: scale(1.1) translateY(-3px) rotate(90deg);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.mobile-bottom-nav-more:hover .mobile-bottom-nav-icon i {
    transform: scale(1.2);
}

.mobile-bottom-nav-more.active .mobile-bottom-nav-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(99, 102, 241, 0.25));
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.4),
        0 0 0 4px rgba(37, 99, 235, 0.15);
    transform: scale(1.15) translateY(-2px) rotate(180deg);
    animation: moreButtonSpin 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes moreButtonSpin {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
    50% {
        transform: scale(1.2) translateY(-4px) rotate(90deg);
    }
    100% {
        transform: scale(1.15) translateY(-2px) rotate(180deg);
    }
}

/* ============================================
   MOBILE MORE MENU POPUP
   Windows 11 Glass Style
   ============================================ */

.mobile-more-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.mobile-more-menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.mobile-more-menu-overlay.hidden {
    display: none;
}

.mobile-more-menu-content {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-top-left-radius: 2rem;
    border-top-right-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    box-shadow: 
        0 -8px 32px 0 rgba(31, 38, 135, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    animation: slideUpFromBottom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpFromBottom {
    from { 
        transform: translateY(100%);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.mobile-more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.mobile-more-menu-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.mobile-more-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 244, 246, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.4);
    border-radius: 0.75rem;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
}

.mobile-more-menu-close:hover {
    background: rgba(229, 231, 235, 0.8);
    color: #374151;
    transform: scale(1.1);
}

.mobile-more-menu-close:active {
    transform: scale(0.95);
}

/* Grid */
.mobile-more-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Menu Item */
.mobile-more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.15);
    min-height: 100px;
    position: relative;
}

.mobile-more-menu-item:active {
    transform: scale(0.95);
}

.mobile-more-menu-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.25);
}

/* Icon in More Menu */
.mobile-more-menu-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(243, 244, 246, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 1.5rem;
    color: #6b7280;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-more-menu-item:hover .mobile-more-menu-icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    transform: scale(1.1);
}

/* Color variants for icons */
.mobile-more-menu-item[data-color="blue"]:hover .mobile-more-menu-icon {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

.mobile-more-menu-item[data-color="red"]:hover .mobile-more-menu-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.mobile-more-menu-item[data-color="green"]:hover .mobile-more-menu-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.mobile-more-menu-item[data-color="purple"]:hover .mobile-more-menu-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.mobile-more-menu-item[data-color="indigo"]:hover .mobile-more-menu-icon {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

/* Label in More Menu */
.mobile-more-menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #374151;
    line-height: 1.3;
}

.mobile-more-menu-item:hover .mobile-more-menu-label {
    color: #1f2937;
    font-weight: 700;
}

/* Badge in More Menu */
.mobile-more-menu-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 0.375rem;
    background: #ef4444;
    color: white;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-more-menu-badge:not(:empty) {
    display: flex;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Hide on desktop */
@media (min-width: 1280px) {
    #mobile-bottom-nav {
        display: none !important;
    }
}

/* Adjust for smaller screens */
@media (max-width: 375px) {
    .mobile-bottom-nav-label {
        font-size: 0.5625rem;
    }
    
    .mobile-bottom-nav-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .mobile-more-menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Add padding to body when bottom nav is visible */
@media (max-width: 1279px) {
    body {
        padding-bottom: 70px !important;
    }
    
    /* Ensure nav stays at bottom on scroll - Force positioning */
    #mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        will-change: transform;
        transform: translateY(0) !important;
        margin: 0 !important;
    }
    
    /* Ensure mobile more menu is at bottom */
    .mobile-more-menu-overlay {
        position: fixed !important;
        bottom: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .mobile-more-menu-content {
        position: absolute !important;
        bottom: 0 !important;
        top: auto !important;
        margin-top: 0 !important;
    }
    
    /* Prevent any transforms that might move it */
    .mobile-bottom-nav-container {
        position: relative !important;
        bottom: auto !important;
        top: auto !important;
    }
    
    /* Smooth scroll behavior */
    html {
        scroll-behavior: smooth;
    }
}

/* Premium Hover Effects for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .mobile-bottom-nav-item:active {
        transform: scale(0.88) translateY(-1px);
    }
    
    .mobile-bottom-nav-item:active .mobile-bottom-nav-icon {
        transform: scale(0.9) translateY(0);
    }
}

/* Enhanced Active State with Glow */
.mobile-bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: activeGlow 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes activeGlow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

