/* ========================================================
   Wiltex Live Notification — Widget v3
   Paleta kolorów zgodna z wiltex.pl:
     Grafitowy:  #333333  (nagłówki, nawigacja)
     Fiolet:     #89328B  (akcent brandowy)
     Tło jasne:  #F8F9FA
======================================================== */

#wiltex-live-box {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    width: 300px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 36px rgba(0,0,0,.20), 0 2px 8px rgba(0,0,0,.10);
    overflow: hidden;
    /* domyślnie ukryty — JS pokazuje po sprawdzeniu REST API */
    display: none;
    transform-origin: bottom right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid rgba(137,50,139,.15);
}

/* Animacja pojawiania się */
#wiltex-live-box.wlb-visible {
    animation: wlb-enter .45s cubic-bezier(.34,1.56,.64,1) both;
}
#wiltex-live-box.wlb-hide {
    animation: wlb-leave .3s ease forwards;
}

@keyframes wlb-enter {
    from { opacity: 0; transform: scale(.55) translateY(50px); }
    to   { opacity: 1; transform: scale(1)  translateY(0);     }
}
@keyframes wlb-leave {
    to   { opacity: 0; transform: scale(.55) translateY(50px); }
}

/* ---- Pasek tytułowy ---- */
.wlb-header {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #333333;
    color: #fff;
    padding: 11px 14px;
    position: relative;
    z-index: 2;
}

/* Gdy jest wideo/gif — pasek nakłada się na media, jest przezroczysty */
.wlb-header-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 100%);
    padding-bottom: 18px;
}

/* Pulsująca czerwona kropka LIVE */
.wlb-dot {
    width: 11px;
    height: 11px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    animation: wlb-pulse 1.2s ease-in-out infinite;
}
@keyframes wlb-pulse {
    0%,100% { box-shadow: 0 0 0 0   rgba(239,68,68,.8); }
    60%      { box-shadow: 0 0 0 8px rgba(239,68,68,0);  }
}

.wlb-live-label {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2.5px;
    color: #ef4444;
    flex: 1;
}

.wlb-close {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 22px;
    text-align: center;
    padding: 0;
    transition: background .2s;
    flex-shrink: 0;
}
.wlb-close:hover { background: rgba(255,255,255,.38); }

/* ---- Filmik / GIF ---- */
.wlb-video-wrap {
    position: relative;   /* niezbędne dla nagłówka-nakładki */
    width: 100%;
    aspect-ratio: 16/9;
    background: transparent;  /* brak czarnego/białego tła pod GIF-em */
    overflow: hidden;
}

/* Gdy jest media — kontener rezerwuje miejsce dla nakładkowego nagłówka */
.wlb-has-media {
    padding-top: 0;
}

.wlb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* GIF — <img> zamiast <video> */
.wlb-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}
.wlb-rec-badge {
    position: absolute;
    top: 8px;
    left: 10px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.wlb-rec-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    display: inline-block;
    animation: wlb-pulse 1s ease-in-out infinite;
}

/* ---- Treść ---- */
.wlb-body {
    padding: 14px 16px 8px;
    text-align: center;
}
.wlb-headline {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 800;
    color: #333333;
    line-height: 1.3;
}
.wlb-subtext {
    margin: 0;
    font-size: 12.5px;
    color: #89328B;
    font-weight: 600;
}

/* ---- Wrapper pełnej zawartości ---- */
.wlb-full { display: block; }

/* ---- Mały bąbelek (widoczny tylko gdy zminimalizowane) ---- */
.wlb-bubble {
    display: none; /* domyślnie ukryty */
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    padding: 12px 16px;
    background: #333333;
    border-radius: 50px;
    transition: background .2s, transform .15s;
    user-select: none;
}
.wlb-bubble:hover {
    background: #89328B;
    transform: scale(1.06);
}
.wlb-bubble-dot {
    width: 13px;
    height: 13px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    animation: wlb-pulse 1.2s ease-in-out infinite;
}
.wlb-bubble-text {
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* ---- Stan zminimalizowany ---- */
#wiltex-live-box.wlb-minimized {
    width: auto;
    border-radius: 50px;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
    overflow: visible;
    animation: none;
}
#wiltex-live-box.wlb-minimized .wlb-full {
    display: none;
}
#wiltex-live-box.wlb-minimized .wlb-bubble {
    display: flex;
}

/* ---- Chipsy platform ---- */
.wlb-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 14px 16px;
    justify-content: center;
}

.wlb-platform-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform .15s, opacity .2s;
    cursor: default;
    border: 1.5px solid;
}
.wlb-chip-link { cursor: pointer; }
.wlb-chip-link:hover { transform: translateY(-2px); opacity: .82; }

/* Kolory per platforma */
.wlb-chip-youtube   { color: #c00;    background: #fff0f0; border-color: #ffc5c5; }
.wlb-chip-facebook  { color: #0c54b8; background: #eef4ff; border-color: #b3cdff; }
.wlb-chip-instagram { color: #b5006e; background: #fff0f8; border-color: #ffb3da; }
.wlb-chip-tiktok    { color: #111;    background: #f2f2f2; border-color: #ccc;    }

.wlb-chip-icon { display: inline-flex; align-items: center; }
.wlb-chip-icon svg { width: 15px; height: 15px; flex-shrink: 0; }
.wlb-chip-arrow { font-size: 11px; opacity: .65; margin-left: 1px; }

/* ---- Mobile ---- */
@media (max-width: 380px) {
    #wiltex-live-box {
        bottom: 10px;
        right: 8px;
        left: 8px;
        width: auto;
        border-radius: 13px;
    }
}
