/* ===========================
   MODERN BOTTOM NAVIGATION - FIXED
   =========================== */

:root {
    --navbar-height: 70px;
    --bottom-nav-height: 65px;
    --primary-green: #059669;
    --primary-green-dark: #047857;
    --accent-green: #10b981;
    --light-green: #bbf7d0;
    --bg-green: #f0f9f4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --white: #ffffff;
    --border-light: #e5e7eb;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --z-navbar: 1002;
    --z-bottom-nav: 1001;
}

/* ===========================
   DESKTOP NAVBAR
   =========================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.0);
    backdrop-filter: blur(12px);
    z-index: var(--z-navbar);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

.navbar-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.navbar-logo a:hover {
    transform: scale(1.05);
}

.navbar-logo svg {
    height: 24px;
    margin-right: 0.75rem;
    transition: var(--transition);
    fill: var(--white);
}

.navbar-logo span {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
}

.navbar.scrolled .navbar-logo span {
    color: var(--primary-green);
}

.navbar.scrolled .navbar-logo svg {
    fill: var(--primary-green);
}

.navbar-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 0.25rem;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.navbar.scrolled .navbar-link {
    color: var(--text-primary);
}

.navbar-link:hover {
    color: var(--primary-green);
    transform: translateY(-1px);
}

.navbar.scrolled .navbar-link:hover {
    color: var(--white);
    background: var(--primary-green);
    transform: none;
}

.navbar-link .link-title {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
}

/* ===========================
   MOBILE BOTTOM NAVIGATION - FIXED
   =========================== */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    z-index: var(--z-bottom-nav);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 12px;
    min-width: 60px;
    position: relative;
    
    /* FIXED: Remove all touch highlight and hover persistence */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    outline: none;
    touch-action: manipulation;
}

/* FIXED: Only apply hover on non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .bottom-nav-item:hover {
        color: var(--primary-green);
        background: rgba(5, 150, 105, 0.1);
        transform: translateY(-2px);
    }
    
    .bottom-nav-item.primary:hover .nav-icon {
        transform: scale(1.2);
        box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4);
    }
    
    /* Show tooltips only on hover-capable devices */
    .bottom-nav-item:hover::before {
        opacity: 1;
        visibility: visible;
    }
}

/* FIXED: Focus states for keyboard navigation only */
.bottom-nav-item:focus-visible {
    color: var(--primary-green);
    background: rgba(5, 150, 105, 0.1);
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

.bottom-nav-item.active {
    color: var(--primary-green);
}

.bottom-nav-item.active .nav-icon {
    background: var(--bg-green);
    transform: scale(1.1);
}

/* Primary item (Všechny výpravy) - highlighted */
.bottom-nav-item.primary {
    color: var(--primary-green);
}

.bottom-nav-item.primary .nav-icon {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    margin-bottom: 0.25rem;
    transition: var(--transition);
    background: transparent;
}

.nav-icon i {
    font-size: 20px;
    transition: var(--transition);
}

.primary-icon i {
    font-size: 24px;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    letter-spacing: 0.02em;
}

/* FIXED: Tooltips only show on desktop hover */
.bottom-nav-item::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
    pointer-events: none;
}

/* FIXED: Touch feedback for mobile devices */
.bottom-nav-item:active {
    transform: scale(0.95);
    background: rgba(5, 150, 105, 0.05);
}

.bottom-nav-item.primary:active .nav-icon {
    transform: scale(1.1);
}

/* ===========================
   RESPONSIVE BEHAVIOR
   =========================== */

@media (max-width: 900px) {
    /* Hide desktop menu */
    .navbar-menu {
        display: none;
    }
    
    /* Show mobile bottom navigation */
    .mobile-bottom-nav {
        display: block;
    }
    
    /* Add bottom padding to body to account for bottom nav */
    body {
        padding-bottom: var(--bottom-nav-height);
    }
    
    /* Adjust navbar height for mobile */
    .navbar {
        height: 50px;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .bottom-nav-container {
        padding: 0 0.25rem;
    }
    
    .bottom-nav-item {
        min-width: 50px;
        padding: 0.375rem;
    }
    
    .nav-icon {
        width: 36px;
        height: 36px;
    }
    
    .nav-icon i {
        font-size: 18px;
    }
    
    .primary-icon i {
        font-size: 20px;
    }
    
    .nav-label {
        font-size: 0.65rem;
    }
}

/* ===========================
   ACCESSIBILITY & ANIMATIONS
   =========================== */

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-item,
    .nav-icon {
        transition: none;
    }
    
    .bottom-nav-item:hover {
        transform: none;
    }
    
    .bottom-nav-item:active {
        transform: none;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    .mobile-bottom-nav {
        border-top: 2px solid var(--text-primary);
    }
    
    .bottom-nav-item {
        border: 1px solid transparent;
    }
    
    .bottom-nav-item:hover,
    .bottom-nav-item:focus {
        border-color: var(--primary-green);
    }
}

/* Active state management */
.bottom-nav-item.current {
    color: var(--primary-green);
}

.bottom-nav-item.current .nav-icon {
    background: var(--bg-green);
    color: var(--primary-green);
}

/* FIXED: Prevent text selection on touch devices */
.mobile-bottom-nav * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
