/*
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: 36px;
    font-family: 'Impact', sans-serif;
    padding: 5px 5px;
    cursor: pointer;
    text-align: center;
    border: 1px solid #d86800;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100px;
    margin: 10px auto;
    transition: all 0.3s ease;
}

.menu-button:hover {
    background-color: rgba(216, 104, 0, 0.2);
    border-color: #ff8c00;
}

.menu-icon {
    font-size: 28px;
    line-height: 1;
}

.menu-text {
    font-size: 28px;
    font-weight: bold;
}

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

.menu-links a {
    color: white;
    text-decoration: none;
    font-size: 1.8em;
    font-family: 'Impact', sans-serif;
    padding: 0px 0px;
    display: block;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid transparent;
    margin: 5px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-links a:hover {
    background-color: rgba(216, 104, 0, 0.3);
    border-color: #d86800;
    transform: translateX(5px);
}

/* Open Menu State */
#top-menu.menu-open {
    background-color: rgba(0, 0, 0, 0.95);
    width: 100%;
    max-width: 250px;
}

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

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

/* --- Mobile Menu (Side-Slide) --- */
@media (max-width: 768px) {
    #top-menu {
        background-color: rgba(0, 0, 0, 0.95);
        left: -100%; /* Initially hide menu off-screen to the left */
        top: 0;
        width: 90%; /* Width of the side menu */
        max-width: 350px;
        height: 100vh; /* Full viewport height */
        transition: left 0.3s ease-in-out;
        display: block;
        padding: 0px;
    }

    #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: 10px;
        top: 10px;
        z-index: 1001; /* Ensure button is on top of the menu */
        margin: 0;
        max-width: 150px;
    }

    .menu-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 40px 0;
        margin-top: 20px;
    }

    .menu-links a {
        font-size: 1.8em;
        padding: 0px 0px;
        width: 90%;
        text-align: center;
    }
}

/* 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;
}

/* Menu Overlay */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

#menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Ensure menu appears above overlay */
#top-menu {
    z-index: 1000;
}

/* Desktop menu positioning */
@media (min-width: 769px) {
    #top-menu.menu-open {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        min-width: 350px;
        max-width: 500px;
        height: auto;
        border-radius: 10px;
        box-shadow: 0 10px 50px rgba(216, 104, 0, 0.5);
    }
}

/* === 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;
    width: 100%;
    box-sizing: border-box;
    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;
}

/* 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: wrap; /* was nowrap — with the fixed sizing below, this lets images actually wrap into a compact multi-row grid that scrolls vertically, matching max-height/overflow-y below */
    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 */
}

/* Small screens: shorter scrollable window so it doesn't take up so much
   of a phone's vertical space before you even get to the rest of the page. */
@media (max-width: 768px) {
    .side-by-side-grid {
        max-height: 40vh; /* try 30vh for even shorter, 50vh for a bit taller */
    }
}

.side-by-side-grid > a,
.side-by-side-grid > img {
    flex: 0 1 calc(33.333% - 0.2rem); /* 3 images per row */
    max-width: calc(33.333% - 0.2rem);
    box-sizing: border-box;
    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;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
}

.site-bottom-image-stack a {
    display: block;
    width: 100%;
}

.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%;
    }
/* ============================================================
   SC420 RADIO — COMPACT PLAYER EMBED
   Pulls tracks live from SC420Radio's own site. Uses the same red/black
   palette as the #player / .playlist-button rules above so it reads as
   the same "radio player" family, just in compact form.
============================================================ */
.gsp-dashboard-wrap {
    width: 100%;
    box-sizing: border-box;
    background-image: url('assets/images/SMKCHMBR420.jpg');
    background-repeat: repeat; /* tiles at its natural size — never stretched or cropped */
    border: 2px solid #B87333;
    padding: 8px 0;
}

.gcave-sc420-player {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 98%;
    max-width: 1024px;
    box-sizing: border-box;
    margin: 24px auto 8px;
    background-color: #000;
    border: 1.5px solid #B87333;
    border-radius: 18px;
    overflow: hidden; /* keeps the thumbnail's square corners clipped to the box's rounded corners */
    animation: gsp-glow 2.5s ease-in-out infinite;
}

@keyframes gsp-glow {
    0%, 100% {
        box-shadow: 0 0 12px 2px rgba(208, 7, 30, 0.5), 0 10px 30px rgba(0, 0, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 28px 8px rgba(208, 7, 30, 0.9), 0 10px 30px rgba(0, 0, 0, 0.6);
    }
}

.gsp-thumb {
    width: 40%;
    height: auto;
    flex: 0 0 auto;
    object-fit: contain; /* shows the whole cover uncropped at any screen size */
    background-color: #000;
    display: block;
}

.gsp-side-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0; /* lets title/artist ellipsis truncate instead of forcing the row to overflow */
    box-sizing: border-box;
    padding: clamp(8px, 3vw, 12px);
}

.gsp-info {
    color: #fff;
    text-align: center;
    width: 100%;
    min-width: 0;
}

.gsp-title {
    font-weight: bold;
    font-size: clamp(13px, 4vw, 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gsp-artist {
    font-size: clamp(11px, 3vw, 22px);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.gsp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(6px, 2.5vw, 18px);
    margin-top: clamp(6px, 2vw, 16px);
}

.gsp-btn {
    background-color: #000;
    color: #fff;
    border: 2px solid #B87333;
    border-radius: 50%;
    width: clamp(34px, 10vw, 60px);
    height: clamp(34px, 10vw, 60px);
    font-size: clamp(13px, 3vw, 22px);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.gsp-btn:hover {
    background-color: #8B4000;
}

.gsp-btn-play {
    width: clamp(40px, 12vw, 72px);
    height: clamp(40px, 12vw, 72px);
    font-size: clamp(15px, 3.5vw, 26px);
}

.gsp-buy-msg {
	background-color: #D0071E;
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 0;
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
	border: 2px solid #DAA520;
    opacity: 0.85;
}

.gsp-buy-btn {
    display: block;
    width: max-content;
    margin: 10px auto 0;
    padding: 10px 24px;
    background-color: #000;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    text-align: center;
    border: 3px solid #000;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.gsp-buy-btn:hover {
    background-color: #8B4000;
}
