@import '../../..//utils/shared-styles.scss';

/* ===============================
   ADMIN HEADER
   Sitzt unter dem normalen Header
   =============================== */

.admin-header {
    position: sticky;
    top: 72px;
    /* Platz für deinen Page-Header */
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(160%);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    transition: all 0.3s ease;
    padding-top: env(safe-area-inset-top);

    .header__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 60px;
        max-width: 1200px;
        margin-inline: auto;
        padding-inline: clamp(1rem, 4vw, 2rem);
        position: relative; // wichtig für das mobile Menü
    }
}

/* ===== BRAND (optional Icon/Titel links) ===== */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    color: #9a3412;

    .material-symbols-outlined {
        font-size: 22px;
    }

    &:hover {
        opacity: 0.85;
    }
}

/* ===== DESKTOP NAVIGATION ===== */
.admin-nav {
    display: none;
    gap: 0.5rem;

    @media (min-width: 900px) {
        display: flex;
        align-items: center;
        margin-left: auto;
    }

    a {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.625rem 1rem;
        border-radius: $radius-md;
        font-size: 0.9375rem;
        font-weight: 600;
        color: #c2410c;
        text-decoration: none;
        border: 2px solid rgba(234, 88, 12, 0.2);
        background: #fff;
        transition: transform 0.2s ease, box-shadow 0.2s ease,
            background 0.3s ease, border-color 0.3s ease, color 0.2s ease;
        min-height: 44px;
        min-width: 44px;

        .material-symbols-outlined {
            font-size: 20px;
        }

        &:hover {
            background: linear-gradient(135deg,
                    rgba(234, 88, 12, 0.12),
                    rgba(249, 115, 22, 0.16));
            border-color: rgba(234, 88, 12, 0.4);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
            color: #9a3412;
        }

        &.nav-link--active {
            background: linear-gradient(135deg,
                    rgba(234, 88, 12, 0.15),
                    rgba(249, 115, 22, 0.2));
            border-color: #ea580c;
            color: #9a3412;
            box-shadow:
                0 4px 12px rgba(234, 88, 12, 0.25),
                0 0 0 1px rgba(234, 88, 12, 0.1) inset;
        }

        &:focus-visible {
            outline: none;
            box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.28);
        }
    }

    /* ===== MOBILE BURGER MENÜ ===== */
    &.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        /* direkt unter dem Admin-Header */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding: 1rem;
        gap: 0.5rem;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
        animation: slideDown 0.25s ease;

        a {
            width: 100%;
            justify-content: flex-start;
            padding: 0.875rem 1rem;
            font-size: 1rem;
        }
    }
}

/* ===== BURGER BUTTON ===== */
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: $radius-md;
    background: transparent;
    border: 2px solid $color-gray-200;
    cursor: pointer;
    transition: all 0.2s ease;

    .material-symbols-outlined {
        font-size: 24px;
    }

    @media (min-width: 900px) {
        display: none;
    }

    &:hover {
        border-color: #ea580c;
        background: rgba(234, 88, 12, 0.06);
    }

    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
    }
}

/* ===== BACKDROP ===== */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
    cursor: pointer;
    z-index: -1
    /* unter Admin-Header, über Content */
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== MOTION REDUCE ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}