/* Bottom Navigation Component */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 950;
    /* Above canvas, below modals */
    background: linear-gradient(180deg, rgba(26, 22, 37, 0.95) 0%, rgba(20, 20, 30, 0.98) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(100, 100, 150, 0.3);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.5);

    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    pointer-events: auto;

    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hidden state */
.bottom-nav--hidden {
    transform: translateY(100%);
}

/* Tab Button */
.bottom-nav__tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-height: 48px;
    padding: 4px 8px;
    margin: 0 2px;

    background: transparent;
    border: none;
    border-radius: 8px;
    color: #94a3b8;

    cursor: pointer;
    position: relative;
    overflow: hidden;

    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Icon */
.bottom-nav__icon {
    font-size: 24px;
    line-height: 1;
    transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Label */
.bottom-nav__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover state (desktop only) */
@media (hover: hover) {
    .bottom-nav__tab:hover:not(.bottom-nav__tab--active) {
        background: rgba(124, 92, 219, 0.1);
        color: #fff;
    }
}

/* Active state */
.bottom-nav__tab--active {
    color: #7c5cdb;
}

.bottom-nav__tab--active .bottom-nav__icon {
    transform: scale(1.1);
}

.bottom-nav__tab--active .bottom-nav__label {
    color: #7c5cdb;
}

/* Focus state (keyboard navigation) */
.bottom-nav__tab:focus-visible {
    outline: 2px solid #7c5cdb;
    outline-offset: 2px;
}

/* Ripple effect */
.bottom-nav__ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(124, 92, 219, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: ripple-animation 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ripple-animation {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Badge (notification count) */
.bottom-nav__badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;

    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    line-height: 18px;
    text-align: center;

    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    pointer-events: none;
}

/* Safe area support (iOS notch, Android gestures) */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        height: calc(64px + env(safe-area-inset-bottom));
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .bottom-nav {
        height: 72px;
        padding: 0 16px;
    }

    .bottom-nav__tab {
        gap: 8px;
    }

    .bottom-nav__icon {
        font-size: 28px;
    }

    .bottom-nav__label {
        font-size: 13px;
    }
}

/* Desktop: Hide bottom nav */
@media (min-width: 1024px) {
    .bottom-nav {
        display: none;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .bottom-nav,
    .bottom-nav__tab,
    .bottom-nav__icon,
    .bottom-nav__label {
        transition: none;
    }

    .bottom-nav__ripple {
        animation: none;
        opacity: 0;
    }

    .bottom-nav__tab--active .bottom-nav__icon {
        transform: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: light) {
    .bottom-nav {
        background: linear-gradient(180deg, rgba(240, 240, 245, 0.95) 0%, rgba(230, 230, 240, 0.98) 100%);
        border-top-color: rgba(0, 0, 0, 0.1);
    }

    .bottom-nav__tab {
        color: rgba(0, 0, 0, 0.6);
    }

    .bottom-nav__tab--active {
        color: var(--ui-primary);
    }
}