/*
Theme Name: MegaHit Radio
Theme URI: https://24music.live
Author: MegaHit
Description: A seamless AJAX WordPress theme for continuous audio playback.
Version: 1.0
Text Domain: megahit
*/

:root {
    --primary: #ffcc00;
    --black: #000000;
    --white: #ffffff;
    --text-dark: #111111;
    --bg-light: #f9f9f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
    background-color: var(--white); color: var(--text-dark); overflow-x: hidden; padding-top: 80px; 
    display: flex; flex-direction: column; min-height: 100vh;
}
.app-content { flex: 1; } 
a { text-decoration: none; color: inherit; }

/* -----------------------------------------
   WORDPRESS CORE CLASSES
   (Required for the Block Editor to work properly)
----------------------------------------- */
.alignnone { margin: 5px 20px 20px 0; }
.aligncenter, div.aligncenter { display: block; margin: 5px auto 5px auto; }
.alignright { float: right; margin: 5px 0 20px 20px; }
.alignleft { float: left; margin: 5px 20px 20px 0; }
a img.alignright { float: right; margin: 5px 0 20px 20px; }
a img.alignnone { margin: 5px 20px 20px 0; }
a img.alignleft { float: left; margin: 5px 20px 20px 0; }
a img.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { background: #fff; border: 1px solid #f0f0f0; max-width: 96%; padding: 5px 3px 10px; text-align: center; }
.wp-caption.alignnone { margin: 5px 20px 20px 0; }
.wp-caption.alignleft { margin: 5px 20px 20px 0; }
.wp-caption.alignright { margin: 5px 0 20px 20px; }
.wp-caption img { border: 0 none; height: auto; margin: 0; max-width: 98.5%; padding: 0; width: auto; }
.wp-caption p.wp-caption-text { font-size: 11px; line-height: 17px; margin: 0; padding: 0 4px 5px; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

/* -----------------------------------------
   PAGES & SWUP TRANSITIONS
----------------------------------------- */
/* The fake display:none logic is removed. Swup handles transitions now. */
.transition-fade {
    transition: 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}
html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(5px);
}

/* -----------------------------------------
   HEADER & NAVIGATION
----------------------------------------- */
header {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    background-color: var(--black); color: var(--white);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; z-index: 1000; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.logo { font-size: 32px; font-weight: 900; letter-spacing: -1px; text-transform: uppercase; }
.logo span { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 20px; }
.search-btn { background: #222; border: none; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; }

.live-player-pill {
    background-color: #111; border-radius: 40px; padding: 5px 5px 5px 20px;
    display: flex; align-items: center; gap: 15px; 
}
.live-player-pill .meta { display: flex; flex-direction: column; }
.live-player-pill .status { font-size: 10px; color: #ff3333; text-transform: uppercase; font-weight: 900; }
.live-player-pill .song { font-size: 14px; font-weight: 700; color: var(--white); }
.play-circle {
    background-color: var(--primary); color: var(--black); width: 40px; height: 40px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; transition: transform 0.2s;
}
.play-circle:hover { transform: scale(1.05); }

.hamburger { display: none; }

/* WordPress Menu Styling */
nav.main-nav ul { display: flex; gap: 20px; align-items: center; list-style: none; margin: 0; padding: 0; }
nav.main-nav ul li { list-style: none; }
nav.main-nav a { font-weight: 700; font-size: 14px; text-transform: uppercase; transition: color 0.2s; display: block; }
/* Target WP's active classes */
nav.main-nav a:hover, 
nav.main-nav li.current-menu-item > a, 
nav.main-nav li.current-page-ancestor > a { color: var(--primary); }

/* -----------------------------------------
   HERO SECTION
----------------------------------------- */
.hero { 
    position: relative; height: 600px; background-color: #000 center/cover; 
    display: flex; align-items: center; justify-content: center; 
    transition: background-image 0.8s ease-in-out;
}
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0.2) 50%, var(--white)); }
.hero-mobile-video { display: none; position: absolute; left: 5%; top: 100px; width: 280px; height: 500px; background: url('https://images.unsplash.com/photo-1516280440502-a2fc9979d20b?w=400&q=80') center/cover; border-radius: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.3); z-index: 10; }
.hero-content { position: relative; z-index: 5; text-align: center; color: var(--white); opacity: 0; transition: opacity 0.4s ease-in; }
.hero-content h1 { font-size: 85px; font-weight: 900; letter-spacing: -4px; line-height: 1; text-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: opacity 0.5s ease;}
.hero-content h2 { font-size: 32px; font-weight: 700; margin-bottom: 30px; text-shadow: 0 5px 15px rgba(0,0,0,0.5); transition: opacity 0.5s ease;}
.hero-play { background-color: var(--primary); color: var(--black); width: 80px; height: 80px; border-radius: 50%; border: none; font-size: 30px; cursor: pointer; box-shadow: 0 10px 20px rgba(255, 204, 0, 0.4); transition: transform 0.2s; }
.hero-play:hover { transform: scale(1.1); }

