/* ===================================
   D-NOVA - Light Beam Navigation
   Animowana nawigacja wiązek światła BMW Matrix LED
   =================================== */

/* Container nawigacji */
.water-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    pointer-events: none;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.water-nav.visible {
    opacity: 1 !important; /* Force visibility */
}

.water-nav.active {
    pointer-events: auto !important; /* Force interactivity */
}

/* Tło nawigacji (glassmorphism) */
.water-nav-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.water-nav.visible .water-nav-bg {
    opacity: 1;
}

/* Container przycisków */
.water-nav-buttons {
    display: flex;
    gap: 20px;
    position: relative;
}

/* Wiązka światła (Matrix LED Beam) - zamiast kropli wody */
.water-drop {
    position: absolute;
    width: 4px;
    height: 150px;
    opacity: 0;
    pointer-events: none;
    animation: lightBeamDrop 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Wiązka światła - gradient pionowy */
.water-drop::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(200, 220, 255, 1) 50%,
        rgba(100, 150, 255, 0.9) 80%,
        rgba(0, 100, 255, 0) 100%
    );
    box-shadow: 
        0 0 20px rgba(200, 220, 255, 0.8),
        0 0 40px rgba(100, 150, 255, 0.5),
        0 0 60px rgba(0, 100, 255, 0.3);
    filter: blur(2px);
}

/* Punkt świetlny na końcu wiązki */
.water-drop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 1) 0%,
        rgba(200, 220, 255, 0.8) 40%,
        rgba(100, 150, 255, 0) 100%
    );
    border-radius: 50%;
    box-shadow: 
        0 0 15px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(200, 220, 255, 0.6),
        0 0 45px rgba(100, 150, 255, 0.4);
}

/* Animacja spadającej wiązki światła */
@keyframes lightBeamDrop {
    0% {
        opacity: 0;
        transform: translateY(-200px) scaleY(0.3);
        filter: blur(5px);
    }
    
    30% {
        opacity: 1;
        filter: blur(2px);
    }
    
    70% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
    
    85% {
        transform: translateY(5px) scaleY(1.1);
    }
    
    100% {
        opacity: 0;
        transform: translateY(0) scaleY(1);
        filter: blur(0);
    }
}

/* Przycisk nawigacji (po transformacji) */
.water-nav-btn {
    position: relative;
    width: 140px;
    height: 70px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    transition: all 0.3s ease;
    transform: scale(0);
}

.water-nav-btn.transformed {
    animation: btnAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes btnAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    
    100% {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }
}

/* Kształt przycisku - BMW style */
.water-nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.04), 
        rgba(255, 255, 255, 0.01)
    );
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hover state - NAPRAWIONY, bez jittera */
.water-nav-btn.is-hovered::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1), 
        rgba(200, 220, 255, 0.05)
    );
    border-color: rgba(200, 220, 255, 0.3);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(100, 150, 255, 0.2),
        inset 0 0 20px rgba(200, 220, 255, 0.08);
}

/* Ikona przycisku */
.water-nav-btn-icon {
    position: relative;
    font-size: 24px;
    color: #e8e8e8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-nav-btn.is-hovered .water-nav-btn-icon {
    transform: scale(1.12);
    color: #ffffff;
    filter: drop-shadow(0 4px 12px rgba(200, 220, 255, 0.6));
}

/* Tekst przycisku */
.water-nav-btn-text {
    font-size: 13px;
    font-weight: 600;
    color: #d0d0d0;
    text-align: center;
    line-height: 1.2;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.water-nav-btn.is-hovered .water-nav-btn-text {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(200, 220, 255, 0.5);
    letter-spacing: 0.5px;
}

/* Podpis (np. "Tutaj jesteś") */
.water-nav-btn-hint {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #666;
    opacity: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
    pointer-events: none;
    font-weight: 500;
}

.water-nav-btn.active .water-nav-btn-hint {
    opacity: 1;
    color: #aaa;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, 
        rgba(255, 50, 100, 0.95), 
        rgba(255, 20, 80, 0.95)
    );
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 
        0 0 20px rgba(255, 50, 100, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.5);
    animation: badgePulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes badgePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 20px rgba(255, 50, 100, 0.6);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(255, 50, 100, 0.9);
    }
}

