/* ============================================================
   Webinar Promo Bar — Frontend Styles
   ============================================================ */

#wpb-bar {
    /* Layout */
    position: fixed;
    left: 0;
    right: 0;
    /* Deliberat foarte mare — trece peste widget-uri flotante de tip
       chat (WhatsApp, Messenger) care folosesc de obicei z-index mic */
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 14px 24px;
    box-sizing: border-box;
    min-height: 60px;

    /* Colors via CSS custom properties (set inline by PHP) */
    background: var(--wpb-bg, #1a1a2e);
    color: var(--wpb-fg, #fff);

    /* Typography */
    font-size: 18px;
    line-height: 1.4;
    font-family: inherit;

    /* Initially hidden ABOVE viewport */
    top: 0;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;

    /* Transition — only transform & opacity */
    transition:
        transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
        opacity   0.28s ease;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

/* ── Visible at TOP ── */
#wpb-bar.wpb-show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ── Slide to BOTTOM ──
   JS adds .wpb-bottom after removing .wpb-show momentarily
   so the transition fires cleanly                          */
#wpb-bar.wpb-bottom {
    top: auto;
    bottom: 0;
    transform: translateY(110%);   /* starts below viewport  */
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.18);
    /* Rezervăm spațiu în dreapta jos — acolo stau de regulă widget-urile
       flotante (WhatsApp, Messenger etc.), ca să nu acopere butonul */
    padding-right: 84px;
}

#wpb-bar.wpb-bottom.wpb-show {
    transform: translateY(0);
   
}

/* ── Message text ── */
.wpb-msg {
    margin: 0;
    font-weight: 600;
    flex: 1;
    text-align: center;
    /* Prevent very long sentences from breaking layout */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── CTA Button ── */
.wpb-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    background: var(--wpb-btn-bg, #e85d26);
    color: var(--wpb-btn-fg, #fff) !important;
    transition: opacity 0.18s ease, transform 0.15s ease;
    letter-spacing: .3px;
    /* Dynamic pulse ring — draws the eye without being obnoxious */
    animation: wpb-pulse 2.2s ease-out infinite;
}

.wpb-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none !important;
    animation-play-state: paused;
}

.wpb-btn:active {
    transform: translateY(0);
    opacity: 1;
}

@keyframes wpb-pulse {
    0%   { box-shadow: 0 0 0 0 var(--wpb-btn-bg, #e85d26); }
    70%  { box-shadow: 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Close button ── */
.wpb-x {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.55;
    padding: 6px;
    border-radius: 4px;
    line-height: 1;
    transition: opacity 0.18s ease, background 0.18s ease;
    /* Keep it at the far right on desktop */
    margin-left: 4px;
}

.wpb-x:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.wpb-x svg {
    display: block;
}

/* ============================================================
   MOBILE — stack message above button
   ============================================================ */
@media (max-width: 640px) {
    #wpb-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 44px 10px 16px; /* right padding = room for X */
        position: fixed; /* stays fixed even when wrapping */
         width: 80%;
    }
    
    .wpb-msg {
        white-space: normal;
        text-align: center;
        flex-basis: 100%;
        font-size: 16px;
    }

    .wpb-btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 8px 14px;
    }

    .wpb-x {
        position: absolute;
        top: 10px;
        right: 12px;
        margin-left: 0;
    }

    /* Override for absolute positioning to work */
    #wpb-bar {
        position: fixed;
    }

    /* Pe mobil, când bara e jos, lăsăm loc și mai mult în dreapta —
       acolo apar de regulă bulele de chat flotante */
    #wpb-bar.wpb-bottom {
        padding-right: 76px;
    }
}

/* ============================================================
   Accessibility — respect reduced motion preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    #wpb-bar {
        transition: opacity 0.15s ease;
    }
    #wpb-bar,
    #wpb-bar.wpb-bottom {
        transform: none;
    }
    #wpb-bar.wpb-show {
        opacity: 1;
    }
    .wpb-btn {
        animation: none;
    }
}
