/* Bottom Navigation Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    border-top: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15), 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 0.4rem 0.75rem calc(0.25rem + env(safe-area-inset-bottom));
    border-radius: 20px 20px 20px 20px;
    overflow: visible;
    min-height: 44px;
    width: calc(100% - 4rem);
    max-width: 450px;
    margin: 0 auto;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    gap: 0.5rem;
    position: relative;
    overflow: visible;
    height: 100%;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    color: #1d4ed8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 0;
    background-color: transparent;
    min-width: fit-content;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    color: #3b82f6;
    background: linear-gradient(135deg, #1d4ed8, #2563eb, #3b82f6, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.35));
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: #2563eb;
    max-width: 0;
    opacity: 0;
    margin-top: 0;
    height: 0;
    display: block;
}

/* Active state - show text and circular background */
.bottom-nav-item.active {
    color: #1d4ed8;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.75));
    border: 1px solid #2563eb;
    border-radius: 50%;
    z-index: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.bottom-nav-item.active i {
    position: absolute;
    top: calc(-20px + 21px);
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-item.active span {
    max-width: 100px;
    opacity: 1;
    height: auto;
    margin-top: 1.8rem;
    position: relative;
    z-index: 2;
    display: block;
    font-size: 0.65rem;
}

/* Compact nav bar when active */
.bottom-nav:has(.active) {
    padding: 0.35rem 0.75rem calc(0.25rem + env(safe-area-inset-bottom));
    min-height: 65px;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item:hover:not(.active) {
    opacity: 0.8;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
        width: calc(100% - 3rem);
        max-width: 450px;
        bottom: 0.75rem;
    }
    
    .main-content {
        padding-bottom: 120px !important;
    }
    
    /* Compact padding when active */
    .bottom-nav:has(.active) ~ * .main-content,
    body:has(.bottom-nav:has(.active)) .main-content {
        padding-bottom: 140px !important;
    }
}

/* Desktop - Hide Bottom Nav */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}

/* Dark Mode for Bottom Nav */
body.dark-mode .bottom-nav {
    background-color: #1a1a1a !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5), 0 -2px 8px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid #404040 !important;
}

body.dark-mode .bottom-nav-item {
    color: #ffffff !important;
}

body.dark-mode .bottom-nav-item i {
    color: #7dd3fc !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    text-fill-color: currentColor !important;
    filter: drop-shadow(0 4px 10px rgba(59, 130, 246, 0.45));
}

body.dark-mode .bottom-nav-item span {
    color: #ffffff !important;
}

body.dark-mode .bottom-nav-item.active {
    color: #ffffff !important;
}

body.dark-mode .bottom-nav-item.active i {
    color: #7dd3fc !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    text-fill-color: currentColor !important;
    filter: drop-shadow(0 4px 10px rgba(59, 130, 246, 0.45));
}

body.dark-mode .bottom-nav-item.active span {
    color: #ffffff !important;
}

body.dark-mode .bottom-nav-item.active::before {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

