/**
 * PF_iconbar.css – Styling for the icon bar
 * PFWS 1.4.1.2 – Franz Edition (Überarbeitet)
 */
/* 📱 Icon Bar Container */
.pf-iconbar {
    position: fixed;
    top: 60px; /* Direkt unter der Topnav */
    left: 0;
    right: 0;
    height: 8px; /* Sehr schmale Leiste im leeren Zustand */
    background: linear-gradient(135deg, rgba(60, 80, 100, 0.6) 0%, rgba(70, 90, 110, 0.6) 100%); /* Noch heller und transparenter */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-top: none; /* Keine obere Border für nahtlose Verbindung */
    border-radius: 0; /* Keine Abrundungen oben */
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 -2px 4px rgba(0, 0, 0, 0.1);
    z-index: 950; /* Hinter der Topnav (1100) */
    display: flex;
    align-items: center;
    padding: 0 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(12px); /* Wie Topnav */
    -webkit-backdrop-filter: blur(12px);
}

/* Hover-Effekt für leere Iconbar */
.pf-iconbar:not(.visible):hover {
    height: 56px; /* Gleiche Höhe wie visible für Konsistenz */
    transform: translateY(-18px) scale(0.99);
    opacity: 0.8;
}

.pf-iconbar.visible {
    height: 56px; /* Höher für bessere Sichtbarkeit */
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: linear-gradient(135deg, rgba(60, 80, 100, 0.7) 0%, rgba(70, 90, 110, 0.7) 100%); /* Heller als Topnav für bessere Unterscheidung */
    border-bottom: 2px solid rgba(74, 144, 226, 0.2);
    border-top: none; /* Keine obere Border */
    border-radius: 0; /* Keine Abrundungen oben */
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.25),
        0 -4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 950; /* Hinter der Topnav */
}

/* Spezielle Regel für Dashboard-Kontext - bessere Sichtbarkeit */
body.pf-dashboard .pf-iconbar,
.pf-dashboard .pf-iconbar {
    background-color: rgba(42, 42, 42, 0.98) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

body.pf-dashboard .pf-iconbar.visible,
.pf-dashboard .pf-iconbar.visible {
    background-color: rgba(42, 42, 42, 0.98) !important;
}

/* Zusätzliche Sicherheit: Immer sichtbar machen wenn Icons vorhanden */
.pf-iconbar.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background-color: rgba(42, 42, 42, 0.95) !important;
}

/* 📱 Icon Bar Container for items */
.pf-iconbar-container {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Explizit linksbündig ausrichten */
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #555 #333;
}

.pf-iconbar-container::-webkit-scrollbar {
    height: 4px;
}

.pf-iconbar-container::-webkit-scrollbar-track {
    background: #333;
}

.pf-iconbar-container::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 2px;
}

/* Leere Zustand Nachricht - nur beim Hover sichtbar */
.pf-iconbar-empty {
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 0.75em;
    font-weight: 300;
    letter-spacing: 0.5px;
    padding: 0 15px;
    display: none; /* Standardmäßig ausgeblendet */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Beim Hover der leeren Iconbar anzeigen */
.pf-iconbar:not(.visible):hover .pf-iconbar-empty {
    display: block;
    opacity: 0.7;
}

/* Ausblenden, wenn Icons vorhanden sind */
.pf-iconbar.visible .pf-iconbar-empty {
    display: none !important;
}

/* 📱 Icon Bar Items */
.pf-iconbar-item {
    position: relative;
    display: inline-flex;
    flex-direction: column; /* Vertikale Anordnung */
    align-items: flex-start; /* Links ausrichten */
    margin: 0 6px; /* Mehr Abstand zwischen Icons */
    margin-top: 0; /* Kein Abstand von oben - nahtlose Verbindung zur Topnav */
    padding-bottom: 8px; /* Weniger Platz für den Button */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.pf-iconbar-item:hover {
    transform: translateY(2px) scale(1.05); /* Nach unten bewegen und leicht vergrößern */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); /* Cooler Schatten-Effekt */
}

/* 📱 Icon Bar Icons */
.pf-iconbar-icon {
    font-size: 18px; /* Kleiner für bessere Proportionen */
    width: 32px; /* Kleiner als zuvor */
    height: 32px; /* Kleiner als zuvor */
    border-radius: 6px; /* Passend zur kleineren Größe */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.pf-iconbar-item:hover .pf-iconbar-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.1);
}

/* 📱 Restore Button - RECHTS UNTEN ÜBER DEM ICON */
.pf-iconbar-restore {
    position: absolute;
    bottom: -2px; /* Direkt am unteren Rand des Icons */
    right: -2px; /* Direkt am rechten Rand des Icons */
    width: 18px; /* Passend zu kleineren Icons */
    height: 18px; /* Passend zu kleineren Icons */
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 10px; /* Kleinere Schrift für kleineren Button */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100; /* Höherer z-index */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4); /* Deutlicher Schatten */
}

.pf-iconbar-item:hover .pf-iconbar-restore {
    opacity: 1;
    transform: scale(1.1); /* Leicht vergrößern beim Hover */
}

.pf-iconbar-restore:hover {
    background-color: #2980b9;
    transform: scale(1.2); /* Deutlich vergrößern beim Klick */
    z-index: 200; /* Noch höher beim Hover */
}

/* 📱 Responsive adjustments */
@media screen and (max-width: 768px) {
    .pf-iconbar {
        height: 6px; /* Noch schmaler auf mobilen Geräten */
    }
    
    .pf-iconbar:not(.visible):hover {
        height: 42px; /* Etwas weniger Höhe beim Hover */
    }
    
    .pf-iconbar.visible {
        height: 36px; /* Weniger Höhe wenn Icons vorhanden */
    }
    
    .pf-iconbar-item {
        margin: 0 6px;
        margin-top: 3px;
        padding-bottom: 6px;
    }
    
    .pf-iconbar-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .pf-iconbar-restore {
        width: 18px;
        height: 18px;
        bottom: -1px;
        right: -1px;
        font-size: 10px;
    }
    
    /* Noch dezenter auf kleinen Bildschirmen */
    .pf-iconbar-empty {
        font-size: 0.7em;
    }
}