/**
 * EXULO Mobile - Bottom Navigation CSS
 * 5-Tab Navigation Bar (4 anpassbar + Mehr-Menu)
 */

/* ============================================
   BOTTOM NAVIGATION BAR - Blue Theme
   ============================================ */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    /* Blue Theme Background */
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
    z-index: var(--z-nav);
    display: flex;
    align-items: flex-start;
}

.bottom-nav-inner {
    display: flex;
    width: 100%;
    height: var(--bottom-nav-height);
}

/* ============================================
   NAV TABS
   ============================================ */
.bottom-nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--spacing-xs) 0;
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bottom-nav-tab:active {
    transform: scale(0.95);
}

/* Active State - Blue Theme */
.bottom-nav-tab.active {
    color: rgb(96, 165, 250); /* Lighter blue for visibility */
}

.bottom-nav-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.5), rgb(96, 165, 250), rgba(59, 130, 246, 0.5));
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Tab Icon */
.nav-tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

/* Tab Label */
.nav-tab-label {
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    line-height: 1;
    letter-spacing: 0.2px;
}

/* Badge on Tab */
.nav-tab-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
    font-weight: var(--font-weight-bold);
    color: #fff;
    background: var(--color-danger);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animated Badge */
.nav-tab-badge.animated {
    animation: badge-bounce 0.5s ease;
}

@keyframes badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================
   MORE MENU BUTTON
   ============================================ */
.bottom-nav-tab.more-menu-btn {
    position: relative;
}

.bottom-nav-tab.more-menu-btn .nav-tab-icon {
    transition: transform var(--transition-fast);
}

.bottom-nav-tab.more-menu-btn.menu-open .nav-tab-icon {
    transform: rotate(90deg);
}

/* ============================================
   SLIDE-OUT MORE MENU
   ============================================ */
.more-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(var(--z-nav) - 2);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.more-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.more-menu {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    left: 0;
    right: 0;
    max-height: 70vh;
    max-height: 70dvh;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: calc(var(--z-nav) - 1);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    overflow: hidden;
}

/* Full-height Menu (extends to header) */
.more-menu.more-menu-fullheight {
    top: var(--header-height, 56px);
    bottom: calc(var(--bottom-nav-height, 60px) + var(--safe-area-bottom, 0px));
    max-height: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
}

.more-menu.more-menu-fullheight.active {
    transform: translateX(0);
}

.more-menu.active {
    transform: translateY(0);
}

/* Menu Handle */
.more-menu-handle {
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    margin: var(--spacing-sm) auto;
}

/* Menu Header */
.more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.more-menu-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.more-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.more-menu-close:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Menu Content */
.more-menu-content {
    padding: var(--spacing-md);
    overflow-y: auto;
    max-height: calc(70vh - 80px);
    max-height: calc(70dvh - 80px);
    display: flex;
    flex-direction: column;
}

/* Menu Section */
.more-menu-section {
    margin-bottom: var(--spacing-lg);
}

.more-menu-section:last-child {
    margin-bottom: 0;
}

.more-menu-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--spacing-xs) 0;
    margin-bottom: var(--spacing-sm);
}

/* Menu Grid */
.more-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

/* Menu Item */
.more-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md) var(--spacing-sm);
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.more-menu-item:active {
    transform: scale(0.95);
    background: var(--bg-card-elevated);
    border-color: var(--border-color);
}

.more-menu-item-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.more-menu-item-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-align: center;
    line-height: 1.2;
}

/* Menu Item with Badge */
.more-menu-item .item-badge {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: #fff;
    background: var(--color-danger);
    border-radius: var(--radius-full);
}

/* Item Position for Badge */
.more-menu-item {
    position: relative;
}

/* ============================================
   FLOATING ACTION BUTTON (Optional)
   ============================================ */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--spacing-md));
    right: var(--spacing-md);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    color: #000;
    font-size: 24px;
    cursor: pointer;
    z-index: var(--z-fixed);
    transition: all var(--transition-fast);
}

.fab:active {
    transform: scale(0.95);
}

