/* =============================================================================
   Site-wide banner system  (assets/js/site-banners.js)
   Professional, restrained styling — sits under the navbar, above page content.
   Matches the portal's warm-charcoal dark theme; no loud animations.
   ============================================================================= */

#siteBannerContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Margin above and below the stack, before the page's own header/content. */
    margin: 4px 0 20px 0;
}

#siteBannerContainer:empty {
    display: none;
    margin: 0;
}

.si-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 44px 16px 18px;   /* extra right padding leaves room for the dismiss control */
    /* Deep navy -> aviation-blue gradient with a subtle cyan glow on the right.
       Complements the portal's navy/gold and ties into the blue GSX branding. */
    background:
        radial-gradient(150% 170% at 115% 50%,
            rgba(79, 195, 247, 0.08) 0%,
            rgba(79, 195, 247, 0.03) 48%,
            rgba(79, 195, 247, 0) 70%),
        linear-gradient(90deg, #18263A 0%, #1F4870 100%);
    border: 1px solid rgba(110, 198, 255, 0.38);        /* #6EC6FF frame, softened */
    border-left: 3px solid #4FC3F7;                     /* cyan accent */
    border-radius: 10px;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.3));
    overflow: hidden;
    animation: si-banner-in 0.22s ease-out;
}

@keyframes si-banner-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Left thumbnail (optional, uploaded per banner) */
.si-banner__media {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.si-banner__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Body */
.si-banner__body {
    flex: 1 1 auto;
    min-width: 0;
}

.si-banner__title {
    font-size: 0.98rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    margin: 0 0 2px 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.si-banner__message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.si-banner__message a {
    color: #6EC6FF;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.si-banner__message p:last-child { margin-bottom: 0; }

/* CTA buttons */
.si-banner__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.si-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 7px;
    border: 1px solid rgba(110, 198, 255, 0.6);   /* cyan outline for secondary CTAs */
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease), transform var(--transition-fast, 0.15s ease);
}

.si-banner__btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #6EC6FF;
    color: #ffffff;
    text-decoration: none;
}

.si-banner__btn:active { transform: translateY(1px); }

/* First CTA is the primary emphasis */
.si-banner__btn--primary {
    background: #3B82F6;
    border-color: #3B82F6;
    color: #ffffff;
}

.si-banner__btn--primary:hover {
    background: #5A97F8;
    border-color: #5A97F8;
    color: #ffffff;
}

/* Dismiss (always present) — quiet corner control */
.si-banner__dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
}

.si-banner__dismiss:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

/* Fade-out when dismissed */
.si-banner.si-banner--closing {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Responsive: stack actions under the message on narrow viewports */
@media (max-width: 640px) {
    .si-banner {
        flex-wrap: wrap;
        padding: 14px 40px 14px 16px;
    }
    .si-banner__body { flex: 1 1 100%; }
    .si-banner__actions {
        flex: 1 1 100%;
        margin-top: 4px;
    }
    .si-banner__media {
        width: 44px;
        height: 44px;
    }
}

/* Never show inside standalone / minimal / bug-report overlays */
body.standalone-mode #siteBannerContainer,
body.minimal-mode #siteBannerContainer,
body.bug-report-modal-open #siteBannerContainer {
    display: none !important;
}
