/* assets/css/pwa.css - Complete PWA Styles */
.install-button {
    position: fixed;
    bottom: 260px !important; /* Moved 50px higher from the previous 100px */
    right: 20px;
    background: linear-gradient(135deg, #FF6B01, #FFA500);
    color: white;
    border: none;
    padding: 10px 228px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 1, 0.4);
    z-index: 10000;
    font-size: 12px !important;
    font-weight: 500 !important;
    display: none; /* Hidden by default */
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-family: inherit;
}


.install-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 1, 0.6);
    background: linear-gradient(135deg, #FF8C01, #FFB732);
}

.install-button:active {
    transform: translateY(0);
}

.install-button.pulsing {
    animation: pulse 2s infinite, bounce 3s infinite;
}

/* PWA Notification */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
    border-left: 4px solid #3498db;
}

.pwa-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.pwa-notification-content {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.pwa-notification-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.pwa-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pwa-notification-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Notification Types */
.pwa-notification-success {
    border-left-color: #27ae60;
}

.pwa-notification-warning {
    border-left-color: #f39c12;
}

.pwa-notification-error {
    border-left-color: #e74c3c;
}

.pwa-notification-info {
    border-left-color: #3498db;
}

/* Standalone PWA specific styles */
.pwa-standalone .desktop-header {
    padding-top: env(safe-area-inset-top);
}

.pwa-standalone .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

.pwa-standalone .fixed-order-btn,
.pwa-standalone .fixed-contact-btn {
    bottom: calc(80px + env(safe-area-inset-bottom));
}

/* Offline state */
body.offline::before {
    content: "⚠️ Offline - Some features limited";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #e74c3c;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    z-index: 10000;
    font-weight: 600;
}

/* Loading states */
.pwa-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.pwa-loading::after {
    content: "";
    position: absolute;
    top: 60%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #FF6B01;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* App-like transitions */
.pwa-standalone main {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 107, 1, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(255, 107, 1, 0.7); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(255, 107, 1, 0.4); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0,-8px,0); }
    70% { transform: translate3d(0,-4px,0); }
    90% { transform: translate3d(0,-2px,0); }
}

/* Enhanced touch interactions */
@media (hover: none) and (pointer: coarse) {
    .install-button {
        padding: 15px 25px;
        font-size: 16px;
        min-height: 44px; /* Minimum touch target size */
    }
    
    .pwa-notification {
        top: env(safe-area-inset-top);
        right: env(safe-area-inset-right);
        left: env(safe-area-inset-left);
        max-width: none;
        margin: 10px;
        border-radius: 12px;
    }
    
    .pwa-notification-content {
        padding: 20px;
    }
}

/* Print styles for PWA */
@media print {
    .install-button,
    .pwa-notification {
        display: none !important;
    }
}

/* Safe area support for notched devices */
@supports(padding: max(0px)) {
    .pwa-standalone .mobile-bottom-nav {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    .install-button {
        bottom: max(100px, calc(20px + env(safe-area-inset-bottom)));
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .install-button,
    .pwa-notification {
        animation: none;
        transition: none;
    }
    
    .pwa-notification {
        transform: none;
        opacity: 1;
    }
}