.is-ready { opacity: 1 !important; }

/* -----------------------------------------
   CONTAINERS & GRIDS
----------------------------------------- */
.container { max-width: 1300px; margin: 0 auto; padding: 20px 20px 60px 20px; position: relative; z-index: 10; }
.section-title { font-size: 36px; font-weight: 900; text-transform: uppercase; letter-spacing: -1px; margin-bottom: 30px; color: var(--black); }

/* Full Schedule Grid */
#full-schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 30px; padding: 20px 0; overflow-x: visible; cursor: default;
}
#full-schedule-grid .card-yellow.grid-item { min-width: 0; width: 100%; cursor: pointer; }

/* Scrollers & Dragging Logic */
.scroller { 
    display: flex; gap: 20px; overflow-x: auto; padding-bottom: 20px; margin-bottom: 20px; cursor: grab; 
    user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;
    scrollbar-width: none; padding-top: 20px;
}
.scroller * { user-select: none; -webkit-user-select: none; } 
.scroller::-webkit-scrollbar { display: none; }
.scroller:active { cursor: grabbing; }

/* Recently Played */
.recently-played-grid { text-align: center; margin-top: -30px; padding-top: 30px; position: relative; z-index: 20; opacity: 0; transition: opacity 0.4s ease-in; }
.recently-played-grid h3 { font-size: 20px; font-weight: 900; text-transform: uppercase; margin-bottom: 20px; }
.track-card { min-width: 160px; text-align: center; pointer-events: auto; transition: transform 0.2s ease; cursor: default; }
.track-card:hover { transform: translateY(-5px); }
.track-img-wrapper { position: relative; margin-bottom: 15px; border-radius: 20px; overflow: hidden; box-shadow: 0 8px 15px rgba(0,0,0,0.1); transition: box-shadow 0.2s ease; }
.track-card:hover .track-img-wrapper { box-shadow: 0 12px 25px rgba(0,0,0,0.15); }
.track-img-wrapper img { width: 100%; display: block; border-radius: 20px; pointer-events: none; }
.track-time { position: absolute; top: 0; right: 0; background: rgba(0,0,0,0.8); color: var(--white); font-size: 12px; font-weight: 700; padding: 6px 12px; border-bottom-left-radius: 16px; backdrop-filter: blur(4px); }
.track-title { font-weight: 900; font-size: 16px; margin-bottom: 2px; }
.track-artist { font-size: 13px; color: #666; }

/* New Music Video Cards */
.video-card { min-width: 220px; background-color: var(--bg-light); border-radius: 20px; padding: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; cursor: pointer; }
.video-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.video-img-wrapper { position: relative; max-height: 200px; border-radius: 12px; overflow: hidden; aspect-ratio: 1/1; }
.video-img-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; scale: 1.35;}
.video-play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease; }
.video-play-overlay i { font-size: 40px; color: var(--primary); transform: scale(0.8); transition: transform 0.3s ease;}
.video-card:hover .video-play-overlay { opacity: 1; }
.video-card:hover .video-play-overlay i { transform: scale(1); }
.video-info { margin-top: 15px; text-align: center; }
.video-title { font-weight: 900; font-size: 16px; color: var(--black); margin-bottom: 2px; }
.video-artist { font-size: 14px; color: #666; font-weight: 600; }

/* Shows Scroller Card */
.card-yellow { min-width: 320px; background-color: var(--bg-light); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; cursor: grab; box-shadow: 0 5px 15px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; } 
.card-yellow:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.card-yellow-img { height: 200px; background-color: var(--white); margin: 10px; border-radius: 16px; background-size: cover; background-position: center; pointer-events: none; }
.card-yellow-content { padding: 10px 20px 20px 20px; border-radius: 4px; }
.card-yellow .card-title { color: var(--black); font-size: 22px; font-weight: 900; margin-bottom: 5px; }
.card-yellow .card-meta { color: var(--black); font-weight: 800; font-size: 12px; margin-bottom: 5px; display: inline-block; background: var(--primary); padding: 4px 8px; border-radius: 6px; text-transform: uppercase;}
.card-yellow .card-host { color: #666; font-size: 15px; font-weight: 600; }

/* -----------------------------------------
   VIDEO PLAYER OVERRIDES (Plyr)
----------------------------------------- */
.video-container { border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); max-width: 900px; overflow: hidden; background: #000; }
.plyr__control--overlaid { background: var(--primary) !important; color: black !important; }
.plyr--full-ui input[type=range] { color: var(--primary) !important }
.plyr--video .plyr__control:focus-visible, .plyr--video .plyr__control:hover, .plyr--video .plyr__control[aria-expanded=true] { background: var(--primary) !important; color: black !important; }

/* -----------------------------------------
   PLAYLIST FILTERS
----------------------------------------- */
.filters-bar { display: flex; gap: 12px; margin-bottom: 40px; background-color: var(--white); padding: 12px; border-radius: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.03); align-items: center; transition: all 0.3s ease; }
.filters-bar select { 
    padding: 14px 18px; border: 1px solid rgba(0,0,0,0.08); background-color: var(--bg-light); border-radius: 18px; 
    font-size: 15px; font-weight: 600; color: var(--text-dark); flex-grow: 1; outline: none; cursor: pointer; transition: all 0.2s ease;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 15px center; background-size: 14px; padding-right: 40px;
}
.filters-bar select:hover { background-color: var(--white); border-color: var(--primary); }
.filters-bar select:focus { background-color: var(--white); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.15); }

