/* ==========================================================================
   STREAMRANK - STREAM ALERTS OVERLAY (BITS, FOLLOWS, SUBS)
   Theme: High-Tech Telemetry & Cyber Motorsport
   ========================================================================== */

.stream-alerts-overlay {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -25%);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    font-family: 'Titillium Web', 'Outfit', system-ui, -apple-system, sans-serif;
}

.stream-alerts-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.stream-alerts-overlay.hiding {
    opacity: 0 !important;
    transition: opacity 0.35s ease, visibility 0.35s ease !important;
}

.stream-alerts-overlay.hiding .stream-alert-card {
    transform: translateY(-20px) scale(0.92);
    transition: transform 0.35s cubic-bezier(0.7, 0, 0.84, 0);
}

/* Animaciones de Entrada aplicadas a la tarjeta interna */
.stream-alerts-overlay.anim-slide.show .stream-alert-card {
    animation: alertSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stream-alerts-overlay.anim-zoom.show .stream-alert-card {
    animation: alertZoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.stream-alerts-overlay.anim-bounce.show .stream-alert-card {
    animation: alertBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.stream-alerts-overlay.anim-fade.show .stream-alert-card {
    animation: alertFadeIn 0.4s ease forwards;
}

@keyframes alertSlideIn {
    0% { transform: translateY(-40px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes alertZoomIn {
    0% { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes alertBounceIn {
    0% { transform: translateY(-50px) scale(0.85); opacity: 0; }
    60% { transform: translateY(10px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes alertFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Alert Card Container */
.stream-alert-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: var(--alert-media-width, 840px);
    max-width: 98vw;
    text-align: center;
}

/* Media Container (Videos, GIFs, YouTube) */
.stream-alert-media-container {
    position: relative;
    max-width: 98vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.stream-alert-media-container video,
.stream-alert-media-container iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 85vh;
    object-fit: contain;
    border: none;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    background: transparent;
}

.stream-alert-media-container img {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.85));
}

.stream-alert-yt-wrapper {
    position: relative;
    width: 100%;
    height: calc(var(--alert-media-width, 840px) * 9 / 16);
    max-width: 100%;
    max-height: 85vh;
    overflow: hidden;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
    background: #000;
}

.stream-alert-yt-wrapper iframe {
    position: absolute;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stream-alert-yt-shield {
    position: absolute;
    inset: 0;
    pointer-events: auto;
    z-index: 10;
}

/* Telemetry Text Banner */
.stream-alert-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 28px 14px 20px;
    background: rgba(13, 16, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 5px solid var(--alert-accent, #00f2fe);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 242, 254, 0.15);
    min-width: 460px;
    max-width: min(98vw, 1200px);
    width: 100%;
}

.stream-alert-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--alert-accent, #00f2fe);
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.35);
    flex-shrink: 0;
}

.stream-alert-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex: 1;
    overflow: hidden;
}

.stream-alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: var(--alert-accent, #00f2fe);
    margin-bottom: 3px;
}

.stream-alert-message {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    word-break: break-word;
}

.stream-alert-user-message {
    margin-top: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    font-style: italic;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.35);
    border-left: 3px solid var(--alert-accent, #00f2fe);
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Preset Animated Pulse / Sparkline */
.stream-alert-sparkle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--alert-accent, #00f2fe), transparent);
    animation: alertSparkPulse 1.5s infinite ease-in-out;
}

@keyframes alertSparkPulse {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}
