/**
 * BEAMY PWA Styles
 * Install prompts, notifications, and offline indicators
 */

/* Install Button */
.pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #0030FF 0%, #4B8BC7 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 48, 255, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(100px) scale(0.9);
    pointer-events: none;
}

.pwa-install-button.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.pwa-install-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 48, 255, 0.5);
}

.pwa-install-button:active {
    transform: translateY(-1px);
}

.pwa-install-button i {
    font-size: 20px;
}

/* Update Notification */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: white;
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-update-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-update-content i {
    font-size: 24px;
    color: #0030FF;
}

.pwa-update-content span {
    font-weight: 600;
    color: #333;
}

.pwa-update-btn {
    background: #0030FF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-update-btn:hover {
    background: #0026CC;
    transform: scale(1.05);
}

/* Success Toast */
.pwa-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10000;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 50px;
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pwa-toast i {
    font-size: 20px;
}

/* Offline Indicator */
.pwa-offline {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pwa-offline.show {
    transform: translateY(0);
}

.pwa-offline i {
    font-size: 18px;
}

/* PWA Mode Adjustments */
.pwa-mode body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS Standalone Mode */
.ios-standalone body {
    padding-top: env(safe-area-inset-top);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pwa-install-button {
        bottom: 16px;
        right: 16px;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .pwa-install-button i {
        font-size: 18px;
    }
    
    .pwa-update-notification {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: calc(100% - 32px);
    }
    
    .pwa-toast {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        max-width: calc(100% - 32px);
    }
    
    .pwa-toast.show {
        transform: translateX(0) translateY(0);
    }
}

@media (max-width: 480px) {
    .pwa-install-button {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .pwa-toast {
        font-size: 14px;
        padding: 14px 20px;
    }
    
    .pwa-update-content span {
        font-size: 14px;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading State for PWA */
.pwa-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
}

.pwa-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #0030FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Print Mode (hide PWA elements) */
@media print {
    .pwa-install-button,
    .pwa-update-notification,
    .pwa-toast,
    .pwa-offline {
        display: none !important;
    }
}

