﻿/* ===== MAIN MENU (nur noch Trikot-Navigation) ===== */

.main-menu {
    background: #4a7c59;
    background-image: url('/images/pitchtexture.png');
    background-repeat: repeat;
    background-size: 200px 200px;
    transition: max-height var(--transition-normal, 0.3s) cubic-bezier(0.4, 0, 0.2, 1), 
                opacity var(--transition-normal, 0.3s) ease;
    margin: 0;
    position: fixed;
    top: var(--header-height-desktop, 90px);
    left: 0;
    width: 100%;
    z-index: 998;
    overflow: hidden;
    /* Standardmäßig geschlossen auf allen Seiten außer Mainpage */
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* Menu aktiv: Trikots sichtbar (durch Hamburger-Klick) */
.main-menu.active {
    max-height: 200px;
    opacity: 1;
    pointer-events: auto;
}

/* Auf Mainpage standardmäßig offen, ABER kann geschlossen werden */
body.is-mainpage .main-menu:not(.closing) {
    max-height: 200px;
    opacity: 1;
    pointer-events: auto;
}

/* Wenn explizit geschlossen auf Mainpage */
body.is-mainpage .main-menu.closing {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ===== JERSEY NAVIGATION SECTION (Unterer Teil) ===== */
.jersey-nav-section {
    padding: 20px;
    background: #4a7c59;
    background-image: url('/images/pitchtexture.png');
    background-repeat: repeat;
    background-size: 200px 200px;
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.jersey-nav-section::-webkit-scrollbar {
    display: none;
}

.jersey-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    min-width: 70px;
}

.jersey-nav-item:hover {
    transform: translateY(-5px);
}

.jersey-nav-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    transition: filter 0.3s ease;
}

.jersey-nav-item:hover .jersey-nav-image {
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7));
}

.jersey-nav-tla {
    font-family: 'Russo One', sans-serif;
    font-size: 12px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== MOBILE OPTIMIERUNG ===== */
@media (max-width: 768px) {
    /* Menu bleibt fixed - wird vom App-Shell Layout in style.css gesteuert */
    
    .main-menu.active {
        max-height: 110px;
        height: 110px;
        opacity: 1;
        pointer-events: auto;
    }

    /* Auf Mainpage standardmäßig offen auch auf Mobile */
    body.is-mainpage .main-menu:not(.closing) {
        max-height: 110px;
        height: 110px;
        opacity: 1;
        pointer-events: auto;
    }

    .jersey-nav-section {
        padding: 12px 15px 8px 15px;
        height: 100%;
    }

    .jersey-nav-item {
        min-width: 58px;
    }

    .jersey-nav-image {
        width: 52.5px;
        height: 52.5px;
    }

    .jersey-nav-tla {
        font-size: 10px;
    }
}

/* ===== DESKTOP OPTIMIERUNG ===== */
@media (min-width: 769px) {
    /* Auf Mainpage Trikots standardmäßig sichtbar */
    body.is-mainpage .main-menu:not(.closing) {
        max-height: 180px;
        opacity: 1;
        pointer-events: auto;
    }

    /* Explizit geschlossen auf Desktop - höhere Spezifität */
    body.is-mainpage .main-menu.closing {
        max-height: 0;
        opacity: 0;
        pointer-events: none;
    }

    /* Auf anderen Seiten: durch Hamburger öffnen */
    .main-menu.active {
        max-height: 180px;
        opacity: 1;
        pointer-events: auto;
    }

    /* Content Padding anpassen auf Desktop */
    body.is-mainpage .main-content {
        padding-top: 290px;
        /* Header 90px + Navigation 180px + Abstand 20px */
    }

    /* Content Padding wenn Navigation geschlossen auf Mainpage */
    body.is-mainpage .main-menu.closing ~ * .main-content,
    body.is-mainpage.menu-closing .main-content {
        padding-top: 110px;
    }

    .jersey-nav-section {
        padding: 20px;
        gap: 25px;
    }

    .jersey-nav-item {
        min-width: 80px;
    }

    .jersey-nav-image {
        width: 70px;
        height: 70px;
    }

    .jersey-nav-tla {
        font-size: 12px;
    }
}

/* Nur auf sehr großen Bildschirmen zentrieren (wenn alle 18 Vereine sichtbar sind) */
@media (min-width: 1800px) {
    .jersey-nav-section {
        justify-content: center;
    }
}
