/*
 * Mandatory Announcements — Blocking Full-Screen Modal
 *
 * Scoped entirely under .amby-mandatory-overlay so it never collides with host
 * page styles (the widget injects this overlay into the 3rd-party host DOM).
 * Uses a near-max z-index so it sits above the chat widget overlay (49998).
 */

.amby-mandatory-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    box-sizing: border-box;
    background: rgba(10, 14, 24, 0.78);
    backdrop-filter: blur(4px);
    z-index: 2147483600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    animation: amby-mandatory-fade-in 0.2s ease-out;
}

@keyframes amby-mandatory-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.amby-mandatory-overlay .amby-mandatory__modal {
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 1100px;
    height: 88vh;
    max-height: 88vh;
    background: #ffffff;
    color: #1a1f2b;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.amby-mandatory-overlay .amby-mandatory__header {
    flex: 0 0 auto;
    padding: 24px 32px 16px;
    border-bottom: 1px solid #e6e9f0;
}

.amby-mandatory-overlay .amby-mandatory__badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b4232a;
    background: #fdecec;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.amby-mandatory-overlay .amby-mandatory__title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 25px);
    line-height: 1.25;
    font-weight: 700;
    color: #14181f;
}

.amby-mandatory-overlay .amby-mandatory__content {
    flex: 1 1 auto;
    overflow: auto;
    padding: 24px 32px;
}

.amby-mandatory-overlay .amby-mandatory__body {
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.amby-mandatory-overlay .amby-mandatory__iframe {
    width: 100%;
    height: 100%;
    min-height: 50vh;
    border: 0;
    display: block;
    background: #000;
}

.amby-mandatory-overlay .amby-mandatory__footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    padding: 18px 32px;
    border-top: 1px solid #e6e9f0;
    background: #f7f8fb;
}

.amby-mandatory-overlay .amby-mandatory__countdown-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #5a6273;
    font-size: 14px;
}

.amby-mandatory-overlay .amby-mandatory__countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    background: #eceef4;
    color: #2b3142;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.amby-mandatory-overlay .amby-mandatory__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 32px;
    border: 0;
    border-radius: 10px;
    background: #ffffff;
    color: #000000;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.amby-mandatory-overlay .amby-mandatory__close:hover {
    background: #1d4ed8;
    color: white;
}

.amby-mandatory-overlay .amby-mandatory__close:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (max-width: 640px) {
    .amby-mandatory-overlay {
        padding: 0;
    }
    .amby-mandatory-overlay .amby-mandatory__modal {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .amby-mandatory-overlay .amby-mandatory__header,
    .amby-mandatory-overlay .amby-mandatory__content,
    .amby-mandatory-overlay .amby-mandatory__footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* =========================================================================
   HTML-announcement overrides (.amby-mandatory__modal--html)
   Applied when the announcement uses html_content (rich/interactive HTML).
   The host HTML typically uses a dark background, so we darken the modal
   chrome (header + footer) to avoid a jarring white strip around the iframe.
   ========================================================================= */

.amby-mandatory-overlay .amby-mandatory__content--html {
    padding: 0;
    background: #000;
    overflow: hidden; /* iframe fills the area; let it handle its own scroll */
}

.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__header {
    background: #13171f;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__title {
    color: #e4eaf5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap-reverse;
    line-height: 1;
    align-content: center;
}

.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__footer {
    background: #13171f;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__countdown-wrap {
    color: #6b7a99;
}

.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__countdown {
    background: #1e2538;
    color: #b8c4dc;
}

/* Keep the close button blue — it reads well on both light and dark footers */
.amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__close:hover {
    background: #1d4ed8;
}

/* "AMBY NEWS:" logo + label prefix */
.amby-mandatory-overlay .amby-mandatory__news-prefix {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 4px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #96c1ff;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    align-self: flex-start;
}

.amby-mandatory-overlay .amby-mandatory__title-text {
    flex: 1 1 0;
    min-width: 0;
    display: block;
    line-height: 0.92;
}

.amby-mandatory-overlay .amby-mandatory__logo {
    height: 20px;
    width: auto;
    border-radius: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__header,
    .amby-mandatory-overlay .amby-mandatory__modal--html .amby-mandatory__footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}
