/* Base Styles & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #4A235A; /* Dark Purple */
    --secondary-color: #7952B3; /* Lighter Purple */
    --accent-color: #4CAF50; /* Green (for odds) */
    --text-light: #FFFFFF;
    --bg-dark: #1E1E2F; /* Very Dark Background */
    --nav-bg: #2C2C40;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-width: 320px; /* Prevents overflow issues on tiny screens */
}

/* --- Header & Navigation (Navbar) --- */
.navbar {
    background-color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    flex-wrap: wrap; /* Allows top nav icons to wrap if needed */
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.2em; /* Slightly smaller for mobile */
    font-weight: bold;
}

.logo i {
    margin-right: 8px;
    color: var(--text-light);
}

.top-nav-icons {
    display: flex;
    gap: 10px; /* Use gap for spacing */
    order: 1; /* Keep it on the right */
}

.top-nav-icons a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9em;
    opacity: 0.8;
}

/* --- Main Content Layout (Mobile Default: Column Stack) --- */
.main-content-container {
    display: flex;
    flex-direction: column; 
    min-height: calc(100vh - 60px);
}

/* --- Main Navigation (Tabs) --- */
.main-nav {
    background-color: var(--nav-bg);
    display: flex;
    overflow-x: scroll; /* Crucial for small screens to fit all tabs */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    white-space: nowrap;
    padding: 0;
    border-bottom: 2px solid var(--primary-color);
}

.main-nav a {
    flex-shrink: 0; /* Prevents links from shrinking */
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 15px; /* Reduced padding */
    font-weight: bold;
    font-size: 0.8em; 
    display: flex;
    align-items: center;
    text-align: center;
}

.main-nav a i {
    margin-right: 5px;
}

.main-nav a.active {
    background-color: var(--primary-color);
}

/* --- Content Wrapper & Sidebar Layout --- */
.content-wrapper {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 20px;
    padding: 15px; /* Reduced padding for mobile */
    flex-grow: 1;
}

.tips-section {
    width: 100%;
    /* Order 1: Betting tips appear first on mobile */
    order: 1; 
}

.sidebar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* Order 2: Sidebar contents appear after tips on mobile */
    order: 2; 
}

/* --- Tips Section Cards --- */
.date {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.bet-card {
    /* ... (rest of the card styles remain similar) ... */
    background-color: var(--nav-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 5px solid var(--secondary-color);
}

.score-line {
    /* Ensures teams/scores are evenly spaced without wrapping */
    justify-content: space-between;
    font-size: 1em;
}

.tip-line {
    /* Ensures tip button and odds stay aligned */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows wrapping if the tip name is very long */
}

.tip-button {
    /* Allow button to take maximum space, but reserve room for odds */
    max-width: 65%;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em; /* Smaller font on button */
}

.odds {
    background-color: var(--accent-color);
    color: var(--text-light);
    padding: 8px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1em;
}

/* --- Sidebar Components (Images Adjusted for Mobile) --- */

.games-gallery img, .video-gallery img {
    /* Set explicit size for mobile gallery items */
    width: calc(33.33% - 7px); /* Three items per row, with gap accounted for */
    height: auto; 
    object-fit: cover;
    border-radius: 5px;
}

.video-gallery img {
    /* Example: making video thumbnails slightly wider */
    width: calc(33.33% - 7px); 
    min-height: 60px;
}

/* --- Live Scores Card --- */
.live-scores-card {
    min-height: 150px;
}

.live-scores-link small {
    font-size: 0.65em; /* Smaller URL text to prevent overflow */
}

/* --- Tablet & Desktop Layout (Over 768px) --- */
@media (min-width: 768px) {
    
    .navbar {
        padding: 10px 20px;
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 1.5em;
    }

    .top-nav-icons {
        order: 0; /* Reset order for desktop */
    }

    /* Reset Main Navigation */
    .main-nav {
        justify-content: center; /* Center tabs on wider screens */
        overflow-x: hidden;
    }

    .main-nav a {
        padding: 15px 20px;
        font-size: 0.9em;
    }

    /* Column Layout for Main Content */
    .content-wrapper {
        flex-direction: row;
        gap: 20px;
        padding: 20px;
    }

    .tips-section {
        flex: 3; /* Takes up more space on desktop */
        order: 1;
    }

    .sidebar {
        flex: 1.2; /* Takes up less space on desktop */
        order: 2;
    }

    .tip-button {
        max-width: none; /* Remove max-width restriction on desktop */
        font-size: 0.9em;
    }

    .games-gallery img, .video-gallery img {
        width: 60px; /* Return to original square/small size */
        height: 60px;
    }
    
    .video-gallery img {
        width: 100px;
        height: 60px;
    }

}
