/* updates.css - Стили для уведомлений об обновлениях с прогресс-баром */

.update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 400px;
    width: calc(100% - 40px);
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    padding: 0;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.update-notification.hiding {
    animation: slideOutDown 0.3s ease-in forwards;
}

.update-notification .notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.update-notification .notification-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 17px;
}

.update-notification .notification-icon {
    font-size: 22px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.update-notification .notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: all var(--transition-fast);
    padding: 6px 10px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.update-notification .notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.update-notification .notification-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.update-notification .update-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.update-notification .update-icon {
    flex-shrink: 0;
    font-size: 32px;
    color: var(--neu-primary);
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.update-notification .update-text {
    flex: 1;
    min-width: 0;
}

.update-notification .update-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.update-notification .update-text p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.update-notification .update-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.update-notification .btn-update {
    flex: 1;
    min-width: 140px;
    background: linear-gradient(145deg, var(--neu-primary), var(--neu-primary-dark));
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    font-size: 15px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.update-notification .btn-update:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.update-notification .btn-update:active:not(:disabled) {
    transform: translateY(0);
}

.update-notification .btn-update:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.update-notification .btn-later {
    flex: 1;
    min-width: 140px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    font-size: 15px;
}

.update-notification .btn-later:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.update-notification .btn-later:active {
    background: var(--bg-active);
    transform: translateY(0);
}

/* Стили для прогресс-бара */
.update-notification .progress-container {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.update-notification .updating .progress-container {
    display: flex;
}

.update-notification .progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.update-notification .progress-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--neu-primary);
}

.update-notification .progress-percent {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, 'Cascadia Mono', 'Segoe UI Mono', monospace;
}

.update-notification .progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.update-notification .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--neu-primary) 0%, 
        var(--neu-primary-light) 50%, 
        var(--neu-primary) 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.update-notification .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: progressShine 1.5s infinite linear;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.update-notification .status-message {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
    min-height: 20px;
}

/* Стили для состояния обновления */
.update-notification .updating .update-actions {
    display: none;
}

.update-notification .updating .update-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Анимация успешного завершения */
.update-notification .update-complete {
    text-align: center;
    padding: 20px;
    display: none;
}

.update-notification .complete .update-complete {
    display: block;
}

.update-notification .update-complete-icon {
    font-size: 48px;
    color: #4CAF50;
    margin-bottom: 12px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.update-notification .update-complete-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.update-notification .update-complete-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .update-notification {
        left: 20px;
        right: 20px;
        max-width: none;
        bottom: 20px;
        top: auto;
        width: calc(100% - 40px);
        margin: 0 auto;
        max-height: 85vh;
    }
    
    .update-notification .notification-header {
        padding: 16px 20px;
    }
    
    .update-notification .notification-body {
        padding: 18px;
        gap: 16px;
    }
    
    .update-notification .update-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 14px;
    }
    
    .update-notification .update-icon {
        font-size: 36px;
    }
    
    .update-notification .update-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .update-notification .btn-update,
    .update-notification .btn-later {
        width: 100%;
        padding: 16px;
    }
    
    .update-notification .progress-bar {
        height: 10px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 375px) {
    .update-notification {
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
        bottom: 12px;
        max-height: 88vh;
    }
    
    .update-notification .notification-header {
        padding: 14px 16px;
    }
    
    .update-notification .notification-title {
        font-size: 15px;
    }
    
    .update-notification .notification-body {
        padding: 16px;
        max-height: calc(88vh - 108px);
    }
    
    .update-notification .update-text strong {
        font-size: 15px;
    }
    
    .update-notification .update-text p {
        font-size: 13px;
    }
    
    .update-notification .progress-text,
    .update-notification .progress-percent {
        font-size: 12px;
    }
}

/* Для планшетов в портретной ориентации */
@media (min-width: 768px) and (max-width: 1024px) {
    .update-notification {
        max-width: 450px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        right: auto;
    }
    
    .update-notification.hiding {
        transform: translateX(-50%) translateY(100px);
    }
}

/* Позиционирование с учетом безопасных зон на iOS */
@supports (padding: max(0px)) {
    .update-notification {
        bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }
}

/* Анимации */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    @keyframes slideInUp {
        from {
            transform: translateX(-50%) translateY(100px);
            opacity: 0;
        }
        to {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    @keyframes slideOutDown {
        from {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
        to {
            transform: translateX(-50%) translateY(100px);
            opacity: 0;
        }
    }
}