/**
 * StatsBet Mobile Popup Navigation Styles
 *
 * This stylesheet handles all styling for the mobile bottom navigation bar.
 * Uses CSS custom properties (variables) for easy theming.
 */

/* ==========================================================================
   CSS Variables / Theming
   ========================================================================== */

:root {
    /* Colors */
    --statsbet-nav-bg: #1a1a2e;
    --statsbet-nav-bg-blur: rgba(26, 26, 46, 0.95);
    --statsbet-nav-border: rgba(255, 255, 255, 0.1);
    --statsbet-nav-text: #FFCC00;
    --statsbet-nav-text-active: #4ade80;
    --statsbet-nav-icon: #a0a0a0;
    --statsbet-nav-icon-active: #4ade80;
    --statsbet-nav-badge-bg: #ef4444;
    --statsbet-nav-badge-text: #ffffff;
    --statsbet-nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);

    /* Sizing */
    --statsbet-nav-height: 64px;
    --statsbet-nav-icon-size: 24px;
    --statsbet-nav-font-size: 11px;
    --statsbet-nav-badge-size: 18px;
    --statsbet-nav-badge-font-size: 10px;
    --statsbet-nav-item-padding: 8px 4px;

    /* Animation */
    --statsbet-nav-transition: 0.2s ease;

    /* Z-index */
    --statsbet-nav-z-index: 9999;

    /* Safe area inset for devices with notches */
    --statsbet-nav-safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Light theme override (optional - add class to body) */
.statsbet-theme-light {
    --statsbet-nav-bg: #ffffff;
    --statsbet-nav-bg-blur: rgba(255, 255, 255, 0.95);
    --statsbet-nav-border: rgba(0, 0, 0, 0.1);
    --statsbet-nav-text: #6b7280;
    --statsbet-nav-text-active: #1f2937;
    --statsbet-nav-icon: #6b7280;
    --statsbet-nav-icon-active: #10b981;
    --statsbet-nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Mobile Navigation Container
   ========================================================================== */

.statsbet-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--statsbet-nav-z-index);
    background-color: var(--statsbet-nav-bg);
    background-color: var(--statsbet-nav-bg-blur);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--statsbet-nav-border);
    box-shadow: var(--statsbet-nav-shadow);
    padding-bottom: var(--statsbet-nav-safe-area-bottom);

    /* Hide on desktop by default */
    display: none;
}

/* Show only on mobile (matching wp_is_mobile() breakpoint ~782px) */
@media screen and (max-width: 782px) {
    .statsbet-mobile-nav {
        display: block;
    }

    /* Add bottom padding to body to prevent content overlap */
    body {
        padding-bottom: calc(var(--statsbet-nav-height) + var(--statsbet-nav-safe-area-bottom)) !important;
    }
}

/* ==========================================================================
   Navigation Container (Flexbox Layout)
   ========================================================================== */

.statsbet-mobile-nav__container {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: var(--statsbet-nav-height);
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* ==========================================================================
   Navigation Items
   ========================================================================== */

.statsbet-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    padding: var(--statsbet-nav-item-padding);
    text-decoration: none !important;
    color: var(--statsbet-nav-text) !important;
    transition: color var(--statsbet-nav-transition),
                transform var(--statsbet-nav-transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    background: transparent !important;
}

/* Hover state */
.statsbet-mobile-nav__item:hover {
    color: var(--statsbet-nav-text-active) !important;
}

/* Active/Current state */
.statsbet-mobile-nav__item--active {
    color: var(--statsbet-nav-text-active) !important;
}

.statsbet-mobile-nav__item--active .statsbet-mobile-nav__icon {
    color: var(--statsbet-nav-icon-active) !important;
}

/* Touch feedback */
.statsbet-mobile-nav__item:active {
    transform: scale(0.95);
}

/* Focus state for accessibility */
.statsbet-mobile-nav__item:focus {
    outline: none;
}

.statsbet-mobile-nav__item:focus-visible {
    outline: 2px solid var(--statsbet-nav-icon-active);
    outline-offset: -2px;
    border-radius: 4px;
}

/* ==========================================================================
   Icon Container
   ========================================================================== */

.statsbet-mobile-nav__icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--statsbet-nav-icon-size);
    height: var(--statsbet-nav-icon-size);
    margin-bottom: 4px;
    color: var(--statsbet-nav-icon) !important;
    transition: color var(--statsbet-nav-transition),
                transform var(--statsbet-nav-transition);
}

.statsbet-mobile-nav__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor !important;
}

/* Icon active state */
.statsbet-mobile-nav__item--active .statsbet-mobile-nav__icon {
    color: var(--statsbet-nav-icon-active) !important;
    transform: scale(1.1);
}

/* ==========================================================================
   Badge Styling
   ========================================================================== */

.statsbet-mobile-nav__badge {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: var(--statsbet-nav-badge-size);
    height: var(--statsbet-nav-badge-size);
    padding: 0 5px;
    background-color: var(--statsbet-nav-badge-bg);
    color: var(--statsbet-nav-badge-text);
    font-size: var(--statsbet-nav-badge-font-size);
    font-weight: 600;
    line-height: var(--statsbet-nav-badge-size);
    text-align: center;
    border-radius: calc(var(--statsbet-nav-badge-size) / 2);
    box-sizing: border-box;
    animation: statsbet-badge-pulse 2s infinite;
}

/* Badge pulse animation */
@keyframes statsbet-badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ==========================================================================
   Label Styling
   ========================================================================== */

.statsbet-mobile-nav__label {
    font-size: var(--statsbet-nav-font-size);
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    color: inherit !important;
}

/* ==========================================================================
   External Link Indicator
   ========================================================================== */

.statsbet-mobile-nav__item--external::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    opacity: 0.5;
}

/* ==========================================================================
   Landscape Mode Adjustments
   ========================================================================== */

@media screen and (max-width: 782px) and (orientation: landscape) {
    :root {
        --statsbet-nav-height: 52px;
        --statsbet-nav-icon-size: 20px;
        --statsbet-nav-font-size: 10px;
    }
}

/* ==========================================================================
   Small Screen Adjustments
   ========================================================================== */

@media screen and (max-width: 360px) {
    :root {
        --statsbet-nav-font-size: 10px;
        --statsbet-nav-icon-size: 22px;
    }

    .statsbet-mobile-nav__label {
        max-width: 60px;
    }
}

/* ==========================================================================
   Reduced Motion Preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .statsbet-mobile-nav__item,
    .statsbet-mobile-nav__icon,
    .statsbet-mobile-nav__badge {
        transition: none;
        animation: none;
    }
}

/* ==========================================================================
   Print Styles - Hide navigation when printing
   ========================================================================== */

@media print {
    .statsbet-mobile-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .statsbet-mobile-nav {
        border-top-width: 2px;
    }

    .statsbet-mobile-nav__item:focus-visible {
        outline-width: 3px;
    }

    .statsbet-mobile-nav__badge {
        border: 1px solid var(--statsbet-nav-badge-text);
    }
}

/* ==========================================================================
   Dark Mode Media Query Support
   ========================================================================== */

@media (prefers-color-scheme: light) {
    .statsbet-auto-theme {
        --statsbet-nav-bg: #ffffff;
        --statsbet-nav-bg-blur: rgba(255, 255, 255, 0.95);
        --statsbet-nav-border: rgba(0, 0, 0, 0.1);
        --statsbet-nav-text: #6b7280;
        --statsbet-nav-text-active: #1f2937;
        --statsbet-nav-icon: #6b7280;
        --statsbet-nav-icon-active: #10b981;
        --statsbet-nav-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }
}