.water-nav-btn.active::before {
    background: linear-gradient(135deg, 
        rgba(100, 150, 255, 0.15), 
        rgba(200, 220, 255, 0.08)
    );
    border-color: rgba(100, 150, 255, 0.4);
    box-shadow: 
        0 0 30px rgba(100, 150, 255, 0.25),
        0 0 60px rgba(100, 150, 255, 0.1),
        inset 0 0 20px rgba(200, 220, 255, 0.1);
}

.water-nav-btn.active .water-nav-btn-icon {
    color: #ffffff;
    transform: scale(1.08);
    filter: drop-shadow(0 3px 10px rgba(100, 150, 255, 0.7));
}

.water-nav-btn.active .water-nav-btn-text {
    color: #ffffff;
}

/* Efekt ripple przy kliknięciu */
.water-nav-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(circle, 
        rgba(200, 220, 255, 0.3) 0%, 
        transparent 70%
    );
    opacity: 0;
    transform: scale(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-nav-btn:active::after {
    opacity: 1;
    transform: scale(2.5);
    transition: all 0s;
}

/* USUNIĘTA animacja wave - była przyczyną jittera */
/* Teraz tylko delikatny scale transition na hover */

/* Responsywność */
@media (max-width: 1024px) {
    .water-nav-buttons {
        gap: 15px;
    }
    
    .water-nav-btn {
        width: 120px;
        height: 65px;
    }
    
    .water-nav-btn-icon {
        font-size: 20px;
    }
    
    .water-nav-btn-text {
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .water-nav {
        height: 80px;
        padding-bottom: 10px;
    }
    
    .water-nav-bg {
        height: 80px;
    }
    
    .water-nav-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .water-nav-btn {
        width: 90px;
        height: 55px;
    }
    
    .water-nav-btn-icon {
        font-size: 18px;
    }
    
    .water-nav-btn-text {
        font-size: 9px;
    }
    
    .water-nav-btn-hint {
        font-size: 8px;
        bottom: -15px;
    }
    
    .water-drop {
        width: 3px;
        height: 100px;
    }
}

/* Efekt light trail (zamiast water trail) */
.water-trail {
    position: absolute;
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, 
        rgba(200, 220, 255, 0.6) 0%, 
        rgba(100, 150, 255, 0.3) 50%,
        transparent 100%
    );
    pointer-events: none;
    animation: lightTrailFade 0.8s ease-out forwards;
    box-shadow: 0 0 15px rgba(100, 150, 255, 0.4);
    filter: blur(1px);
}

@keyframes lightTrailFade {
    0% {
        opacity: 1;
        transform: scaleY(1);
    }
    100% {
        opacity: 0;
        transform: scaleY(0.3) translateY(20px);
    }
}

/* Loader podczas animacji */
.water-nav.loading {
    pointer-events: none;
}

/* Accessibility */
.water-nav-btn:focus {
    outline: 2px solid rgba(100, 150, 255, 0.6);
    outline-offset: 4px;
}

.water-nav-btn:focus-visible::before {
    border-color: rgba(100, 150, 255, 0.8);
    box-shadow: 0 0 0 4px rgba(100, 150, 255, 0.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .water-drop,
    .water-nav-btn,
    .water-nav-bg {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }
    
    .water-nav-btn::before,
    .water-nav-btn-icon,
    .water-nav-btn-text {
        transition: all 0.2s ease !important;
    }
}

/* Dark mode enhancement */
[data-theme="dark"] .water-nav-bg {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .water-nav-btn::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.06), 
        rgba(255, 255, 255, 0.02)
    );
    border-color: rgba(255, 255, 255, 0.1);
}

/* Dodatkowy efekt: linie ładowania jak w BMW iDrive */
.water-nav-btn .loading-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(100, 150, 255, 0.8) 50%,
        transparent 100%
    );
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.water-nav-btn.is-hovered .loading-line {
    width: 100%;
}
