/* ================================================
   BANNER STYLES - Unified Banner System
   Tối ưu accessibility và styling cho banner
   ================================================ */

/* ================================================
   BANNER CLOSE BUTTONS - Minimal & Clean
   Chỉ hiện khi hover vào góc phải trên
   ================================================ */

/* Vùng trigger ở góc phải trên - vô hình nhưng có thể hover */
.banner-close-trigger {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    z-index: 10;
    pointer-events: auto;
}

/* Nút close - MẶC ĐỊNH HOÀN TOÀN VÔ HÌNH */
.banner-close-btn,
.banner-close-btn-sticky {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: transparent; /* Ẩn mọi text content */
    font-size: 0; /* Không render text */
    line-height: 1;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 11;

    /* MẶC ĐỊNH: HOÀN TOÀN VÔ HÌNH */
    opacity: 0;
    pointer-events: none;
}

/* KHI HOVER vào vùng góc phải trên (60x60px) → hiện nút */
.banner-wrapper:hover .banner-close-btn,
.banner-container:hover .banner-close-btn,
.banner-responsive-container:hover .banner-close-btn-sticky,
div.relative:hover .banner-close-btn-sticky {
    opacity: 0.6;
    pointer-events: auto;
}

/* KHI HOVER trực tiếp vào nút → rõ hơn */
.banner-close-btn:hover,
.banner-close-btn-sticky:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

/* Click feedback */
.banner-close-btn:active,
.banner-close-btn-sticky:active {
    transform: scale(0.95);
}

/* Mobile: luôn hiện mờ để dễ thấy */
@media (max-width: 768px) {
    .banner-close-btn,
    .banner-close-btn-sticky {
        opacity: 0.4;
        pointer-events: auto;
    }

    .banner-close-btn:hover,
    .banner-close-btn-sticky:hover {
        opacity: 1 !important;
    }
}

/* Focus state cho accessibility */
.banner-close-btn:focus-visible,
.banner-close-btn-sticky:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    opacity: 1 !important;
    pointer-events: auto;
}

/* Icon × - CHỈ render qua ::before */
.banner-close-btn::before,
.banner-close-btn-sticky::before {
    content: '×';
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 16px; /* Kích thước cố định cho ::before */
    font-weight: 200;
    line-height: 1;
    color: white; /* Màu của ::before */
}

/* ================================================
   BANNER CONTAINER STYLES
   ================================================ */

.banner-container {
    position: relative;
    min-height: auto;
    display: flex;
    align-items: center;
}

.banner-wrapper {
    position: relative;
}

/* Desktop banner - full 728x90 size */
.desktop-banner-size .banner-container {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-banner-size .banner-image {
    width: 728px !important;
    height: 90px !important;
    max-width: 728px !important;
    max-height: 90px !important;
    object-fit: cover !important;
    display: block;
}

/* Mobile banner - responsive size */
.mobile-banner-size .banner-container {
    min-height: auto;
    display: flex;
    align-items: center;
}

.mobile-banner-size .banner-image {
    width: 100% !important;
    max-height: 50px !important;
    object-fit: contain !important;
    display: block;
}

/* ================================================
   STICKY BANNER POSITIONING
   ================================================ */

/* Fixed sticky banners use z-index from z-index-system.css */
.banner-sticky-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* z-index managed by z-index-system.css */
}

/* ================================================
   BANNER ANIMATIONS
   ================================================ */

/* Smooth fade in for banners */
.banner-wrapper,
.banner-container {
    animation: bannerFadeIn 0.3s ease-out;
}

@keyframes bannerFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================
   ACCESSIBILITY IMPROVEMENTS
   ================================================ */

/* Screen reader text */
.banner-close-btn .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus states for keyboard navigation */
.banner-item:focus-visible {
    outline: 3px solid var(--color-brand-primary, #34d399);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

/* ================================================
   RESPONSIVE ADJUSTMENTS
   ================================================ */

@media (max-width: 768px) {
    /* Ensure close buttons are touch-friendly */
    .banner-close-btn,
    .banner-close-btn-sticky {
        min-width: 44px;
        min-height: 44px;
    }

    /* Mobile banner full width */
    .mobile-banner-wrapper .banner-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ================================================
   EVENT SLIDER BANNER - Full width within container
   ================================================ */

/* Banner container should match the width of other cards */
.banner-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Banner wrapper should have consistent styling with other cards */
.banner-wrapper {
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
}

/* Banner image should be full width and maintain aspect ratio */
.banner-wrapper .banner-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ================================================
   DARK MODE SUPPORT
   ================================================ */

.dark .banner-close-btn,
.dark .banner-close-btn-sticky {
    background: rgba(0, 0, 0, 0.8);
}

.dark .banner-close-btn:hover,
.dark .banner-close-btn-sticky:hover {
    background: rgba(0, 0, 0, 0.95);
}
