/* Modern Bottom Navigation Bar - Mobile App Style */

/* Bottom Navigation Container */
.fixed.bottom-0 {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation Items Container */
.fixed.bottom-0 .flex {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 64px;
    max-width: 100%;
    margin: 0 auto;
}

/* Individual Navigation Items */
.fixed.bottom-0 a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 4px;
    margin: 0 2px;
    border-radius: 16px;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 48px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation Icons */
.fixed.bottom-0 i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
}

/* Navigation Labels */
.fixed.bottom-0 span {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

/* Hover Effects */
.fixed.bottom-0 a:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    transform: translateY(-2px);
}

.fixed.bottom-0 a:hover i {
    transform: scale(1.1);
    color: #3b82f6;
}

.fixed.bottom-0 a:hover span {
    color: #3b82f6;
}

/* Active State */
.fixed.bottom-0 a.active {
    color: #2563eb;
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.fixed.bottom-0 a.active i {
    color: #2563eb;
    transform: scale(1.1);
}

.fixed.bottom-0 a.active span {
    color: #2563eb;
    font-weight: 600;
}

/* Active State Background */
.fixed.bottom-0 a.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.1),
        rgba(59, 130, 246, 0.05)
    );
    border-radius: 16px;
    z-index: -1;
}

/* Touch/Press Effects */
.fixed.bottom-0 a:active {
    transform: translateY(0) scale(0.95);
    background: rgba(59, 130, 246, 0.15);
    transition: all 0.1s ease;
}

/* Ripple Effect */
.fixed.bottom-0 a::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    z-index: -1;
}

.fixed.bottom-0 a:active::after {
    width: 100px;
    height: 100px;
}

/* Floating Indicator for Active Item */
.fixed.bottom-0 a.active::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

/* Smooth Transitions */
.fixed.bottom-0 * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile-Specific Enhancements */
@media (max-width: 768px) {
    .fixed.bottom-0 {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .fixed.bottom-0 .flex {
        height: 72px;
    }

    .fixed.bottom-0 a {
        min-height: 56px;
        padding: 10px 6px;
    }

    .fixed.bottom-0 i {
        font-size: 1.375rem;
        margin-bottom: 6px;
    }

    .fixed.bottom-0 span {
        font-size: 0.8125rem;
    }
}

/* Tablet Enhancements */
@media (min-width: 769px) and (max-width: 1024px) {
    .fixed.bottom-0 {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 24px 24px 0 0;
        margin: 0 16px;
    }
}

/* Desktop - Hide Bottom Navigation */
@media (min-width: 1025px) {
    .fixed.bottom-0 {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .fixed.bottom-0 {
        background: rgba(31, 41, 55, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .fixed.bottom-0 a {
        color: #9ca3af;
    }

    .fixed.bottom-0 a:hover {
        background: rgba(96, 165, 250, 0.1);
        color: #60a5fa;
    }

    .fixed.bottom-0 a.active {
        color: #60a5fa;
        background: rgba(96, 165, 250, 0.15);
    }

    .fixed.bottom-0 a.active::before {
        background: #60a5fa;
        box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
    }
}

/* iOS Safari Specific */
@supports (-webkit-touch-callout: none) {
    .fixed.bottom-0 {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* Android Specific */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .fixed.bottom-0 {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .fixed.bottom-0 {
        border-top-width: 0.5px;
    }
}

/* Animation Classes */
.fixed.bottom-0.fade-in {
    animation: slideUpFade 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fixed.bottom-0.fade-out {
    animation: slideDownFade 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Hover Effects for Non-Touch Devices */
@media (hover: hover) and (pointer: fine) {
    .fixed.bottom-0 a:hover {
        background: rgba(59, 130, 246, 0.08);
        transform: translateY(-3px);
    }

    .fixed.bottom-0 a:hover i {
        transform: scale(1.15);
    }
}

/* Focus States for Accessibility */
.fixed.bottom-0 a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    border-radius: 16px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .fixed.bottom-0 *,
    .fixed.bottom-0 a,
    .fixed.bottom-0 i,
    .fixed.bottom-0 span {
        transition: none;
        animation: none;
    }

    .fixed.bottom-0 a:hover,
    .fixed.bottom-0 a:active {
        transform: none;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    /* Ensure content doesn't overlap with bottom navigation */
    main {
        padding-bottom: 5rem !important;
    }

    /* Better touch feedback */
    .fixed.bottom-0 a:active {
        transform: scale(0.95);
    }

    /* Improve mobile header */
    .md\\:hidden .bg-blue-600 {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .fixed.bottom-0 {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .md\\:hidden .bg-blue-600 {
        padding-top: calc(0.75rem + env(safe-area-inset-top));
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .fixed.bottom-0 {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .fixed.bottom-0 {
        border-top-width: 0.5px;
    }
}
