/* ==============================================
   SOIKEOPRO - MAIN STYLESHEET
   Optimized for performance and maintainability
   ============================================== */

/* ==============================================
   CRITICAL: MOBILE VIEWPORT CONSTRAINTS
   Must be at the top to override everything
   ============================================== */

/* CRITICAL: Force viewport constraints on ALL elements */
html {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    /* Always show vertical scrollbar to prevent horizontal shift */
    overflow-y: scroll;
}

body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative;
}

/* Force ALL elements to respect viewport on mobile */
@media (max-width: 768px) {
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    /* Critical: Override any min-width that could cause overflow */
    *[style*="min-width"] {
        min-width: auto !important;
    }
    
    /* Force containers to respect viewport */
    .container, .mx-auto, div, section, main, header, nav, footer {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

/* ==============================================
   FIX: Prevent horizontal layout shift
   ============================================== */

/* Always show vertical scrollbar to prevent horizontal shift */
html {
    overflow-y: scroll;
}

/* CRITICAL FIX: Hide horizontal scrollbar from overflow-x containers
   This prevents the "flash" of scrollbar during page load that causes horizontal shift */
.overflow-x-auto {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.overflow-x-auto::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Also apply to common scrollable containers */
.tab-container,
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-container::-webkit-scrollbar,
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- CORE VARIABLES --- */
:root {
    --brand-color: #34d399;
    --brand-hover: #10b981;
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --transition-speed: 0.2s;
}

/* --- BRAND UTILITIES --- */
.text-brand { color: var(--brand-color); }
.border-brand { border-color: var(--brand-color); }
.bg-brand { background-color: var(--brand-color); }
.hover-bg-brand:hover { background-color: var(--brand-hover); }

/* --- SMOOTH SCROLLING --- */
/* ❌ DISABLED: Causes shake on navigation click */
/* html {
    scroll-behavior: smooth;
} */

/* ✅ Only enable for scroll-to-top button and specific use cases */
html.enable-smooth-scroll {
    scroll-behavior: smooth;
}

/* --- BODY TRANSITIONS --- */
body {
    transition: opacity 0.15s ease-in-out;
}

/* --- NPROGRESS CUSTOMIZATION --- */
#nprogress .bar {
    background: var(--brand-color) !important;
    height: 3px !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px var(--brand-color), 0 0 5px var(--brand-color) !important;
}

#nprogress .spinner-icon {
    border-top-color: var(--brand-color) !important;
    border-left-color: var(--brand-color) !important;
}

/* --- TABLE UTILITIES --- */
.table-fixed {
    table-layout: fixed;
}

/* --- TAB FILTERS FIX --- */
.tab-button {
    /* ❌ REMOVED: transition: all 0.2s ease; - causes transform animations */
    /* ✅ Only transition specific properties */
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.tab-button:not(.active) {
    background-color: transparent !important;
    color: #64748b !important; /* slate-500 */
}

.tab-button:not(.active):hover {
    background-color: rgba(148, 163, 184, 0.1) !important;
}

.tab-button.active {
    background-color: var(--brand-color) !important;
    color: #0f172a !important; /* slate-900 */
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .tab-button:not(.active) {
        color: #cbd5e1 !important; /* slate-300 */
    }

    .tab-button.active {
        color: #0f172a !important;
    }
}

/* --- ACTIVE STATES --- */
.tab-button.active,
.standings-view-button.active {
    background-color: var(--brand-color);
    color: #1e293b;
}

.tab-button,
.standings-view-button,
.time-tab-button,
.league-tab-button {
    transition: all var(--transition-speed) ease-in-out;
}

.time-tab-button.active,
.league-tab-button.active {
    border-color: var(--brand-color);
    color: var(--brand-color);
    font-weight: 600;
}

/* --- CUSTOM SCROLLBAR --- */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgb(203 213 225) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgb(203 213 225);
    border-radius: 20px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgb(148 163 184);
}

/* Dark mode scrollbar */
@media (prefers-color-scheme: dark) {
    .scrollbar-thin {
        scrollbar-color: rgb(71 85 105) transparent;
    }
    
    .scrollbar-thin::-webkit-scrollbar-thumb {
        background-color: rgb(71 85 105);
    }
    
    .scrollbar-thin::-webkit-scrollbar-thumb:hover {
        background-color: rgb(100 116 139);
    }
}

/* Hide scrollbar completely */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* --- HTMX LOADING STATES --- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: flex;
}

