/* public/navigation.css */

/* Untere App-Leiste (Nav + optionale Action-Bar) — immer sichtbar und über Panels/Modals */
:root {
    --app-nav-height: 38px;
    --app-action-bar-height: 38px;
    --app-bottom-chrome: var(--app-nav-height);
    --z-app-nav: 200000;
    --z-app-action-bar: 200001;
}

/* Grundstruktur für die App */
body {
    margin: 0;
    padding: 0;
    padding-bottom: var(--app-bottom-chrome);
    /* Kein "Helvetica": Firefox blockiert lokale Systemschriften (FP-Schutz), Konsole sonst "blocked at visibility level". */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body.app-action-bar-visible {
    --app-bottom-chrome: calc(var(--app-nav-height) + var(--app-action-bar-height));
}

/* Haupt-Navigationsleiste am unteren Rand */
.main-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--app-nav-height);
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: var(--z-app-nav);
    pointer-events: auto;
}

.nav-item {
    height: 100%; /* NEU: Nimmt volle Höhe der Leiste ein */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px; /* Vertikales Padding entfernt */
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: #a8a8a8;
    stroke-width: 2;
    fill: none;
}

.nav-item.active svg {
    fill: #007aff;
    stroke: #007aff;
}

.nav-item.nav-feedback svg {
    stroke: #e53935;
    fill: none;
}

.nav-item.nav-feedback:hover svg {
    stroke: #ef5350;
}

/* Glocke aktiv: rot gefüllt — nicht das Standard-Blau der anderen Nav-Icons */
.nav-item.nav-feedback.active svg {
    fill: #e53935;
    stroke: #e53935;
}

.view-container { display: none; padding: 20px; width: 100%; min-height: 100vh; box-sizing: border-box; }
.view-container.active { display: block; }

/* Org-Profil, /org-Verzeichnis & Profil-Ansicht: auf schmalen Viewports kein .view-container-Padding (war 20px rundum) */
@media (max-width: 900px) {
    #view-org-profile.org-profile-fullpage.view-container,
    #view-org-directory.org-directory-fullpage.view-container,
    #view-profile.view-container {
        padding: 0 !important;
    }
    /* Dashboard/Chat unter #view-profile: Innenabstand statt View-Padding */
    #view-profile #dashboardPane #userDashboardSection {
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
        padding-top: 12px;
        box-sizing: border-box;
    }
    #view-profile #chatPane {
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }
}

/* Action-Bar */
.action-bar-container {
    position: fixed;
    bottom: var(--app-nav-height);
    left: 0;
    right: 0;
    height: var(--app-action-bar-height);
    background-color: #1c1c1c;
    border-top: 1px solid #333;
    padding: 0 10px;
    z-index: var(--z-app-action-bar);
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: opacity 0.4s ease, visibility 0.4s;
    opacity: 1;
    pointer-events: auto;
}

.action-bar-container:not(.visible) {
    opacity: 0;
    visibility: hidden;
}

.action-bar-container.visible {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.action-bar-button {
    height: 28px; /* Feste Höhe für den Button */
    background-color: transparent;
    border: 1.5px solid #a8a8a8;
    color: #a8a8a8;
    padding: 0 12px; /* Vertikales Padding entfernt */
    border-radius: 14px; /* Halbe Höhe für perfekte Rundung */
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; /* NEU: Für interne Zentrierung */
    align-items: center; /* NEU: Für interne Zentrierung */
}

.action-bar-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-bar-button.active {
    border-color: #007aff;
    color: #007aff;
    background-color: transparent;
}

@media (max-width: 700px) {
    .action-bar-container {
        justify-content: flex-start;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .action-bar-container::-webkit-scrollbar {
        display: none;
    }
    .action-bar-container .action-bar-button,
    .action-bar-container .action-bar-dropdown,
    .action-bar-container .context-switcher-container {
        flex: 0 0 auto;
    }
    .main-navigation {
        justify-content: flex-start;
        gap: 4px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .main-navigation::-webkit-scrollbar {
        display: none;
    }
    .main-navigation .nav-item {
        flex: 0 0 auto;
        min-width: 56px;
    }
}

/* ... Restliche Stile ... */
#view-feed .grid-wrapper {
    #scroll-left-button, #scroll-right-button {
        display: none;
    }
}

#view-feed #product-grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    overflow-x: hidden;
    width: 100%;
}

/*
 * Overlays/Modals: volle Breite, enden oberhalb Nav (+ Action-Bar).
 * Schiebe-Panels (.detail-panel): nur Höhe unten — right:-100% / Slide bleibt erhalten!
 */
.panel-overlay,
.modal-backdrop,
#review-panel-overlay,
#strain-lineage-explorer-overlay,
.mood-fs-overlay,
.pref-taste-picker-overlay,
.pf-overlay,
.ciq-overlay,
#review-wiki-help-overlay {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: var(--app-bottom-chrome, 38px) !important;
    height: auto !important;
    max-height: none !important;
}

.detail-panel,
#review-panel,
#dashboard-detail-panel.detail-panel {
    bottom: var(--app-bottom-chrome, 38px) !important;
    height: auto !important;
    max-height: none !important;
}
