/* =================================
   Bottom Navigation Bar - Complete CSS
   ================================= */
:root {
    --primary-color: #2E4B9B!important;
    --secondary-color: #FF9500!important;
}

/* Main Navigation Container */
#bottomNav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Navigation Items Container */
#bottomNav > div {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 4rem;
    padding: 0 0.5rem;
    max-width: 100%;
}

/* Individual Navigation Item */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    color: #9ca3af;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 60px;
    cursor: pointer;
    text-decoration: none;
    border-radius: 0.75rem;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation Item SVG Icons */
.bottom-nav-item svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-width: 2;
}

/* Navigation Item Text Label */
.bottom-nav-item span {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
}

/* Hover State */
.bottom-nav-item:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.bottom-nav-item:hover svg {
    transform: scale(1.1);
}

/* Active State */
.bottom-nav-item.active {
    color: #ec4899;
    background-color: var(--secondary-color);
}

.bottom-nav-item.active svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px var(--secondary-color));
}

.bottom-nav-item.active span {
    font-weight: 700;
    font-size: 0.75rem;
}

/* Active Indicator Dot at Top */
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 50%;
    animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Pulse Animation for Active Dot */
@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1.5);
    }
}

/* Tap/Press Effect */
.bottom-nav-item:active {
    transform: scale(0.95);
}

/* Ripple Effect on Tap */
.bottom-nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(236, 72, 153, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.bottom-nav-item:active::after {
    width: 100px;
    height: 100px;
}

/* Notification Badge */
.bottom-nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    animation: bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1;
}

/* Badge Bounce Animation */
@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Top Border Gradient Effect */
#bottomNav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(236, 72, 153, 0.3) 50%, 
        transparent 100%
    );
}

/* Body Padding for Content Not Hidden */
@media (max-width: 1023px) {
    body {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    }
    
    main,
    .main-content,
    #app > div {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* Hide on Desktop/Tablet Landscape */
@media (min-width: 1024px) {
    #bottomNav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
    }
    
    main,
    .main-content,
    #app > div {
        padding-bottom: 0 !important;
    }
}

/* Loading State */
.bottom-nav-item.loading {
    pointer-events: none;
    opacity: 0.5;
}

.bottom-nav-item.loading svg,
.bottom-nav-item.loading span {
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

/* Disabled State */
.bottom-nav-item.disabled {
    pointer-events: none;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Focus Styles for Accessibility */
.bottom-nav-item:focus {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

.bottom-nav-item:focus:not(:focus-visible) {
    outline: none;
}

.bottom-nav-item:focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
    border-radius: 0.75rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    #bottomNav {
        background-color: rgba(17, 24, 39, 0.98);
        border-top-color: rgba(55, 65, 81, 0.5);
    }
    
    .bottom-nav-item {
        color: #9ca3af;
    }
    
    .bottom-nav-item:hover {
        color: var(--secondary-color);
    }
    
    .bottom-nav-item.active {
        color: white;
        background-color: var(--secondary-color);
    }
    
    #bottomNav::before {
        background: linear-gradient(90deg, 
            transparent 0%, 
            rgba(244, 114, 182, 0.3) 50%, 
            transparent 100%
        );
    }
}

/* Very Small Screens (iPhone SE, etc.) */
@media (max-width: 375px) {
    .bottom-nav-item {
        padding: 0.375rem 0.5rem;
        min-width: 50px;
    }
    
    .bottom-nav-item svg {
        width: 1.375rem;
        height: 1.375rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
}

/* Large Phones */
@media (min-width: 414px) and (max-width: 1023px) {
    .bottom-nav-item {
        padding: 0.625rem 1rem;
        min-width: 70px;
    }
    
    .bottom-nav-item span {
        font-size: 0.75rem;
    }
}

/* Landscape Mode on Phones */
@media (max-height: 500px) and (orientation: landscape) {
    #bottomNav > div {
        height: 3.5rem;
    }
    
    .bottom-nav-item {
        padding: 0.375rem 0.625rem;
    }
    
    .bottom-nav-item svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.625rem;
        margin-top: 0.125rem;
    }
}

/* iOS Safe Area Specific */
@supports (padding: env(safe-area-inset-bottom)) {
    #bottomNav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-padding-bottom: calc(4rem + env(safe-area-inset-bottom));
}

/* Prevent Scrolling Behind Nav */
body.nav-open {
    overflow: hidden;
}

/* Transition for Route Changes */
.bottom-nav-item {
    will-change: transform, color;
}

/* Performance Optimization */
#bottomNav {
    contain: layout style paint;
    will-change: transform;
}

/* Print Styles */
@media print {
    #bottomNav {
        display: none !important;
    }
    
    body {
        padding-bottom: 0 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bottom-nav-item {
        border: 1px solid transparent;
    }
    
    .bottom-nav-item.active {
        border-color: #ec4899;
        background-color: rgba(236, 72, 153, 0.1);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bottom-nav-item,
    .bottom-nav-item svg,
    .bottom-nav-item span,
    .bottom-nav-item::before,
    .bottom-nav-item::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Custom Scrollbar (if content scrolls) */
::-webkit-scrollbar {
    width: 0;
}

/* Hover Effect Enhancement for Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .bottom-nav-item:hover {
        transform: none;
    }
    
    .bottom-nav-item:hover svg {
        transform: none;
    }
}