/*
Theme Name: G.CAVE
Author: 24GTV
Version: ULTIMATE
*/

body {
    margin: 0;
    background-image: url('assets/images/background.jpg');
    background-size: cover;
    font-family: sans-serif;
    /* Allow vertical scrolling for the entire page if content overflows */
    overflow-y: auto;
    /* Ensure body takes full height for proper centering of its direct flex children */
    min-height: 100vh;
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Stack its children vertically */
    align-items: center; /* Center children horizontally */
}

/* === MENU STYLES === */

/* Default Menu (Desktop) */
#top-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.menu-button {
    color: white;
    font-size: 24px;
    font-family: 'Impact', sans-serif;
    padding: 20px 0px;
    cursor: pointer;
    text-align: center;
}

.menu-links {
    display: none;
    padding: 10px;
    text-align: center;
    transform-origin: top center;
    transition: all 0.3s ease;
}

.menu-links a {
    color: white;
    text-decoration: none;
    font-size: 1em;
    font-family: 'Impact', sans-serif;
    padding: 0px 0px;
    display: inline-block;
    transition: font-size 0.3s ease;
}

/* Open Menu State */
#top-menu.menu-open {
    background-color: rgba(0, 0, 0, 0.9);
}

#top-menu.menu-open .menu-links {
    display: block;
    transform: scaleY(1);
}

#top-menu.menu-open .menu-links a {
    font-size: 1.2em;
}

/* --- Mobile Menu (Side-Slide) --- */
@media (max-width: 768px) {
    #top-menu {
        background-image: url('assets/images/background.jpg');
        background-size: cover;
        left: -100%; /* Initially hide menu off-screen to the left */
        top: 40px;
        width: 80%; /* Width of the side menu */
        height: 100vh; /* Full viewport height */
        background-color: rgba(0, 0, 0, 0.9);
        transition: left 0.3s ease-in-out;
        display: block;
    }

    #top-menu.menu-open {
        left: 0; /* Slide menu into view */
    }

    /* Restyle the menu button for mobile to be fixed at the top-left */
    .menu-button {
        position: fixed;
        left: -07%; /* Adjusted to be less negative for better visibility */
        top: 10px;
        z-index: 1001; /* Ensure button is on top of the menu */
        color: white;
        text-align: left;
        padding-left: 10px;
        display: block !important;
    }

    .menu-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .menu-links a {
        font-size: 2em;
        padding: 10px 0;
        width: 100%;
    }
}

/* === GENERAL LAYOUT STYLES === */
/* The .main-container was not used in index.php, so removed its styles here */

.header-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0px;
    gap: 0px;
    /* background-image: url('assets/images/live.gif'); - Removed as it was conflicting with actual images */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-wrap: wrap; /* Allow images inside to wrap */
}

#player {
    margin: 0 auto;
    width: 100%;
    max-width: none;
    border: 3px solid #D0071E;
    background: black;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

#playlist {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    gap: 10px;
    justify-content: flex-start;
    background-color: rgba(0,0,0,0.7);
    /* Ensure it takes full width and doesn't affect main content centering */
    width: 100%;
}

.playlist-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    transition: transform 0.2s ease;
}

.playlist-button:hover {
    transform: scale(1.05);
}

.playlist-button img {
    width: 200px;
    height: 120px;
    object-fit: cover;
    border: 3px solid red;
    border-radius: 8px;
}

/* Enhanced Menu Visibility Styles */
#top-menu {
    transition: opacity 0.5s ease-in-out, top 0.5s ease-in-out;
}

#top-menu.menu-retracted {
    opacity: 0;
    pointer-events: none;
    top: -100px;
}

#top-menu.menu-visible {
    opacity: 1;
    pointer-events: auto;
    top: 0;
}


/* BROWSE Grid Styles */
.browse-container {
    margin: 0px auto;
    padding: 2px;
    max-width: 100%;
    text-align: center;
    width: 100%; /* Ensure it takes full width for centering */
	height: auto;
}

.browse-title {
    font-size: 48px;
    color: #ffffff;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Adjusted for more flexibility */
    gap: 3px; /* Increased gap for better spacing */
    padding: 0px;
}

.channel-grid .playlist-button {
    background: #111;
    border: 2px solid #d86800;
    border-radius: 8px; /* Changed to match other elements */
    padding: 5px;
    transition: transform 0.3s;
    display: block; /* Ensure button takes full grid cell */
    width: 100%; /* Ensure button takes full grid cell */
}

.channel-grid .playlist-button img {
    width: 100%; /* Make image fill button */
    height: auto;
    border-radius: 5px; /* Match button border-radius */
}