/* FAB with expanded actions */
.fab-actions {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 80px);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: var(--z-fixed);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
}

.fab-actions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--text-primary);
    white-space: nowrap;
}

.fab-action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   NAV TRANSITION ANIMATIONS
   ============================================ */
@keyframes nav-item-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.bottom-nav-tab.pop {
    animation: nav-item-pop 0.3s ease;
}

/* ============================================
   LANDSCAPE MODE ADJUSTMENTS
   ============================================ */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-bottom-nav {
        height: 50px;
    }

    .bottom-nav-inner {
        height: 50px;
    }

    .nav-tab-label {
        display: none;
    }

    .nav-tab-icon {
        font-size: 24px;
    }
}

/* ============================================
   TABLET MODE (Optional Side Nav)
   ============================================ */
@media (min-width: 768px) {
    /* Could convert to side navigation on tablet */
    .mobile-bottom-nav {
        /* Keep bottom nav even on tablet for consistency */
    }
}

/* ============================================
   MORE MENU - 2-COLUMN CARD GRID
   ============================================ */
.more-menu .more-menu-grid-2col {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(8, 1fr); /* 8 rows, auto-distribute height */
    gap: 3px;
    padding: 3px;
    flex: 1; /* Fill available space */
    min-height: 0; /* Allow shrinking */
}

.more-menu .more-menu-card {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    background: var(--bg-input, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary, #fff);
    transition: all var(--transition-fast, 0.15s);
    position: relative;
    min-height: 0; /* Let grid control height */
}

.more-menu-card:active,
.more-menu-card:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgb(96, 165, 250);
    transform: scale(0.98);
}

.more-menu-card.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgb(96, 165, 250);
    color: rgb(147, 197, 253);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.more-menu-card-icon {
    font-size: 20px;
    line-height: 1;
}

.more-menu-card-label {
    font-size: 10px;
    font-weight: var(--font-weight-medium, 500);
    text-align: center;
    line-height: 1.1;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.more-menu-card.active .more-menu-card-label {
    color: rgb(147, 197, 253);
}

.more-menu-card-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: var(--font-weight-bold, 700);
    color: #fff;
    background: var(--color-danger, #ff4444);
    border-radius: var(--radius-full, 9999px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   MORE MENU - FOOTER (1:1 wie Desktop)
   ============================================ */
.more-menu-footer {
    margin-top: auto;
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

/* Linke Seite: Copyright, Mem, Online */
.more-menu-footer-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 11px;
    color: var(--text-muted);
}

.more-menu-footer-left .footer-copyright {
    color: var(--text-secondary);
}

.more-menu-footer-left .footer-separator {
    opacity: 0.5;
}

.more-menu-footer-left .footer-debug {
    color: var(--text-muted);
}

.more-menu-footer-left .online-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.more-menu-footer-left .online-indicator {
    font-size: 8px;
}

.more-menu-footer-left .online-count {
    color: var(--text-secondary);
}

/* Rechte Seite: Links */
.more-menu-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 11px;
    line-height: 1.6;
}

.more-menu-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.more-menu-footer-links a:hover,
.more-menu-footer-links a:active {
    color: var(--color-primary);
}

.more-menu-footer-links .footer-divider {
    color: var(--text-muted);
    opacity: 0.4;
}

/* Full-height menu content adjustment */
.more-menu-fullheight .more-menu-content {
    flex: 1;
    overflow: hidden; /* Changed from auto to prevent scrolling */
    max-height: none;
    display: flex;
    flex-direction: column;
    padding: 3px; /* Reduced padding */
}

/* Grid fills available space in fullheight menu */
.more-menu-fullheight .more-menu-grid-2col {
    flex: 1;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 3px;
    padding: 0;
    min-height: 0;
    height: 100%; /* Explicit height */
}

/* Cards stretch to fill grid cells */
.more-menu-fullheight .more-menu-card {
    height: 100%;
    min-height: 0;
}

.more-menu-fullheight .more-menu-handle {
    display: none;
}
