/* pwa.css - Стили для PWA */

/* Индикатор офлайн режима */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff9800;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

.offline-indicator i {
    font-size: 18px;
}

.offline-indicator span {
    font-weight: 500;
}

/* Уведомление об обновлении */
.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
}

.update-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.update-content i {
    font-size: 24px;
    color: #3498db;
}

.update-content span {
    flex: 1;
    font-size: 14px;
}

.btn-update {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-update:hover {
    background: #2980b9;
}

.btn-close-update {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.btn-close-update:hover {
    color: white;
}

/* Предложение установки */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideUp 0.3s ease;
    max-width: 500px;
    width: 90%;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.install-content i {
    font-size: 28px;
    color: #3498db;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.install-text strong {
    font-size: 16px;
    color: #2c3e50;
}

.install-text span {
    font-size: 13px;
    color: #7f8c8d;
}

.btn-install {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-install:hover {
    background: #34495e;
}

/* Уведомления PWA */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #3498db;
    max-width: 350px;
}

.pwa-notification.success {
    border-left-color: #2ecc71;
}

.pwa-notification.success i {
    color: #2ecc71;
}

.pwa-notification.error {
    border-left-color: #e74c3c;
}

.pwa-notification.error i {
    color: #e74c3c;
}

.pwa-notification.warning {
    border-left-color: #f39c12;
}

.pwa-notification.warning i {
    color: #f39c12;
}

.pwa-notification i {
    font-size: 20px;
    color: #3498db;
}

.pwa-notification span {
    font-size: 14px;
    color: #2c3e50;
    flex: 1;
}

.pwa-notification.fade-out {
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

/* Предложение уведомлений */
.notification-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideInLeft 0.3s ease;
    max-width: 400px;
}

.prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.prompt-content i {
    font-size: 24px;
    color: #f39c12;
}

.prompt-content span {
    flex: 1;
    font-size: 14px;
    color: #2c3e50;
}

.btn-enable {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-enable:hover {
    background: #2980b9;
}

/* PWA режим */
body.pwa-mode {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

body.pwa-mode .sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

body.pwa-mode .sidebar-header {
    padding-top: max(15px, env(safe-area-inset-top));
}

body.pwa-mode .logout-section {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Анимации */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .pwa-update-notification,
    .pwa-install-prompt,
    .notification-prompt {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-width: none;
    }
    
    .pwa-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .install-content,
    .update-content,
    .prompt-content {
        flex-wrap: wrap;
    }
    
    .btn-install {
        width: 100%;
    }
}

/* Поддержка темной темы */
@media (prefers-color-scheme: dark) {
    .pwa-install-prompt,
    .pwa-notification,
    .notification-prompt {
        background: #2c3e50;
        color: white;
    }
    
    .install-text strong {
        color: white;
    }
    
    .install-text span {
        color: #bdc3c7;
    }
    
    .pwa-notification span {
        color: white;
    }
    
    .prompt-content span {
        color: white;
    }
    
    .btn-install,
    .btn-enable {
        background: #3498db;
    }
    
    .btn-close-update:hover {
        color: white;
    }
}