/* ==========================================================================
   Webinar Banner — Smart Sticky Pill
   Two states:
     1. .webinar-banner (default)  → Full-width blue info strip in page flow
     2. .webinar-banner.is-compact → Floating compact pill docked under navbar
   ========================================================================== */

/* ── Full-width strip (initial state) ─────────────────────────────────── */
.webinar-banner-wrapper {
    width: 100%;
    /* min-height ensures page doesn't jump abruptly when inner banner goes fixed */
    min-height: 56px;
    position: relative;
    z-index: 990; /* CRITICAL: High z-index prevents DOM siblings from overlapping the fixed child */
}

.webinar-banner {
    position: relative;         /* Normal page flow — does NOT cover navbar */
    width: 100%;
    /* Dark Premium Gradient - Lightened to stand out from Header */
    background: linear-gradient(90deg, #012b39 0%, #024a64 50%, #012b39 100%);
    background-size: 200% 100%;
    animation: wb-gradient-shift 8s ease-in-out infinite;
    z-index: 10;                /* Below navbar (z-index: 1000) */
    overflow: hidden;
    /* GSAP will read these and morph from them */
    border-radius: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes wb-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.webinar-banner__inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    gap: 20px;
}

/* Live pulse dot */
.webinar-banner__live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4ADAC2;
    opacity: 0.8;
    flex-shrink: 0;
    animation: wb-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(74, 218, 194, 0.4);
}

@keyframes wb-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%       { opacity: 1;   transform: scale(1.3); }
}

.webinar-banner__left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.webinar-banner__label {
    font-family: var(--font-body);
    font-size: var(--font-size-body-xxs); /* was 11px → snap to 12px */
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent); /* Neon Green */
    white-space: nowrap;
    flex-shrink: 0;
}

.webinar-banner__divider {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.webinar-banner__title {
    font-family: var(--font-body);
    font-size: var(--font-size-body-ms); /* 15px */
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.webinar-banner__date {
    font-family: var(--font-body);
    font-size: var(--font-size-body-xs); /* was 13px → snap to 14px */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    flex-shrink: 0;
}

/* CTA button */
.webinar-banner__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-accent);
    color: #003143; /* Dark text for contrast against green */
    padding: 9px 22px;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: var(--font-size-body-xs); /* was 13px → snap to 14px */
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 200ms ease, transform 200ms ease, box-shadow 200ms ease;
    box-shadow: 0 4px 12px rgba(125, 224, 102, 0.2);
    position: relative;
    overflow: hidden; /* For shine effect */
}

/* Subtle shine animation */
.webinar-banner__cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    animation: cta-shine 3s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cta-shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.webinar-banner__cta:hover {
    background-color: #8ef575; /* Lighter neon green */
    color: #003143;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(125, 224, 102, 0.4);
}

.webinar-banner__cta .material-icons {
    font-size: 16px;
}

/* Close button — hidden in strip state, visible in compact state */
.webinar-banner__close {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background 150ms ease;
    padding: 0;
}

.webinar-banner__close .material-icons {
    font-size: 16px;
}

.webinar-banner__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Compact state: floating pill docked below navbar ──────────────────── */
/*
 * GSAP sets position:fixed, adjusts top, width, border-radius, padding, etc.
 * CSS defines the end-state visual look so GSAP can interpolate smoothly.
 */
.webinar-banner.is-compact {
    position: fixed;
    /* top and width are managed by GSAP dynamically, but fallbacks provided */
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: var(--container-max-width);
    border-radius: 0 0 30px 30px;
    padding: 0;
    z-index: 990;           /* Under navbar (z:1000) */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08); /* Dark shadow + sleek subtle border */
    cursor: pointer;
}

.webinar-banner.is-compact .webinar-banner__inner {
    padding: 4px 16px 4px 44px; /* Space for close button on the left */
    height: 48px !important; /* Slightly taller to fit content better */
    min-height: 48px;
    gap: 12px;
}

