/* PWA Styles */

/* Install Button */
#install-button {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease-out;
}

#install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#install-button:active {
    transform: translateY(0);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PWA Mode Specific Styles */
body.pwa-mode {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Offline Mode Indicator */
body.offline-mode::before {
    content: 'Offline-Modus';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffc107;
    color: #000;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Safe area adjustments for iOS */
@supports (padding: env(safe-area-inset-top)) {
    .pwa-mode .app-wrapper {
        padding-top: env(safe-area-inset-top);
    }
    
    .pwa-mode .sidebar {
        padding-top: calc(env(safe-area-inset-top) + 1rem);
    }
    
    .pwa-mode .main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Loading spinner for offline content */
.offline-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .pwa-mode {
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }
}

/* Prevent pull-to-refresh on mobile */
body.pwa-mode {
    overscroll-behavior-y: contain;
}

/* Update notification */
.update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: #333;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideInUp 0.3s ease-out;
}

.update-notification button {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.update-notification button:hover {
    background: #0b5ed7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #install-button {
        bottom: 80px;
        right: 16px;
        padding: 10px 20px;
        font-size: 13px;
    }
}
