/* ==========================================================================
   SchoolAira Real-Time Connectivity Monitor & Auto-Dismiss System
   ========================================================================== */

#connectivity-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#connectivity-overlay.active {
    opacity: 1;
    visibility: visible;
}

.connectivity-card {
    width: 90%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 28px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

#connectivity-overlay.active .connectivity-card {
    transform: translateY(0) scale(1);
}

.connectivity-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #fee2e2;
    border: 2px solid #fecaca;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 36px;
    position: relative;
    animation: connPulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes connPulseRing {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
    }
}

.connectivity-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    line-height: 1.3;
}

.connectivity-desc {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 24px;
}

.connectivity-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 24px;
}

.connectivity-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #94a3b8;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: connSpin 0.8s linear infinite;
}

@keyframes connSpin {
    to { transform: rotate(360deg); }
}

.connectivity-btn-retry {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.connectivity-btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
}

.connectivity-btn-retry:active {
    transform: translateY(0);
}

/* Back Online Toast Notification */
#connectivity-online-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 1000000;
    background: #10b981;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    pointer-events: none;
}

#connectivity-online-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