.action-btn { 
    background-color: var(--primary); color: var(--black); padding: 14px 28px; border: none; border-radius: 18px; 
    font-size: 14px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 8px 20px rgba(0,0,0,0.15); 
    display: flex; align-items: center; justify-content: center;
}
.action-btn:hover { background-color: var(--black); color: var(--primary); transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 25px rgba(255, 204, 0, 0.3); }

.playlist-results { display: flex; flex-direction: column; gap: 15px; }
.playlist-item { display: flex; align-items: center; border-radius: 16px; padding: 12px; gap: 20px; background: var(--bg-light); box-shadow: 0 4px 10px rgba(0,0,0,0.05); transition: transform 0.2s; }
.playlist-item:hover { transform: translateX(5px); }
.playlist-item img { width: 60px; height: 60px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.playlist-item .time { font-weight: 900; color: var(--black); background: var(--primary); padding: 6px 12px; border-radius: 10px; font-size: 14px;}

/* -----------------------------------------
   LIGHTBOX
----------------------------------------- */
.lightbox { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(0,0,0,0.95); z-index: 2000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.lightbox.hidden { display: none; }
.lightbox-content { position: relative; width: 90%; max-width: 900px; aspect-ratio: 16/9; }
#close-lightbox { position: absolute; top: -50px; right: 0; background: var(--primary); border: none; color: var(--black); width: 40px; height: 40px; font-size: 20px; border-radius: 50%; cursor: pointer; font-weight: bold; transition: transform 0.2s;}
#close-lightbox:hover { transform: scale(1.1); }
#yt-container iframe { width: 100%; height: 100%; min-height: 500px; border: none; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }

/* -----------------------------------------
   FOOTER
----------------------------------------- */
footer { background-color: var(--primary); padding: 80px 40px 40px; text-align: center; position: relative; margin-top: auto; } 
.footer-wave { position: absolute; top: -39px; left: 0; width: 100%; overflow: hidden; line-height: 0; }
.footer-wave svg { display: block; width: calc(100% + 1.3px); height: 40px; }
.footer-wave svg path { fill: var(--primary); }
.footer-logo { font-size: 40px; font-weight: 900; letter-spacing: -2px; color: var(--black); }
.footer-logo span { color: var(--white); text-shadow: 2px 2px 0 rgba(0,0,0,0.1); }

/* -----------------------------------------
   RESPONSIVE (Mobile & Tablet)
----------------------------------------- */
@media (max-width: 1024px) {
    .hamburger { display: flex; background: none; border: none; color: white; font-size: 26px; cursor: pointer; align-items: center; justify-content: center; }
    
    /* WordPress Mobile Menu Fixes */
    nav.main-nav { display: none; position: fixed; top: 80px; left: 0; width: 100%; background: var(--black); padding: 30px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; }
    nav.main-nav.mobile-open { display: block; }
    nav.main-nav ul { flex-direction: column; width: 100%; gap: 0;}
    nav.main-nav ul li { width: 100%; }
    nav.main-nav a { font-size: 20px; padding: 15px; border-bottom: 1px solid #333; width: 100%; text-align: center; }
}

@media (max-width: 768px) {
    header { padding: 0 15px; }
    .hero { height: 450px; }
    .hero-mobile-video { display: none; } 
    .hero-content { margin-left: 0; }
    .hero-content h1 { font-size: 60px; letter-spacing: -2px; }
    .live-player-pill .meta { display: none; }
    .live-player-pill { padding: 5px; gap: 0; }
    .section-title { font-size: 28px; }
    
    #full-schedule-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
    .filters-bar { padding: 10px; gap: 8px; border-radius: 18px; }
    .filters-bar select { font-size: 13px; padding: 12px 10px; padding-right: 25px; background-position: right 8px center; min-width: 0; }
    .action-btn { width: auto; padding: 12px 15px; font-size: 12px; }
}