.htmx-request.htmx-swapping {
    opacity: 0;
    transition: opacity 200ms ease-out;
}

/* --- SMOOTH TRANSITIONS --- */
.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- STICKY TABLE HEADER --- */
.sticky {
    position: sticky;
}

@supports (position: sticky) {
    .sticky {
        position: sticky;
    }
}

/* --- SCORE SELECTION --- */
.score-option {
    transition: all var(--transition-speed) ease-in-out;
    cursor: pointer;
}

.score-option:hover {
    /* ❌ REMOVED: transform: translateY(-2px); - causes jank */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.score-option.selected {
    background-color: var(--brand-color) !important;
    color: #1f2937 !important;
    font-weight: 700;
    /* ❌ REMOVED: transform: scale(1.05); - causes jank */
    box-shadow: 0 0 0 2px var(--brand-hover);
}

/* --- FAVORITE STAR --- */
.favorite-star {
    transition: all var(--transition-speed) ease-in-out;
}

.favorite-star:hover {
    transform: scale(1.2);
}

.favorite-star.favorited {
    fill: #facc15;
    color: #facc15;
    animation: starPulse 0.3s ease-in-out;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* --- MODAL ANIMATIONS --- */
#prediction-modal {
    animation: fadeIn 0.2s ease-in-out;
}

#modal-content {
    animation: slideUp 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* --- CONTENT FADE IN --- */
.fade-in {
    animation: contentFadeIn 0.5s ease-in;
}

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

/* --- ALERT STYLES --- */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border-width: 1px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.alert-error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

/* --- FOCUS STATES --- */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

/* ============================================
   HTMX BOOST - SMOOTH PAGE TRANSITIONS
   ============================================ */

/* Keep navigation stable during transitions */
nav[class*="sticky"] {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth page transition */
body.htmx-swapping {
    opacity: 0.9;
    transition: opacity 0.1s ease-in-out;
}

/* Loading indicator */
#page-loading-indicator {
    display: none;
}

#page-loading-indicator.htmx-request {
    display: block;
    animation: pageLoadFadeIn 0.2s ease-in;
}

@keyframes pageLoadFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Prevent layout shift */
html {
    scroll-padding-top: 64px;
}

/* NProgress positioning */
#nprogress .bar {
    position: fixed !important;
    z-index: 99999 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

/* HTMX indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}
/* ==============================================
   FAVORITE STAR ANIMATION
   ============================================== */
.favorite-star {
    transition: fill 0.2s ease-in-out, color 0.2s ease-in-out;
}

.favorite-star.favorited {
    fill: #facc15;
    color: #facc15;
    /* ❌ REMOVED: transform: scale(1.1); - causes jank */
}

.favorite-star:hover {
    /* ❌ REMOVED: transform: scale(1.2); - causes jank */
    opacity: 0.8;
}

/* ==============================================
   TAB BUTTONS
   ============================================== */
.tab-button {
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.tab-button.active {
    background-color: #34d399;
    color: #1f2937;
}

.tab-button:hover:not(.active) {
    background-color: rgba(52, 211, 153, 0.1);
}

/* ==============================================
   STANDINGS VIEW BUTTONS
   ============================================== */
.standings-view-button {
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.standings-view-button.active {
    background-color: #34d399;
    color: #1f2937;
}

/* ==============================================
   MATCH ROW TRANSITIONS
   ============================================== */
.match-row {
    transition: background-color 0.15s ease-in-out;
}

/* ==============================================
   EXPAND/COLLAPSE BUTTON ANIMATIONS
   ============================================== */
#expand-matches-btn,
#collapse-matches-btn {
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#expand-matches-btn:hover,
#collapse-matches-btn:hover {
    /* ❌ REMOVED: transform: translateY(-2px); - causes jank */
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3);
}

/* ==============================================
   PULSE ANIMATION FOR LIVE MATCHES
   ============================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==============================================
   LOADING STATE
   ============================================== */
.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-indicator {
    display: none;
}

/* ==============================================
   RESPONSIVE IMPROVEMENTS
   ============================================== */
@media (max-width: 768px) {
    .match-row td {
        padding: 0.5rem 0.25rem;
    }
    
    .tab-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}
