/* PWA Styles */

/* Offline indicator */
.offline {
    position: relative;
}

.offline::before {
    content: "🔴 Офлайн режим";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    z-index: 9999;
}

/* Install button animations */
.install-button {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* PWA app-like experience */
@media (display-mode: standalone) {
    body {
        padding-top: 0;
    }
    
    .navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    .mobile-footer {
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* Loading indicator for PWA */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.pwa-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.pwa-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PWA notification styles */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 15px 20px;
    z-index: 1001;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* PWA install prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    padding: 20px;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    max-width: 300px;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* PWA splash screen */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    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;
    margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.pwa-splash .app-name {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.pwa-splash .loading-text {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

/* PWA offline page */
.offline-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    text-align: center;
    padding: 20px;
}

.offline-page .icon {
    font-size: 64px;
    color: #6c757d;
    margin-bottom: 20px;
}

.offline-page .title {
    font-size: 24px;
    font-weight: bold;
    color: #343a40;
    margin-bottom: 10px;
}

.offline-page .message {
    color: #6c757d;
    margin-bottom: 20px;
}

.offline-page .retry-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.offline-page .retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* PWA cache status */
.cache-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.cache-status:hover {
    opacity: 1;
}

/* PWA update notification */
.update-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 30px;
    z-index: 1002;
    text-align: center;
    max-width: 400px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.update-notification .title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #343a40;
}

.update-notification .message {
    color: #6c757d;
    margin-bottom: 20px;
}

.update-notification .buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.update-notification .btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-notification .btn-primary {
    background: #667eea;
    color: white;
}

.update-notification .btn-secondary {
    background: #6c757d;
    color: white;
}

.update-notification .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
} 