/**
 * Amphyx Progressive Web App - Banner & Toast Styles
 * Modern, Resilient, Brand-aligned (#0c2e60, #ee390f)
 */

/* 1. Conteneur principal de la bannière d'installation */
.campusx-pwa-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    max-width: 400px;
    width: calc(100% - 32px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s ease;
    pointer-events: none;
}

.campusx-pwa-banner.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 2. Carte d'installation - Totalement blanche, épurée, une seule couleur */
.campusx-pwa-card {
    position: relative;
    background: #ffffff !important;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 10px 30px rgba(12, 46, 96, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.campusx-pwa-close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease;
}

.campusx-pwa-close-btn:hover {
    color: #0c2e60;
    background: #f1f5f9;
}

.campusx-pwa-body {
    display: flex;
    align-items: center;
    gap: 14px;
}

.campusx-pwa-icon-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(12, 46, 96, 0.06);
}

.campusx-pwa-app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.campusx-pwa-icon-bell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    color: #0c2e60;
    font-size: 19px;
}

.campusx-pwa-text {
    flex: 1;
    min-width: 0;
}

.campusx-pwa-title {
    font-size: 15px;
    font-weight: 800;
    color: #0c2e60;
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.campusx-pwa-desc {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.campusx-pwa-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.campusx-pwa-btn {
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.campusx-pwa-btn-later {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.campusx-pwa-btn-later:hover {
    background: #f8fafc;
    color: #0f172a;
}

.campusx-pwa-btn-install {
    background: #0c2e60;
    color: #ffffff;
    border: 1px solid #0c2e60;
    box-shadow: 0 2px 8px rgba(12, 46, 96, 0.18);
}

.campusx-pwa-btn-install:hover {
    background: #143e7d;
    border-color: #143e7d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(12, 46, 96, 0.25);
}

/* 3. Toasts Flottants PWA */
.campusx-pwa-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    background: #0c2e60;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 380px;
}

.campusx-pwa-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.campusx-pwa-toast-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.campusx-pwa-toast.is-offline {
    background: #1e293b;
    border-left: 4px solid #f59e0b;
}

.campusx-pwa-toast.is-online {
    background: #064e3b;
    border-left: 4px solid #10b981;
}

.campusx-pwa-toast.is-update {
    background: #0c2e60;
    border-left: 4px solid #ee390f;
}

.campusx-pwa-toast.is-success {
    background: #0c2e60;
    border-left: 4px solid #10b981;
}

/* 4. Optimisation Responsive Mobile */
@media (max-width: 576px) {
    .campusx-pwa-banner {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: calc(100% - 24px);
        max-width: 100%;
    }
    .campusx-pwa-card {
        padding: 16px 16px;
        border-radius: 16px;
    }
    .campusx-pwa-title {
        font-size: 15.5px;
    }
    .campusx-pwa-desc {
        font-size: 12.5px;
    }
    .campusx-pwa-toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: calc(100% - 24px);
    }
}