/* League Filter Buttons */
.league-filter-btn {
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.league-filter-btn:hover {
    /* ❌ REMOVED: transform: translateY(-1px); - causes jank */
    opacity: 0.9;
}

/* Prevent HTMX from showing page reload */
.htmx-swapping {
    opacity: 0;
    transition: opacity 200ms ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 200ms ease-in;
}
/* ==============================================
   VIEW MODE TOGGLE BUTTONS
   ============================================== */
.view-mode-btn {
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.view-mode-btn:hover {
    /* ❌ REMOVED: transform: translateY(-1px); - causes jank */
    opacity: 0.9;
}

.view-mode-btn.active {
    background-color: #34d399 !important;
    color: #1f2937 !important;
}

/* ==============================================
   LEAGUE TAB BUTTONS
   ============================================== */
.league-tab-btn {
    transition: border-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.league-tab-btn.active {
    border-color: #34d399 !important;
    color: #34d399 !important;
}

/* ==============================================
   FAVORITE STAR (Duplicate - Already defined above)
   ============================================== */
/* REMOVED DUPLICATE CODE */

/* ==============================================
   TAB BUTTONS (Duplicate - Already defined above)
   ============================================== */
/* REMOVED DUPLICATE CODE */

/* ==============================================
   HTMX TRANSITIONS
   ============================================== */
.htmx-swapping {
    opacity: 0.5;
    transition: opacity 100ms ease-out;
}

.htmx-settling {
    opacity: 1;
    transition: opacity 100ms ease-in;
}

/* ==============================================
   MATCH ROW HOVER
   ============================================== */
.match-row {
    transition: background-color 0.15s ease-in-out;
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 768px) {
    .view-mode-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .league-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}
/* ==============================================
   GOAL NOTIFICATION ANIMATION
   ============================================== */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ==============================================
   PULSE ANIMATION cho live matches
   ============================================== */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ==============================================
   ⚽ GOAL FLASH ANIMATION - Hiệu ứng bàn thắng
   ============================================== */

/* Flash ô tỷ số */
.goal-flash {
    animation: goalFlash 0.5s ease-in-out 6;
    /* 6 lần flash = 3 giây */
}

@keyframes goalFlash {
    0%, 100% {
        background-color: transparent;
        transform: scale(1);
    }
    50% {
        background-color: #fbbf24; /* Vàng óng */
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.8);
    }
}

/* Highlight cả hàng */
.goal-highlight {
    background-color: rgba(251, 191, 36, 0.1) !important;
    animation: rowGlow 3s ease-out;
}

@keyframes rowGlow {
    0% {
        box-shadow: 0 0 0 rgba(251, 191, 36, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    }
    100% {
        box-shadow: 0 0 0 rgba(251, 191, 36, 0);
    }
}

/* Bóng đá bay */
.goal-ball {
    position: absolute;
    top: -10px;
    left: 50%;
    font-size: 24px;
    animation: ballFly 2s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

@keyframes ballFly {
    0% {
        transform: translate(-50%, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100px) rotate(720deg);
        opacity: 0;
    }
}

/* --- TOOLTIP FOR "ĐÃ ĐOÁN" BUTTON --- */
.group:hover .tooltip {
    opacity: 1 !important;
    visibility: visible !important;
}

/* --- SIDEBAR BANNERS OPTIMIZATION --- */
/* Ensure sidebar banners don't overflow viewport */
aside .sticky {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
    position: sticky !important;
    top: 0.5rem !important;
    z-index: 40;
}

/* Compact banner spacing for sidebar - 120x230px */
aside .sticky img {
    display: block;
    width: 120px;
    height: 230px;
    object-fit: cover;
    object-position: center;
}

/* Tighter spacing between sidebar banners */
aside .sticky a + a {
    margin-top: 6px; /* space-y-1.5 = 6px */
}

/* Event Banner Slider - Full width responsive */
.banner-item {
    transition: opacity 0.2s ease;
}

.banner-item:hover {
    opacity: 0.95;
}

/* Event slider banners - responsive */
.banner-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- BLOG/NEWS CONTENT TYPOGRAPHY --- */
/* Enhanced typography for blog posts and news articles */
.post-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.post-content h1 { font-size: 2.25rem; }
.post-content h2 { font-size: 1.875rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }

.post-content p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.post-content a {
    color: var(--brand-color);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.post-content a:hover {
    opacity: 0.8;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--brand-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

.post-content code {
    background-color: var(--color-bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
}

.post-content pre {
    background-color: var(--color-bg-secondary);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    border: 1px solid var(--color-border-primary);
    text-align: left;
}

.post-content th {
    background-color: var(--color-bg-secondary);
    font-weight: 600;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hover effects for cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ==============================================
   MOBILE UI FIXES - Week 2024-11  
   TARGETED: Fix specific overflow sources without breaking layout
   ============================================== */

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    /* Core viewport constraints */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }
    
    /* CRITICAL: Fix odds tables that cause horizontal overflow */
    .odds-table-container {
        max-width: calc(100vw - 16px) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .odds-table-container .odds-table-header,
    .odds-table-container .odds-table-row {
        min-width: auto !important;
        max-width: 100% !important;
        grid-template-columns: 40px 110px repeat(3, 1fr) !important;
    }
    
    /* Fix tab containers with horizontal scroll */
    .tab-container {
        max-width: calc(100vw - 32px) !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    
    .tab-container::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Container width constraints - not all elements */
    .container, .mx-auto {
        max-width: calc(100vw - 16px) !important;
        box-sizing: border-box !important;
    }
    
    /* CRITICAL: Mobile banner container constraints */
    .banner-mobile-container {
        max-width: calc(100vw - 32px) !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .banner-mobile-container img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    /* Fix banner width on mobile - legacy support */
    .banner-container {
        max-width: calc(100vw - 32px) !important;
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .banner-container img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    /* Fix table overflow */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: calc(100vw - 16px) !important;
    }
    
    /* Prevent text from causing horizontal scroll */
    .match-card .team-name {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    /* CRITICAL: Fix grid layouts on mobile that cause overflow */
    .grid-cols-5, .grid-cols-3, .grid-cols-4, .grid {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .grid-cols-5 > *, .grid-cols-3 > *, .grid-cols-4 > *, .grid > * {
        min-width: 0 !important;
        word-wrap: break-word;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    /* Force any flex containers to respect viewport */
    .flex {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Fix main container */
    .mx-auto {
        max-width: calc(100vw - 32px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* CRITICAL: Fix header and nav that can overflow */
    header, nav {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Fix any element with explicit width */
    [style*="width:"] {
        max-width: 100% !important;
    }
}

/* Desktop banner tightening */
@media (min-width: 1024px) {
    /* Make desktop banner more compact */
    .desktop-banner-container {
        margin-left: auto;
        display: flex;
        align-items: center;
        max-width: 468px;
        overflow: hidden;
    }
    
    .desktop-banner-container .banner-container {
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        max-width: 100%;
    }
    
    .desktop-banner-container img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
    }
    
    /* Ensure mobile banner is hidden on desktop */
    .lg\\:hidden {
        display: none !important;
    }
}

/* Mobile banner and logo improvements */
@media (max-width: 1023px) {
    /* Ensure desktop banner is hidden on mobile */
    .hidden.lg\\:block {
        display: none !important;
    }
    
    /* Mobile banner styling - prevent overflow */
    .mobile-banner-section {
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-top: 1px solid #e2e8f0;
        padding: 12px 16px;
        width: 100%;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .dark .mobile-banner-section {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .banner-mobile-container {
        max-width: calc(100vw - 32px) !important;
        width: 100% !important;
        overflow: hidden !important;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        background: white;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .dark .banner-mobile-container {
        background: var(--color-bg-secondary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* Mobile banner images - force proper sizing */
    .banner-mobile-container img,
    .banner-mobile-container a,
    .banner-mobile-container .banner-item {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        border-radius: 6px;
    }
    
    /* Mobile logo in nav improvements */
    .mobile-nav-logo {
        padding: 8px 0;
    }
    
    .mobile-nav-logo img {
        filter: brightness(1.1);
        transition: transform 0.2s ease;
        max-width: 100%;
        height: auto;
    }
    
    .mobile-nav-logo:hover img {
        transform: scale(1.05);
    }
    
    /* Critical: Prevent any mobile banner overflow */
    .lg\\:hidden {
        max-width: 100vw !important;
        overflow: hidden !important;
    }
    
    .lg\\:hidden * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}


/* ==============================================
   FIX: Prevent layout shift from Lucide icons
   ============================================== */

/* Ensure lucide icons have minimum dimensions before createIcons() runs */
i[data-lucide] {
    display: inline-block;
    min-width: 1em;
    min-height: 1em;
    vertical-align: middle;
}

/* Prevent lucide icons from collapsing */
i[data-lucide]:empty {
    min-width: inherit;
    min-height: inherit;
}
