/**
 * PWA Mobile CSS - PocketBooking Pro
 * 
 * Enthält alle Styles für den PWA-Modus:
 * - WordPress Admin Shell ausblenden
 * - PWA Navigation (Top + Bottom)
 * - Mobile-optimierte Layouts
 * - Touch-optimierte Elemente
 *
 * @package SimpleBookingCalendar
 * @since 1.2.0
 */

/* ========================================
   CSS Custom Properties (Variablen)
   ======================================== */
:root {
    --simpbook-container-bg: #667eea; /* Fallback - wird dynamisch überschrieben */
    --simpbook-pwa-app-color: #667eea;
    --simpbook-pwa-header-height: 56px;
    --simpbook-pwa-bottom-nav-height: 60px;
    --simpbook-pwa-sidebar-width: 280px;
    --simpbook-pwa-transition-speed: 0.3s;
}

/* ========================================
   WORDPRESS ADMIN SHELL AUSBLENDEN
   Kein WordPress-Feeling in der App!
   ======================================== */

body.simpbook-pwa-mode #wpadminbar,
body.simpbook-pwa-mode #adminmenuback,
body.simpbook-pwa-mode #adminmenuwrap,
body.simpbook-pwa-mode #adminmenu,
body.simpbook-pwa-mode .update-nag,
body.simpbook-pwa-mode .notice:not(.simpbook-notice),
body.simpbook-pwa-mode .notice-error,
body.simpbook-pwa-mode .notice-warning,
body.simpbook-pwa-mode .notice-success,
body.simpbook-pwa-mode .notice-info,
body.simpbook-pwa-mode #screen-meta,
body.simpbook-pwa-mode #screen-meta-links,
body.simpbook-pwa-mode .wrap > h1:first-child,
body.simpbook-pwa-mode .wrap > .page-title-action,
body.simpbook-pwa-mode #wpfooter,
body.simpbook-pwa-mode .wp-header-end {
    display: none !important;
}

/* ========================================
   RESERVIERUNGEN ANSICHT IN PWA
   ======================================== */

/* PWA: Immer Kartenansicht zeigen, Tabelle ausblenden */
body.simpbook-pwa-mode .desktop-reservierungen-tabelle {
    display: none !important;
}

body.simpbook-pwa-mode .mobile-reservierungen-karten {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px;

}

