/**
 * @author Firma: 4Unit Systems Integration GmbH
 *         Adresse: Jahnstraße 36, 34582 Borken (Hessen)
 *         Telefon: 05682 73 48 26
 *         E-Mail: info@4unit.com
 *         Website: https://4unit.com
 */

/* PWA-specific styles */

/* Offline indicator animations */
.offline-indicator {
    animation: slideInFromLeft 0.3s ease-out;
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Install prompt animations */
.install-prompt {
    animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Notification animations */
.notification {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Offline mode styles */
body.offline {
    position: relative;
}

body.offline::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    z-index: 9999;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* PWA app-like styles */
@media (display-mode: standalone) {
    body {
        /* Remove browser UI when in standalone mode */
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Hide browser-specific elements in standalone mode */
    .browser-only {
        display: none !important;
    }
}

/* Touch-friendly buttons for mobile PWA */
.pwa-button {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Loading states for offline operations */
.offline-loading {
    position: relative;
    overflow: hidden;
}

.offline-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* PWA status indicators */
.pwa-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.pwa-status.online {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.pwa-status.offline {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.pwa-status.syncing {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

/* PWA install button styles */
.pwa-install-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

/* PWA notification styles */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
    z-index: 10000;
    animation: slideInFromRight 0.3s ease-out;
}

.pwa-notification.success {
    border-left-color: #10b981;
}

.pwa-notification.error {
    border-left-color: #ef4444;
}

.pwa-notification.warning {
    border-left-color: #f59e0b;
}

/* PWA offline content styles */
.offline-content {
    opacity: 0.7;
    pointer-events: none;
}

.offline-content.available {
    opacity: 1;
    pointer-events: auto;
}

/* PWA sync indicator */
.sync-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 12px;
    z-index: 10001;
    display: none;
}

.sync-indicator.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* PWA splash screen styles */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeOut 0.5s ease-out 2s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.pwa-splash-content {
    text-align: center;
    color: white;
}

.pwa-splash-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #3b82f6;
}

/* PWA responsive adjustments */
@media (max-width: 768px) {
    .pwa-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .pwa-status {
        bottom: 10px;
        left: 10px;
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* PWA dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-notification {
        background: #1f2937;
        color: white;
    }
    
    .pwa-status {
        backdrop-filter: blur(10px);
    }
}

/* PWA accessibility */
@media (prefers-reduced-motion: reduce) {
    .pwa-notification,
    .pwa-status,
    .install-prompt,
    .offline-indicator {
        animation: none;
    }
    
    .pwa-install-btn:hover {
        transform: none;
    }
} 