/* ================================================
   UNIFIED LAYOUT SYSTEM - Banner + Mobile + Navigation
   ================================================ */

/* Banner Section Consistency */
.banner-section {
    position: relative;
    z-index: 10;
    min-height: 80px;
    display: flex;
    align-items: center;
}

/* Banner Container Improvements - Clean simple design */
.banner-responsive-container {
    display: flex;
    align-items: center;
    position: relative;
}

.dark .banner-responsive-container {
    /* No dark mode styling */
}

.banner-responsive-container:hover {
    /* No hover effects */
}

.dark .banner-responsive-container:hover {
    /* No dark mode hover effects */
}

/* Sticky Navigation Fix */
.main-navigation {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.main-navigation.scrolled {
    background: rgba(37, 99, 235, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Banner Image Improvements - Simple clean design */
.banner-responsive-container .banner-image {
    max-height: 80px;
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Header banner images - smaller and more compact */
.hidden.md\\:block .banner-responsive-container .banner-image {
    max-height: 50px;
    object-fit: contain;
}

/* Banner Close Button - Simple design */
.banner-responsive-container .banner-close-btn {
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

.banner-responsive-container .banner-close-btn:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

/* Mobile-Banner-Wrapper Full Width Implementation */
@media (max-width: 768px) {
    /* Force container overflow for full width banner */
    .main-content {
        overflow-x: visible !important;
    }
    
    .mobile-banner-wrapper {
        width: 100vw !important;
        max-width: none !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        padding: 0 !important;
        position: relative;
        overflow: hidden;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }
    
    .mobile-banner-wrapper .banner-responsive-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        position: relative;
        box-sizing: border-box;
    }
    
    .mobile-banner-wrapper .banner-image {
        width: 100% !important;
        height: auto !important;
        max-height: 80px !important;
        object-fit: cover !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        box-sizing: border-box;
    }
    
    /* Ensure parent containers don't restrict width */
    .mobile-banner-wrapper * {
        box-sizing: border-box;
    }
}

/* Mobile Viewport Fixes - Updated for mobile-banner-wrapper */
@media (max-width: 768px) {
    .banner-section {
        padding: 0;
        min-height: auto;
    }
    
    /* Fix mobile overflow issues */
    body {
        overflow-x: hidden !important;
    }
    
    .container {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Mobile table fixes */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 2rem);
    }
    
    /* Mobile navigation fixes */
    .main-navigation {
        position: sticky !important;
        top: 0 !important;
    }
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    .banner-responsive-container {
        max-width: 100%;
        border-radius: 0.75rem;
    }
    
    .banner-responsive-container .banner-image {
        max-height: 120px;
        border-radius: 0.75rem;
    }
}

/* Stable banner container - no animation to prevent flicker */
.banner-responsive-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease;
}

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

/* Ensure banner doesn't break layout */
.banner-responsive-container * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.banner-responsive-container img {
    height: auto !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Desktop banner sizing - full 728x90 */
.desktop-banner-size .banner-responsive-container {
    width: 728px !important;
    max-width: 728px !important;
    height: 90px !important;
    max-height: 90px !important;
}

.desktop-banner-size .banner-responsive-container img {
    width: 728px !important;
    height: 90px !important;
    max-width: 728px !important;
    max-height: 90px !important;
    object-fit: cover !important;
}

/* Mobile banner sizing - responsive */
.mobile-banner-size .banner-responsive-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mobile-banner-size .banner-responsive-container img {
    width: 100% !important;
    height: auto !important;
    max-height: 60px !important;
    min-height: 50px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Mobile banner full width wrapper */
@media (max-width: 768px) {
    .mobile-banner-wrapper {
        width: 100vw !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        padding: 0 !important;
    }

    .mobile-banner-wrapper .banner-responsive-container {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    .mobile-banner-wrapper .banner-responsive-container img {
        width: 100% !important;
        height: auto !important;
        max-height: 60px !important;
        min-height: 50px !important;
        object-fit: cover !important;
        display: block !important;
        border-radius: 0 !important;
    }

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

    .mobile-banner-wrapper .banner-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}

/* Remove any container constraints on desktop */
@media (min-width: 768px) {
    .desktop-banner-size {
        flex: none !important;
        width: 728px !important;
        max-width: 728px !important;
    }
}

/* Remove conflicting banner styles from old system only */
.desktop-banner-container,
.mobile-banner-container,
.banner-mobile-container {
    display: none !important;
}

/* Exception: Show our unified banner containers */
.banner-responsive-container {
    display: block !important;
}

.banner-responsive-container .banner-container {
    display: block !important;
}

/* Sidebar banner consistency */
.sidebar .banner-container {
    display: block !important;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Layout consistency improvements */
.main-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Fix any layout shifts */
.content-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Navigation sticky enhancement */
@supports (position: sticky) {
    .main-navigation {
        position: sticky;
        top: 0;
    }
}