/**
 * Frynzy Offline & Slow Connection UI
 * Clean White / Native Dialog Style System
 */

.frynzy-offline-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    box-sizing: border-box;
    animation: frynzy-fade-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    background: transparent !important;
}

/* When embedded as an overlay inside the adult video player */
.frynzy-offline-container.is-video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 16px;
    background: rgba(8, 10, 16, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 999;
}

/* Normal Mode: NO GREY FRAMING, 100% CLEAN WHITE BACKGROUND */
.frynzy-offline-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 6px 12px;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    transform: translateZ(0);
}

.is-video-overlay .frynzy-offline-card {
    max-width: 380px;
    padding: 20px 22px 20px;
    border-radius: 26px;
    background: rgba(24, 28, 38, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6) !important;
    color: #ffffff !important;
}

/* Artwork Wrap & Floating Wi-Fi SVG */
.frynzy-offline-artwork-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 6px auto 12px auto;
}

@keyframes floatWiFi {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
}

.frynzy-offline-wifi-svg {
    display: block;
    margin: 0 auto;
    animation: floatWiFi 3.2s ease-in-out infinite;
}

/* Status Badge */
.frynzy-status-pill,
.frynzy-offline-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.frynzy-status-pill.status-offline,
.frynzy-offline-badge.is-offline {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fee2e2;
}

.frynzy-status-pill.status-slow,
.frynzy-offline-badge.is-slow {
    color: #d97706;
    background: #fffbeb;
    border: 1px solid #fef3c7;
}

.is-video-overlay .frynzy-status-pill.status-offline {
    color: #ff453a;
    background: rgba(255, 69, 58, 0.16);
    border: 1px solid rgba(255, 69, 58, 0.32);
}

.frynzy-status-dot,
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
    animation: frynzy-pulse-dot 1.8s infinite ease-in-out;
}

/* Typography */
.frynzy-offline-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a !important;
    margin: 0 0 8px;
    line-height: 1.28;
}

.is-video-overlay .frynzy-offline-title {
    color: #ffffff !important;
    font-size: 1.15rem;
}

.frynzy-offline-msg,
.frynzy-offline-desc {
    font-size: 0.90rem;
    line-height: 1.48;
    color: #64748b !important;
    margin: 0 auto 20px;
    max-width: 340px;
}

.is-video-overlay .frynzy-offline-msg,
.is-video-overlay .frynzy-offline-desc {
    color: #94a3b8 !important;
}

/* Buttons */
.frynzy-offline-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.frynzy-btn-retry {
    position: relative;
    width: 100%;
    height: 48px;
    border-radius: 9999px;
    background: #2563eb;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    transition: transform 0.16s ease, background 0.16s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.frynzy-btn-retry:active {
    transform: scale(0.97);
    background: #1d4ed8;
}

.frynzy-btn-retry.is-checking {
    pointer-events: none;
    opacity: 0.85;
}

/* Paramètres Wi-Fi Button Styling */
.frynzy-btn-wifi,
.frynzy-btn-settings {
    width: 100%;
    height: 46px;
    border-radius: 9999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    outline: none;
    color: #1e293b;
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.frynzy-btn-wifi:active,
.frynzy-btn-settings:active {
    transform: scale(0.97);
    background: #f1f5f9;
}

.frynzy-btn-wifi i,
.frynzy-btn-settings i {
    font-size: 0.95rem;
    color: #64748b;
}

.is-video-overlay .frynzy-btn-wifi,
.is-video-overlay .frynzy-btn-settings {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.is-video-overlay .frynzy-btn-wifi i,
.is-video-overlay .frynzy-btn-settings i {
    color: #94a3b8;
}

/* Offline Helper Hint */
.frynzy-offline-hint,
.frynzy-retry-hint {
    font-size: 0.80rem;
    color: #64748b;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
    text-align: center;
}

.frynzy-offline-hint i {
    color: #3b82f6;
}

.is-video-overlay .frynzy-offline-hint {
    color: #94a3b8;
}

/* Shake Animation */
.is-shaking,
.frynzy-ios-shake {
    animation: frynzy-shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Keyframes */
@keyframes frynzy-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.97) translateY(6px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes frynzy-pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

@keyframes frynzy-shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}