/* Unter 400px: 1 Spalte */
@media (max-width: 400px) {
    body.simpbook-pwa-mode .mobile-reservierungen-karten {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   RESERVIERUNG-ID IN MOBILER ANSICHT AUSBLENDEN
   ======================================== */

/* ID in Karten UND Tabellen ausblenden - höchste Spezifität */
body.simpbook-pwa-mode .reservierung-karte-header .reservierung-id {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.simpbook-pwa-mode .reservierung-id {
    display: none !important;
}

body.simpbook-pwa-mode .reservierung-karte .reservierung-id {
    display: none !important;
}

/* Auch in der Tabellen-Ansicht auf Mobile ausblenden */
@media (max-width: 782px) {
    body.simpbook-pwa-mode .column-id,
    body.simpbook-pwa-mode th.column-id,
    body.simpbook-pwa-mode td.column-id {
        display: none !important;
    }
    
    /* Zusätzlich: ID in allen Karten-Ansichten */
    .reservierung-karte .reservierung-id,
    .reservierung-karte-header .reservierung-id {
        display: none !important;
        visibility: hidden !important;
    }
}

/* Content auf Fullscreen */
body.simpbook-pwa-mode {
    overflow-x: hidden;
    overflow-y: auto; /* Explizit auto für vertikales Scrollen */
    background: #f5f5f5 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    max-width: 100vw; /* Verhindert horizontalen Overflow */
    -webkit-overflow-scrolling: touch;
}

/* Verhindere dass HTML größer als der Viewport wird */
html:has(body.simpbook-pwa-mode) {
    overflow-x: hidden;
    max-width: 100vw;
}

body.simpbook-pwa-mode #wpcontent {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

body.simpbook-pwa-mode #wpbody {
    padding-top: 56px !important;
    padding-bottom: 100px !important; /* Erhöht von 70px auf 100px für mehr Puffer */
}

body.simpbook-pwa-mode #wpbody-content {
    padding-bottom: 0 !important;
    float: none !important;
}

body.simpbook-pwa-mode .wrap {
    margin: 0 !important;
    padding: 5px !important;
    max-width: 100% !important;
}

/* ========================================
   PWA TOP HEADER
   ======================================== */

.simpbook-pwa-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--simpbook-container-bg, #667eea) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 99999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.simpbook-pwa-back-btn,
.simpbook-pwa-menu-btn {
    background: none;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.simpbook-pwa-back-btn:hover,
.simpbook-pwa-menu-btn:hover,
.simpbook-pwa-back-btn:focus,
.simpbook-pwa-menu-btn:focus {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.simpbook-pwa-back-btn:active,
.simpbook-pwa-menu-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.simpbook-pwa-back-btn .dashicons,
.simpbook-pwa-menu-btn .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.simpbook-pwa-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
}

/* ========================================
   PWA HAMBURGER MENU
   ======================================== */

.simpbook-pwa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.simpbook-pwa-overlay.open {
    opacity: 1;
    visibility: visible;
}

.simpbook-pwa-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 100000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.simpbook-pwa-menu.open {
    right: 0;
}

.simpbook-pwa-menu-header {
    padding: 24px 16px;
    color: white;
}

.simpbook-pwa-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.simpbook-pwa-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.simpbook-pwa-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.simpbook-pwa-user-details {
    flex: 1;
    min-width: 0;
}

.simpbook-pwa-user-details strong {
    display: block;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.simpbook-pwa-user-details small {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.simpbook-pwa-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.simpbook-pwa-menu-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s ease;
}

.simpbook-pwa-menu-nav a:hover,
.simpbook-pwa-menu-nav a:focus {
    background: #f5f5f5;
    outline: none;
}

.simpbook-pwa-menu-nav a.active {
    background: #f0f0ff;
    color: #667eea;
    font-weight: 600;
}

.simpbook-pwa-menu-nav a .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: inherit;
}

.simpbook-pwa-menu-nav hr {
    margin: 8px 20px;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.simpbook-pwa-logout {
    color: #d32f2f !important;
}

.simpbook-pwa-menu-footer {
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #999;
}

/* ========================================
   PWA BOTTOM NAVIGATION
   ======================================== */

.simpbook-pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99999;
    border-top: 1px solid #e0e0e0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.simpbook-pwa-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    padding: 8px 4px;
    min-height: 60px;
    transition: all 0.2s ease;
    position: relative;
}

.simpbook-pwa-nav-item:hover,
.simpbook-pwa-nav-item:focus {
    color: var(--simpbook-container-bg, #667eea);
    outline: none;
}

.simpbook-pwa-nav-item.active {
    color: var(--simpbook-container-bg, #667eea);
}

.simpbook-pwa-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--simpbook-container-bg, #667eea);
    border-radius: 0 0 3px 3px;
}

.simpbook-pwa-nav-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 4px;
}

.simpbook-pwa-nav-icon.dashicons {
    width: 22px;
    height: 22px;
}

.simpbook-pwa-nav-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

/* ========================================
   MOBILE OPTIMIERUNGEN
   ======================================== */

@media (max-width: 782px) {
    /* Touch-Targets mindestens 44x44px */
    body.simpbook-pwa-mode button,
    body.simpbook-pwa-mode a.button,
    body.simpbook-pwa-mode input[type="submit"],
    body.simpbook-pwa-mode input[type="button"],
    body.simpbook-pwa-mode .button {
        min-height: 44px;
        min-width: 100px;
        padding: 10px 16px !important;
    }
    
    /* Formulare größer machen */
    body.simpbook-pwa-mode input[type="text"],
    body.simpbook-pwa-mode input[type="email"],
    body.simpbook-pwa-mode input[type="tel"],
    body.simpbook-pwa-mode input[type="number"],
    body.simpbook-pwa-mode input[type="date"],
    body.simpbook-pwa-mode input[type="time"],
    body.simpbook-pwa-mode input[type="password"],
    body.simpbook-pwa-mode select,
    body.simpbook-pwa-mode textarea {
        font-size: 16px !important; /* Verhindert Zoom auf iOS */
        padding: 12px !important;
        min-height: 44px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Tabellen scrollbar machen - AUSKOMMENTIERT weil es Kalender kaputt macht
    body.simpbook-pwa-mode table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    body.simpbook-pwa-mode table thead {
        display: table;
        width: 100%;
    }
    
    body.simpbook-pwa-mode table tbody {
        display: table;
        width: 100%;
    }
    
    body.simpbook-pwa-mode table tr {
        display: table-row;
    }
    
    body.simpbook-pwa-mode table th,
    body.simpbook-pwa-mode table td {
        padding: 12px 8px !important;
        white-space: nowrap;
    }
    */
    
    /* Flex-Layouts responsive machen */
    body.simpbook-pwa-mode .form-table th {
        display: block;
        width: 100% !important;
        padding-bottom: 4px !important;
    }
    
    body.simpbook-pwa-mode .form-table td {
        display: block;
        width: 100% !important;
        padding-left: 0 !important;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.simpbook-pwa-loading {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    z-index: 99999;
    animation: simpbook-loading-bar 1.5s ease-in-out infinite;
}

@keyframes simpbook-loading-bar {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   DASHBOARD CARDS MOBILE
   ======================================== */

body.simpbook-pwa-mode .simpbook-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

body.simpbook-pwa-mode .simpbook-dashboard-card {
    padding: 16px;
    border-radius: 12px;
}

/* ========================================
   KALENDER MOBILE OPTIMIERUNGEN
   ======================================== */

body.simpbook-pwa-mode .fc {
    font-size: 14px;
}

body.simpbook-pwa-mode .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
}

body.simpbook-pwa-mode .fc .fc-toolbar-title {
    font-size: 16px !important;
}

body.simpbook-pwa-mode .fc .fc-button {
    padding: 8px 12px !important;
}

/* ========================================
   SAFE AREA FÜR IPHONE X+ / NOTCH
   ======================================== */

@supports (padding: env(safe-area-inset-top)) {
    .simpbook-pwa-header {
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }
    
    body.simpbook-pwa-mode #wpbody {
        padding-top: calc(56px + env(safe-area-inset-top)) !important;
    }
    
    .simpbook-pwa-bottom-nav {
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    body.simpbook-pwa-mode #wpbody {
        padding-bottom: calc(100px + env(safe-area-inset-bottom)) !important; /* Erhöht von 70px auf 100px */
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

.simpbook-pwa-header,
.simpbook-pwa-bottom-nav,
.simpbook-pwa-menu,
.simpbook-pwa-overlay {
    will-change: transform, opacity;
}

/* Reduzierte Animation für Nutzer die das bevorzugen */
@media (prefers-reduced-motion: reduce) {
    .simpbook-pwa-menu,
    .simpbook-pwa-overlay {
        transition: none;
    }
    
    .simpbook-pwa-loading {
        animation: none;
    }
}

/* ========================================
   PWA DASHBOARD HEADER MIT LOGO
   ======================================== */

.simpbook-pwa-dashboard-header {
    text-align: center;
    padding: 20px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.simpbook-pwa-dashboard-logo {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: contain;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.simpbook-pwa-welcome {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* ========================================
   PWA KALENDER FIXES
   ======================================== */

body.simpbook-pwa-mode .simpbook-calendar-container {
    margin: 10px 0;
    padding: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block !important;
    visibility: visible !important;
    min-height: 400px;
}

body.simpbook-pwa-mode #calendar {
    display: block !important;
    visibility: visible !important;
    min-height: 350px;
    width: 100%;
}

body.simpbook-pwa-mode .fc {
    min-width: 100%;
    display: block !important;
    visibility: visible !important;
}

body.simpbook-pwa-mode .fc-view-harness {
    min-height: 300px !important;
    display: block !important;
    visibility: visible !important;
}

body.simpbook-pwa-mode .fc-view {
    display: block !important;
    visibility: visible !important;
}

body.simpbook-pwa-mode .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
}

body.simpbook-pwa-mode .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

body.simpbook-pwa-mode .fc-toolbar-title {
    font-size: 1.1em !important;
}

body.simpbook-pwa-mode .fc-button {
    padding: 6px 10px !important;
    font-size: 13px !important;
}

body.simpbook-pwa-mode .fc-daygrid-day {
    min-height: 100px !important;
}

body.simpbook-pwa-mode .fc-event {
    font-size: 11px;
    padding: 2px 4px;
}

/* ========================================
   PWA PAGINIERUNG & TABLENAV FIXES
   ======================================== */

body.simpbook-pwa-mode .tablenav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 10px 0;
}

body.simpbook-pwa-mode .tablenav .tablenav-pages {
    float: none !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
}

body.simpbook-pwa-mode .tablenav-pages .pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

body.simpbook-pwa-mode .tablenav-pages .button,
body.simpbook-pwa-mode .tablenav-pages a {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    font-size: 14px;
}

body.simpbook-pwa-mode .tablenav-pages .displaying-num {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
    font-size: 13px;
}

body.simpbook-pwa-mode .tablenav-pages .paging-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

body.simpbook-pwa-mode .tablenav-pages .current-page {
    width: 50px;
    text-align: center;
}

/* ========================================
   PWA FILTER BUTTONS FIXES
   ======================================== */

body.simpbook-pwa-mode .reservierungen-filter-container {
    margin-bottom: 15px;
}

body.simpbook-pwa-mode .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

body.simpbook-pwa-mode .filter-options a.filter-button {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ========================================
   ALLGEMEINE MOBILE TABLENAV (NICHT NUR PWA)
   ======================================== */

@media (max-width: 782px) {
    .simpbook-admin-wrap .tablenav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .simpbook-admin-wrap .tablenav .tablenav-pages {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    
    .simpbook-admin-wrap .tablenav-pages .pagination-links {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
    }
    
    .simpbook-admin-wrap .tablenav-pages .button,
    .simpbook-admin-wrap .tablenav-pages a {
        min-width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
    }
    
    .simpbook-admin-wrap .tablenav-pages .displaying-num {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
}

/* ========================================
   PWA KALENDER MOBILE FIX
   Kalender sichtbar halten auf allen Bildschirmgrößen
   ======================================== */

body.simpbook-pwa-mode .simpbook-calendar-container {
    display: block !important;
    visibility: visible !important;
    min-height: 400px;
    
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

/* PWA Kalender Styles auskommentiert - normale mobile Ansicht wird verwendet

body.simpbook-pwa-mode #calendar {
    display: block !important;
    visibility: visible !important;
    min-height: 350px;
    width: 100%;
}

body.simpbook-pwa-mode .fc {
    display: block !important;
    visibility: visible !important;
    min-height: 350px;
}

body.simpbook-pwa-mode .fc-view-harness {
    display: block !important;
    visibility: visible !important;
    min-height: 300px !important;
}

body.simpbook-pwa-mode .fc-view {
    display: block !important;
    visibility: visible !important;
}

@media (max-width: 600px) {
    body.simpbook-pwa-mode .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    body.simpbook-pwa-mode .fc .fc-toolbar-title {
        font-size: 16px !important;
        order: -1;
    }
    
    body.simpbook-pwa-mode .fc .fc-button-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    body.simpbook-pwa-mode .fc .fc-button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    body.simpbook-pwa-mode .simpbook-calendar-container {
        padding: 8px !important;
        margin: 8px 0 !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-day {
        min-height: 60px !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-day-frame {
        min-height: 60px !important;
    }
}

@media (max-width: 480px) {
    body.simpbook-pwa-mode .simpbook-calendar-container {
        min-height: 350px;
        padding: 6px !important;
    }
    
    body.simpbook-pwa-mode #calendar {
        min-height: 300px;
    }
    
    body.simpbook-pwa-mode .fc-view-harness {
        min-height: 250px !important;
    }
    
    body.simpbook-pwa-mode .fc .fc-toolbar-chunk {
        margin-bottom: 5px;
    }
    
    body.simpbook-pwa-mode .fc-toolbar-title {
        font-size: 14px !important;
    }
    
    body.simpbook-pwa-mode .fc-event {
        font-size: 9px !important;
        padding: 1px 2px !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-day-number {
        font-size: 11px !important;
        padding: 4px !important;
    }
    
    body.simpbook-pwa-mode #calendar {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        min-height: 400px !important;
    }
    
    body.simpbook-pwa-mode .fc,
    body.simpbook-pwa-mode .fc-view-harness,
    body.simpbook-pwa-mode .fc-view {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        min-height: 300px !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid {
        display: table !important;
        visibility: visible !important;
        width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid-section {
        display: table-row-group !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid-section > td {
        display: table-cell !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid-section-body,
    body.simpbook-pwa-mode .fc-scrollgrid-section-header {
        display: table-row-group !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-body {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        position: relative !important;
        min-height: 200px !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-body-balanced,
    body.simpbook-pwa-mode .fc-daygrid-body-unbalanced,
    body.simpbook-pwa-mode .fc-daygrid-body-natural {
        width: 100% !important;
        display: block !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode table.fc-scrollgrid-sync-table {
        display: table !important;
        width: 100% !important;
        table-layout: fixed !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-col-header,
    body.simpbook-pwa-mode .fc-col-header-cell,
    body.simpbook-pwa-mode .fc-daygrid-day-frame {
        display: table-cell !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-day,
    body.simpbook-pwa-mode .fc-col-header-cell {
        display: table-cell !important;
        visibility: visible !important;
        min-width: 30px !important;
    }
    
    body.simpbook-pwa-mode .fc-daygrid-day-top,
    body.simpbook-pwa-mode .fc-daygrid-day-events,
    body.simpbook-pwa-mode .fc-daygrid-day-bg {
        display: block !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid tbody,
    body.simpbook-pwa-mode .fc-scrollgrid thead {
        display: table-row-group !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid tr {
        display: table-row !important;
        visibility: visible !important;
    }
    
    body.simpbook-pwa-mode .fc-scrollgrid td,
    body.simpbook-pwa-mode .fc-scrollgrid th {
        display: table-cell !important;
        visibility: visible !important;
    }
}

*/

/* Kalender Filter im PWA-Modus */
body.simpbook-pwa-mode .simpbook-calendar-filters {
    flex-direction: column;
    gap: 10px;
}

body.simpbook-pwa-mode .simpbook-calendar-filters .filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

body.simpbook-pwa-mode .simpbook-calendar-filters select {
    width: 100%;
    margin-right: 0;
}

body.simpbook-pwa-mode .simpbook-calendar-filters .button {
    width: 100%;
    text-align: center;
}

/* ========================================
   RESPONSIVE TOUCH OPTIMIERUNGEN
   Apple Touch Target Guidelines
   ======================================== */
body.simpbook-pwa-mode button,
body.simpbook-pwa-mode .button,
body.simpbook-pwa-mode a.button,
body.simpbook-pwa-mode input[type="submit"] {
    min-height: 44px !important;
    min-width: 44px !important;
}

body.simpbook-pwa-mode input[type="text"],
body.simpbook-pwa-mode input[type="email"],
body.simpbook-pwa-mode input[type="tel"],
body.simpbook-pwa-mode input[type="number"],
body.simpbook-pwa-mode input[type="date"],
body.simpbook-pwa-mode input[type="time"],
body.simpbook-pwa-mode select,
body.simpbook-pwa-mode textarea {
    font-size: 16px !important; /* Verhindert Zoom auf iOS */
    padding: 12px !important;
    border-radius: 8px !important;
}

/* ========================================
   PWA UPDATE NOTIFICATION
   ======================================== */
.simpbook-pwa-update-notification {
    position: fixed;
    bottom: 90px;
    left: 15px;
    right: 15px;
    background: #1d2327;
    color: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.simpbook-pwa-update-notification p {
    margin: 0;
    font-size: 14px;
}

.simpbook-pwa-update-btn {
    white-space: nowrap;
}

/* ========================================
   PWA INSTALL OVERLAY (Modal)
   ======================================== */
.simpbook-pwa-install-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: simpbook-fadeIn 0.3s ease-out;
}

@keyframes simpbook-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.simpbook-pwa-install-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 100%;
    animation: simpbook-slideUp 0.4s ease-out;
}

@keyframes simpbook-slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    .simpbook-pwa-install-modal {
        max-width: 90%;
        margin: 0 auto;
    }
}

/* ⚠️ ENTFERNT - Overlay wird jetzt per JavaScript Show/Hide gesteuert
   CSS-basierte Logik verhinderte korrektes Timing
   Siehe pwa-install.js setupInstallOverlay() für neue Logik
*/

/* ========================================
   PWA FLOATING ACTION BUTTON (FAB)
   ======================================== */
.simpbook-pwa-fab {
    position: fixed;
    bottom: calc(var(--simpbook-pwa-bottom-nav-height, 60px) + 15px);
    right: 15px;
    width: 56px;
    height: 56px;
    background: var(--simpbook-pwa-app-color, #667eea);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.simpbook-pwa-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.simpbook-pwa-fab:active {
    transform: scale(0.95);
}

.simpbook-pwa-fab .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    line-height: 28px;
}

/* ========================================
   PWA BADGE FÜR NOTIFICATIONS
   ======================================== */
.simpbook-pwa-nav-item .simpbook-pwa-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.simpbook-pwa-back-btn:focus,
.simpbook-pwa-menu-btn:focus,
.simpbook-pwa-sidebar-close:focus,
.simpbook-pwa-nav-item:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.simpbook-pwa-bottom-nav .simpbook-pwa-nav-item:focus {
    outline: 2px solid var(--simpbook-pwa-app-color, #667eea);
    outline-offset: -2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .simpbook-pwa-sidebar,
    .simpbook-pwa-overlay,
    .simpbook-pwa-install-overlay,
    .simpbook-pwa-install-modal {
        transition: none;
        animation: none;
    }
}

/* Utility to hide elements in PWA mode */
.simpbook-pwa-mode .simpbook-hide-pwa {
    display: none !important;
}

/* ========================================
   PWA: HIDE SPECIFIC ELEMENTS
   ======================================== */
body.simpbook-pwa-mode .simpbook-pwa-dashboard-header,
body.simpbook-pwa-mode .simpbook-dashboard-quick-actions,
body.simpbook-pwa-mode .simpbook-dashboard-shortcode-box,
body.simpbook-pwa-mode .simpbook-calendar-subscribe-section,
body.simpbook-pwa-mode .simpbook-export-section {
    display: none !important;
}

/* ========================================
   PWA: KALENDER FILTER REORDERING
   Filter NACH dem Kalender anzeigen (nur auf Kalender-Seite)
   ======================================== */
body.simpbook-pwa-mode .wrap:has(.simpbook-calendar-container) {
    display: flex;
    flex-direction: column;
}

body.simpbook-pwa-mode .simpbook-calendar-filters {
    order: 10; /* Nach dem Kalender */
}

body.simpbook-pwa-mode .simpbook-calendar-container {
    order: 5; /* Vor den Filtern */
}
