/* BASE LAYOUT FIXES: Crucial for proper scrolling and visibility */
html,
body {
    height: 100%;
    /* Ensure html and body take full viewport height */
    margin: 0;
    /* Remove default margin */
    padding: 0;
    /* Remove default padding */
}

body {
    display: flex;
    /* Use flexbox for body to arrange content vertically */
    flex-direction: column;
    /* Stack children vertically */
    background-color: #1a1a1a;
    color: #ffffff;
    /* No overflow: hidden on body. Let individual content areas handle overflow. */
}

/* Wrapper for main content and desktop sidebars - crucial for vertical space distribution */
#content-area-wrapper {
    display: flex;
    /* Flex container for horizontal arrangement of main/sidebars */
    flex-grow: 1;
    /* Allows this wrapper to take all available vertical space */
    overflow: hidden;
    /* Prevents children from overflowing this wrapper */
    position: relative;
    /* Needed for z-index context if overlays are inside */
    /* Default margins/paddings for desktop */
    margin-top: 4rem;
    /* To clear the h-16 fixed top header */
    padding-bottom: 0;
    /* No fixed bottom element on desktop */
}

/* Mobile specific margins/paddings for content-area-wrapper */
@media (max-width: 767px) {

    /* Tailwinds 'md' breakpoint is 768px, so this applies to smaller screens */
    #content-area-wrapper {
        /* Mobile: Clear top header (4rem) + mobile search bar (4rem) */
        margin-top: calc(4rem + 4rem);
        /* 8rem = 128px */
        /* Mobile: Clear bottom navigation bar (4rem) */
        padding-bottom: 4rem;
        /* 4rem = 64px */
    }
}

/* Ensure scrollable content areas fill their parent's height */
.sidebar-menu,
#main-content,
aside.w-full.md\:w-80 {
    height: 100%;
    overflow-y: auto;
}


/* General styles */
.odds-button.selected {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
}

.game-card:hover {
    background-color: #2d2d2d;
}

.leagues-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.leagues-list.open {
    max-height: 500px;
}

.league-link.active,
.league-link.active:hover {
    background-color: #ffc107;
    color: #000;
}

.filter-btn.active {
    background-color: #ffc107;
    color: #000;
    font-weight: bold;
}

.live-indicator {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.game-card {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.game-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

#featured-games-slider::-webkit-scrollbar {
    display: none;
}

#featured-games-slider {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tab-btn {
    color: #9ca3af;
    border-color: transparent;
}

.tab-btn.active {
    border-color: #ffc107;
    color: #ffc107;
}

.slide-up {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.slide-up.show {
    transform: translateY(0);
}

/* Styles for dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 60;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    transform-origin: top right;
    animation: fadeInScale 0.2s ease-out forwards;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #e0e0e0;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background-color: #333;
    color: #ffc107;
}

.dropdown-menu i {
    margin-right: 0.75rem;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Skeleton loader styles */
.loading-skeleton {
    animation: pulse-skeleton 1.5s infinite ease-in-out;
}

.loading-skeleton div {
    background-color: #333;
    border-radius: 4px;
}

@keyframes pulse-skeleton {
    0% {
        background-color: #2a2a2a;
    }

    50% {
        background-color: #3a3a3a;
    }

    100% {
        background-color: #2a2a2a;
    }
}

/* Toast Notification Styling */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 250px;
    max-width: 350px;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInOut 4s forwards;
    /* Fade in, stay, fade out */
}

.toast.success {
    background-color: #4CAF50;
    /* Green */
}

.toast.error {
    background-color: #F44336;
    /* Red */
}

.toast.warning {
    background-color: #FFC107;
    /* Orange */
    color: #333;
    /* Dark text for warning */
}

.toast i {
    margin-right: 0.5rem;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    90% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}