/**
 * PWA Styles
 * Styles for PWA install banner, update notifications, and status toasts
 */

/* ===== Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    z-index: 9999;
    transition: bottom 0.3s ease;
}

.pwa-install-banner.visible {
    bottom: 0;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.pwa-install-icon img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-text strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.pwa-install-text p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-install-btn {
    background: #4361ee;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-install-btn:hover {
    background: #3451d9;
}

.pwa-install-dismiss {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s ease;
}

.pwa-install-dismiss:hover {
    color: #64748b;
}

/* Mobile styles */
@media (max-width: 640px) {
    .pwa-install-content {
        flex-wrap: wrap;
    }

    .pwa-install-text {
        flex-basis: 100%;
        order: 1;
    }

    .pwa-install-icon {
        order: 2;
    }

    .pwa-install-actions {
        order: 3;
        flex-basis: 100%;
        justify-content: space-between;
        margin-top: 8px;
    }
}

/* ===== Update Notification ===== */
.sw-update-notification {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 16px 20px;
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    transition: top 0.3s ease;
}

.sw-update-notification.visible {
    top: 20px;
}

.sw-update-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sw-update-text {
    flex: 1;
}

.sw-update-text strong {
    display: block;
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.sw-update-text p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.sw-update-actions {
    display: flex;
    gap: 8px;
}

.sw-update-actions .btn {
    font-size: 0.875rem;
    padding: 8px 16px;
    min-height: 36px;
}

/* ===== Network Status Toast ===== */
.network-status-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 12px 20px;
    z-index: 10001;
    transition: top 0.3s ease;
    min-width: 250px;
}

.network-status-toast.visible {
    top: 20px;
}

.network-status-toast.online {
    border-left: 4px solid #10b981;
}

.network-status-toast.offline {
    border-left: 4px solid #f59e0b;
}

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

.toast-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.network-status-toast.online .toast-icon {
    color: #10b981;
}

.network-status-toast.offline .toast-icon {
    color: #f59e0b;
}

.toast-message {
    font-size: 0.9rem;
    color: #1e293b;
    font-weight: 500;
}

/* ===== Install Success Message ===== */
.pwa-install-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
}

.pwa-install-success p {
    margin: 0;
    font-weight: 500;
}

/* ===== Animations ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===== Dark Mode Support (if implemented) ===== */
@media (prefers-color-scheme: dark) {
    .pwa-install-banner,
    .sw-update-notification,
    .network-status-toast {
        background: #1e293b;
    }

    .pwa-install-text strong,
    .sw-update-text strong,
    .toast-message {
        color: #f1f5f9;
    }

    .pwa-install-text p,
    .sw-update-text p {
        color: #94a3b8;
    }

    .pwa-install-dismiss {
        color: #64748b;
    }

    .pwa-install-dismiss:hover {
        color: #94a3b8;
    }
}

/* ===== Standalone Mode Adjustments ===== */
@media all and (display-mode: standalone) {
    /* Add extra padding at top for iOS status bar */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Don't show install banner when already installed */
    .pwa-install-banner {
        display: none !important;
    }
}
