/**
 * PWA Update Notification Styles
 * Modern, comfortable and responsive design for Buy2Win theme
 */

/* Clean, Minimal Modal Styles */
.pwa-update-modal-content {
    background: var(--card-bg-color, #ffffff);
    border: none;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pwa-update-modal-content .modal-header {
    background: rgba(22, 33, 62, 0.8);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1rem;
    border: none;
}

.pwa-update-modal-content .modal-title {
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 0;
    margin-top: 0;
}

.pwa-update-modal-content .modal-title i {
    font-size: 1.2rem;
    animation: iconSpin 2s linear infinite;
}

@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pwa-update-modal-content .btn-close {
    opacity: 0.8;
    transition: all 0.2s ease;
}

.pwa-update-modal-content .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.pwa-update-modal-content .modal-body {
    padding: 1.5rem;
    color: var(--primary-t-color, #333);
}

.pwa-update-modal-content .modal-body .update-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.pwa-update-modal-content .modal-body p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--secondary-t-color, #666);
    margin-bottom: 0;
}

.pwa-update-modal-content .version-info .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}

.pwa-update-modal-content .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    background: transparent;
    border: none;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Toast Notification Styles */
.pwa-update-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 1rem 1.5rem;
    z-index: 10000;
    transition: bottom 0.3s ease-in-out;
    max-width: 90%;
    width: 400px;
}

.pwa-update-toast.show {
    bottom: 20px;
}

.pwa-update-toast-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-update-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

.pwa-update-toast-text {
    flex: 1;
    color: var(--primary-t-color);
}

.pwa-update-toast-text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--primary-t-color);
    font-size: 1rem;
}

.pwa-update-toast-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--secondary-t-color);
}

.pwa-update-toast-button {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-update-toast-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Animation for update icon */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Clean Button Styles */
.pwa-update-modal-content .btn {
    border-radius: 10px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    min-width: 90px;
}

.pwa-update-modal-content .btn-primary {
    background: var(--primary-color, #007bff);
    color: white;
}

.pwa-update-modal-content .btn-primary:hover {
    background: var(--primary-color, #0056d6);
    transform: translateY(-1px);
}

.pwa-update-modal-content .btn-outline-secondary {
    color: var(--secondary-t-color, #666);
    border: 1px solid rgba(108, 117, 125, 0.3);
    background: transparent;
}

.pwa-update-modal-content .btn-outline-secondary:hover {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.4);
    color: var(--primary-t-color, #333);
}

/* Mobile Responsive Design */
@media (max-width: 576px) {
    .pwa-update-modal-content {
        margin: 1rem;
        border-radius: 14px;
    }
    
    .pwa-update-modal-content .modal-header {
        padding: 1.25rem;
        border-radius: 14px 14px 0 0;
    }
    
    .pwa-update-modal-content .modal-title {
        font-size: 1rem;
    }
    
    .pwa-update-modal-content .modal-body {
        padding: 1.25rem;
    }
    
    .pwa-update-modal-content .modal-body .update-icon {
        font-size: 2rem;
    }
    
    .pwa-update-modal-content .modal-body p {
        font-size: 0.9rem;
    }
    
    .pwa-update-modal-content .modal-footer {
        padding: 1rem 1.25rem 1.25rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pwa-update-modal-content .btn {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Update Progress Indicator */
.pwa-update-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: 10001;
}

.pwa-update-progress.active {
    animation: updateProgress 2s ease-in-out infinite;
}

@keyframes updateProgress {
    0% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(0.7);
    }
    100% {
        transform: scaleX(1);
    }
}

/* Update Badge for App Icon (when supported) */
.pwa-update-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--danger-color, #dc3545);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 9999;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Enhanced Animations and Interactions */
.pwa-update-modal-content .modal-backdrop {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.4);
}

/* Loading Animation for Update Button */
@keyframes buttonSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pwa-update-modal-content .btn.loading {
    pointer-events: none;
    position: relative;
}

.pwa-update-modal-content .btn.loading i {
    animation: buttonSpinner 1s linear infinite;
}

/* Smooth transitions for all interactive elements */
.pwa-update-modal-content * {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.pwa-update-modal-content .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 0, 123, 255), 0.25);
}

.pwa-update-modal-content .btn-close:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Enhanced ripple effect */
.pwa-update-modal-content .btn:active {
    transform: scale(0.98);
}

/* Improved glassmorphism effect */
@supports (backdrop-filter: blur(10px)) {
    .pwa-update-modal-content {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
    }
    
    .pwa-update-toast {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
    }
}

/* Dark mode compatibility with enhanced styling */
@media (prefers-color-scheme: dark) {
    .pwa-update-modal-content {
        background: rgba(26, 26, 46, 0.95);
        color: #e0e0e0;
    }
    
    .pwa-update-toast {
        background: rgba(26, 26, 46, 0.95);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .pwa-update-modal-content .modal-body,
    .pwa-update-toast-text {
        color: #e0e0e0;
    }
    
    .pwa-update-modal-content .modal-body p {
        color: #b0b0b0;
    }
    
    .pwa-update-modal-content .modal-footer {
        background: rgba(22, 33, 62, 0.8);
    }
    
    .pwa-update-modal-content .modal-body .text-muted {
        background: rgba(255, 255, 255, 0.05);
        border-left-color: var(--primary-color, #007bff);
        color: #c0c0c0;
    }
    
    .pwa-update-modal-content .btn-secondary {
        background: rgba(255, 255, 255, 0.1);
        color: #d0d0d0;
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .pwa-update-modal-content .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
}

/* Additional styles for enhanced modal content */
.pwa-update-modal-content .update-icon {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.pwa-update-modal-content .update-benefits i {
    font-size: 1.5rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.pwa-update-modal-content .update-benefits .col-4:hover i {
    transform: scale(1.1);
    opacity: 1;
}

/* Improved disabled state for buttons */
.pwa-update-modal-content .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading button specific styles */
.pwa-update-modal-content .btn.loading {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb, 0, 123, 255), 0.8) 0%, rgba(var(--secondary-color-rgb, 108, 117, 125), 0.8) 100%);
}

/* Modal backdrop enhanced blur */
.modal-backdrop.show {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.4);
}