/**
 * G.R. Sim CMS - Intelligentes Mobile & Tablet Layout
 */

/* 1. Globaler Header - Jetzt mit dynamischer Anpassung */
body.mobile-view .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: auto !important;
    min-height: 60px;
    z-index: 10000 !important;
    background: rgba(10, 10, 15, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.mobile-view .header-inner {
    height: auto !important;
    display: flex !important;
    flex-wrap: wrap;
    /* Erlaubt automatisches Umbrechen bei Platzmangel */
    padding: 10px 15px !important;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

/* Die Navigation passt sich der Breite an */
body.mobile-view .header-center {
    display: flex !important;
    flex: 1 1 100%;
    /* Auf sehr schmalen Geräten volle Breite (eigene Zeile) */
    order: 3;
    /* Rutscht unter Logo und User */
    justify-content: center;
}

/* Tablet-Optimierung: Wenn mehr als 700px Platz ist, alles in eine Reihe */
@media (min-width: 700px) {
    body.mobile-view .header-inner {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    body.mobile-view .header-center {
        flex: 1;
        order: 2;
        /* Zwischen Logo und User */
        justify-content: center;
    }

    body.mobile-view .page-main,
    body.mobile-view .admin-content-integrated {
        margin-top: var(--header-height, 80px) !important;
    }
}

/* Handy-Optimierung: Standardmäßig mehr Abstand für 2 Reihen */
@media (max-width: 699px) {

    body.mobile-view .page-main,
    body.mobile-view .admin-content-integrated {
        margin-top: var(--header-height, 130px) !important;
    }
}

body.mobile-view .main-nav {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

body.mobile-view .nav-link {
    font-size: 12px !important;
    padding: 6px 10px !important;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    white-space: nowrap;
}

/* 2. Admin Sidebar (Navigation) als Drawer - Jetzt universell & Premium */
.admin-sidebar-integrated {
    position: fixed !important;
    left: 0;
    top: var(--header-height, 80px) !important;
    bottom: 0;
    width: 280px !important;
    background: rgba(17, 17, 29, 0.92) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999 !important;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 15px 0 45px rgba(0,0,0,0.6);
    overflow-y: auto;
    border-right: 1px solid rgba(232, 35, 42, 0.3);
}

body.menu-open .admin-sidebar-integrated {
    transform: translateX(0);
}

/* 3. Der Toggle-Button (Hamburger) - Premium Finish */
.admin-nav-mobile-toggle {
    display: flex !important;
    position: fixed !important;
    left: 0;
    top: var(--header-height, 80px) !important;
    width: 42px;
    height: 48px;
    background: #11111d;
    border: 1px solid rgba(232, 35, 42, 0.4);
    border-left: none;
    border-radius: 0 12px 12px 0;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 100000 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 15px rgba(0,0,0,0.4);
}

.admin-nav-mobile-toggle i {
    transition: transform 0.3s ease;
    font-size: 16px;
    color: var(--primary);
    filter: drop-shadow(0 0 5px rgba(232, 35, 42, 0.5));
}

.admin-nav-mobile-toggle:hover {
    background: #1a1a2e;
    width: 52px;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(232, 35, 42, 0.3);
}

.admin-nav-mobile-toggle:hover i {
    transform: scale(1.2);
    color: #fff;
    filter: drop-shadow(0 0 8px var(--primary));
}

body.menu-open .admin-nav-mobile-toggle {
    left: 280px;
    background: var(--primary);
    border-color: #fff;
}

body.menu-open .admin-nav-mobile-toggle i {
    color: #fff;
    transform: rotate(90deg);
}


body.menu-open .admin-nav-mobile-toggle {
    left: 280px;
}