/* In compact mode, show the content beautifully inline but scaled down slightly */
.webinar-banner.is-compact .webinar-banner__title {
    font-size: var(--font-size-body-xs); /* was 13.5px → snap to 14px */
    /* remove truncation clamp if there's enough room now */
    max-width: 100%;
}

.webinar-banner.is-compact .webinar-banner__date {
    font-size: var(--font-size-body-xxs); /* 12px */
}

.webinar-banner.is-compact .webinar-banner__label {
    font-size: var(--font-size-body-xxs); /* was 10px → snap to 12px */
}

.webinar-banner.is-compact .webinar-banner__cta {
    padding: 6px 14px; /* Smaller button padding */
    font-size: var(--font-size-body-xxs); /* 12px */
    background-color: var(--color-accent);
    color: #003143;
    box-shadow: 0 2px 8px rgba(125, 224, 102, 0.2);
}

.webinar-banner.is-compact .webinar-banner__cta::after {
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
}

.webinar-banner.is-compact .webinar-banner__cta:hover {
    background-color: #8ef575;
    color: #003143;
    transform: translateY(-1px);
}

.webinar-banner.is-compact .webinar-banner__close {
    display: flex;
    /* Move to left side */
    left: 12px;
    right: auto;
    width: 24px;
    height: 24px;
    background: transparent;
    opacity: 0.6;
    color: #ffffff;
}

.webinar-banner.is-compact .webinar-banner__close .material-icons {
    font-size: 16px;
}

.webinar-banner.is-compact .webinar-banner__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* Hover lift for the whole compact card */
.webinar-banner.is-compact:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* ── Dismissed state ───────────────────────────────────────────────────── */
.webinar-banner.is-dismissed {
    display: none !important;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
    .webinar-banner.is-compact {
        top: 78px;
    }
}

@media (max-width: 767px) {
    .webinar-banner__inner {
        padding: 0 16px;
        gap: 8px;
    }
    
    .webinar-banner__left {
        gap: 8px;
    }
    
    .webinar-banner__cta {
        padding: 6px 12px;
        font-size: var(--font-size-body-xxs); /* was 11px → snap to 12px */
    }

    /* On mobile, compact pill appears at bottom-center */
    .webinar-banner.is-compact {
        top: auto !important;
        bottom: env(safe-area-inset-bottom, 24px) !important;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 32px) !important;
        border-radius: 99px !important; /* Full pill shape on mobile */
        padding-top: 0 !important; /* Prevent GSAP from injecting 30px top padding */
    }

    .webinar-banner.is-compact .webinar-banner__inner {
        padding: 4px 12px 4px 40px; /* Space for close button */
        gap: 8px;
    }

    /* On mobile space is tight, hide date and divider to save space in BOTH states */
    .webinar-banner__date,
    .webinar-banner__divider {
        display: none;
    }

    /* Keep the label in full state, but hide in compact if needed */
    .webinar-banner.is-compact .webinar-banner__label {
        display: none;
    }

    /* Force title to take up remaining space but truncate properly */
    .webinar-banner__title {
        font-size: var(--font-size-body-xs); /* was 13px → snap to 14px */
        max-width: none;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .webinar-banner.is-compact .webinar-banner__cta {
        padding: 6px 10px;
        font-size: var(--font-size-body-xxs); /* was 11px → snap to 12px */
        flex-shrink: 0;
    }
    
    .webinar-banner__cta {
        flex-shrink: 0;
    }
    
    .webinar-banner.is-compact .webinar-banner__cta .material-icons {
        font-size: 14px;
        margin-left: -2px;
    }
}

@media (max-width: 480px) {
    .webinar-banner__inner {
        padding: 0 12px;
    }
    .webinar-banner.is-compact .webinar-banner__inner {
        padding: 4px 8px 4px 36px;
    }
    .webinar-banner.is-compact .webinar-banner__close {
        left: 8px;
    }
}
