/* PWA-spezifische Styles für bessere mobile Erfahrung */

/* PWA Splash Screen Simulation */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #6a1b9a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.pwa-splash.hidden {
    opacity: 0;
    pointer-events: none;
}

.pwa-splash .logo {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #6a1b9a;
    font-weight: bold;
    margin-bottom: 20px;
}

.pwa-splash .title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.pwa-splash .loading {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Offline-Indikator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

/* PWA Install Button Styles */
#pwa-install-btn {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 9999 !important;
    background: #6a1b9a !important;
    color: white !important;
    border: none !important;
    padding: 10px 15px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(106, 27, 154, 0.3) !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    display: none !important;
}

#pwa-install-btn:hover {
    background: #7b1fa2 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(106, 27, 154, 0.4) !important;
}

#pwa-install-btn:active {
    transform: translateY(0) !important;
}

/* PWA Notification Styles */
.pwa-notification {
    position: fixed !important;
    top: 70px !important;
    right: 10px !important;
    z-index: 9998 !important;
    background: #2196F3 !important;
    color: white !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    max-width: 320px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s ease !important;
}

.pwa-notification.pwa-notification-info {
    background: #2196F3 !important;
}

.pwa-notification.pwa-notification-success {
    background: #4CAF50 !important;
}

.pwa-notification.pwa-notification-error {
    background: #f44336 !important;
}

/* Touch-friendly Anpassungen für PWA */
@media (max-width: 768px) {
    /* Größere Touch-Targets */
    .navbar button {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 12px 16px !important;
    }
    
    /* Bessere Sichtbarkeit von Formularelementen */
    input, textarea, select {
        min-height: 44px !important;
        font-size: 16px !important; /* Verhindert Zoom auf iOS */
    }
    
    /* PWA-spezifische Anpassungen für Vollbild-Modus */
    body.pwa-mode {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .pwa-mode .header {
        top: calc(5px + env(safe-area-inset-top));
    }
    
    .pwa-mode .navbar {
        bottom: env(safe-area-inset-bottom);
    }
    
    .pwa-mode .content {
        margin-top: calc(59px + env(safe-area-inset-top));
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* Landscape-Modus Anpassungen */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        height: 44px !important;
    }
    
    .header-content {
        height: 40px !important;
    }
    
    .content {
        margin-top: 49px !important;
    }
    
    .navbar {
        height: 50px !important;
    }
}

/* Dark Mode Support (falls implementiert) */
@media (prefers-color-scheme: dark) {
    .pwa-splash {
        background: #2c1810;
    }
    
    .pwa-splash .logo {
        background: #1a1a1a;
        color: #6a1b9a;
    }
}

/* Animations für bessere UX */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Loading Spinner für PWA */
.pwa-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* PWA-spezifische Hover-Effekte für Desktop */
@media (hover: hover) {
    .navbar button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Bessere Sichtbarkeit für wichtige Aktionen in PWA */
.primary-action {
    background: #6a1b9a !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-height: 48px !important;
}

.primary-action:hover {
    background: #7b1fa2 !important;
    transform: translateY(-1px) !important;
}

.primary-action:active {
    transform: translateY(0) !important;
}

/* Verbesserte Fokus-Sichtbarkeit */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #6a1b9a !important;
    outline-offset: 2px !important;
}

/* PWA Status Bar Anpassung für iOS */
@supports (padding-top: env(safe-area-inset-top)) {
    .ios-pwa-mode {
        padding-top: env(safe-area-inset-top);
    }
}