.channel-grid .playlist-button:hover {
    transform: scale(1.05);
}

.pagination-controls {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.pagination-controls button {
    padding: 8px 16px;
    background-color: #000000;
    color: #fff;
    border: 2px solid red;
    cursor: pointer;
    font-weight: bold;
    border-radius: 6px;
}

.pagination-controls button:hover {
    background-color: solid red;
    color: #D0071E;
	border: 2px solid white;
}

/* New CSS for the browser grid */
/* These rules seem to be for the browse-grid-hls which is handled by JS. */
/* Keeping them for completeness, but ensure they are applied correctly via JS */
.browser-grid-container {
    padding: 20px;
    background-color: #f0f0f0;
}

.browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 5px;
}

.browser-grid-hls {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    cursor: pointer;
    background-color: black;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.browser-grid-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.browser-grid-hls:hover .browser-grid-img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transition: transform 0.3s;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.play-button::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #000000;
    margin-left: 5px;
}

.browser-grid-hls:hover .play-button {
    background-color: rgba(255, 255, 255, 0.9);
}

.hls-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* === Responsive Image Layout (Grid for Large Screens) === */
.container {
    width: 100%;
	height: 100%;
	background-image: url('assets/images/background.jpg');
    background-size: cover;
    background-color: #D0071E;
	border: 3px solid red;
    border-radius: 1rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 0rem;
    margin-top: 0rem; /* Add some space from elements above */
    margin-bottom: 0rem; /* Add some space from elements below */
}

.side-by-side-grid {
    display: flex;
    flex-wrap: nowrap; /* Allows wrapping for grid layout */
    justify-content: center;
    gap: 0.2rem; /* Space between images */
    position: relative; /* Needed for absolute positioning of slider controls */
	width: 100%;
    max-height: 70vh; /* or try 70vh, 60vh to shrink */
    overflow-y: auto; /* Hide overflow when acting as a slider */
}

.side-by-side-grid > a,
.side-by-side-grid > img {
    flex-basis: calc(1 - 1rem); /* 3 images per row */
    max-width: calc(1 - 1rem);
    box-sizing: ;
    text-decoration: none; /* Remove underline from links */
}

.side-by-side-grid img {
    width: 100%;
    height: auto;
    display: flex;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.side-by-side-grid img:hover {
    transform: scale(1); /* Slight zoom on hover */
}

.slider-item {
    flex-shrink: 0; /* Prevent items from shrinking */
    width: 100%; /* Each item takes full width of the viewable area */
    padding: 0 0.2rem; /* Small padding for spacing within slider */
    box-sizing: border-box;
}

/* === Media Query for Small Screens (Slider Mode) === */
@media (width: 100%) {
  .side-by-side-grid {
	width: 100%;
    display: flex;
	align-items: center;
    flex-direction: column; /* Stack vertically */
    gap: 1rem;
    overflow-y: auto; /* Enable vertical scroll */
    overflow-x: hidden;
    max-height: 70vh; /* Adjust based on your layout */
    padding: 0rem;
    scrollbar-width: thin; /* For Firefox */
  }

  .side-by-side-grid > a,
  .side-by-side-grid > img {
    flex-basis: auto;
    max-width: none;
    width: 100%;
    height: auto;
  }

  /* Show slider controls on small screens if needed */
  .slider-nav-button,
  .slider-dots {
    display: none; /* Hide if vertical scrolling replaces slider */
  }
}

  .side-by-side-grid::-webkit-scrollbar {
    width: 100%;
  }

  .side-by-side-grid::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 3px;
  }

/* Hide navigation arrows if present */
  .slider-nav-button,
  .slider-dots {
    display: none !important;
  }
}
/* --- Bottom Image Styling --- */
.site-bottom-image {
    width: 100%;
    margin-top: 0px; /* Space above the image */
    text-align: center; /* In case the image doesn't fill 100% and you want it centered */
}

.site-bottom-image .full-width-image {
    width: 100%;
    height: auto;
    display: block; /* Removes extra space below the image */
    margin: 0 auto; /* Center the image if max-width is applied */
}

.site-bottom-image-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.stacked-image {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
}
.iframe-container {
        position: relative;
        width: 100%;
        overflow: hidden;
        /* Calculate padding-top based on desired aspect ratio (height / width * 100%) */
        /* For 16:9 aspect ratio (e.g., YouTube videos): 9 / 16 = 0.5625, so 56.25% */
        padding-top: 56.25%; /* Adjust for other aspect ratios (e.g., 4:3 is 75%) */
    }

    .iframe-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    