:root {
    --font: "Montserrat", sans-serif;
    --text-color: #e5e5e5;
    --top-bar-height: 80px;

    --primary-color: #ff7300; /* Parafield Orange */
    --secondary-color: #33CCFF; /* Bright Blue */
    --accent-color: #FFCC00; /* Yellow */

    --background-color: #0d0d0d;
    --surface-color: #161616;
    --card-color: rgba(255, 255, 255, 0.03);
    --card-hover-color: rgba(255, 255, 255, 0.08);
    
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(255, 115, 0, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(51, 204, 255, 0.1) 0px, transparent 50%);
    color: var(--text-color);
    overflow-x: hidden;
    padding-bottom: 140px; /* Space for tall player */
}

* {
    font-family: var(--font), serif;
    box-sizing: border-box;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------------------- NAV ---------------------- */
nav.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--top-bar-height);
    background-color: transparent;
    color: white;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

nav.nav.scrolled {
    background-color: rgba(13, 13, 13, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    height: 70px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-left { display: flex; align-items: center; gap: 15px; }
.nav-logo { height: 32px; width: auto; filter: brightness(0) invert(1); transition: transform 0.3s ease; }
.nav-logo:hover { transform: scale(1.1); }
.nav-title { margin: 0; font-weight: 900; font-size: 1.4rem; letter-spacing: -0.5px; color: var(--primary-color); }

.nav-buttons { display: flex; gap: 10px; align-items: center; }
.nav-button {
    border: none;
    padding: 8px 20px;
    color: #aaa;
    font-size: 14px;
    font-weight: 600;
    background-color: transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.nav-button:hover, .nav-button.active { color: white; }
.nav-button.active { background: rgba(255, 255, 255, 0.05); }

.nav-toggle { display: none; background: transparent; border: none; cursor: pointer; padding: 10px; z-index: 1001; }
.hamburger { display: block; position: relative; width: 24px; height: 2px; background: white; transition: transform 0.3s ease; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: white; transition: all 0.3s ease; }
.hamburger::before { bottom: 8px; }
.hamburger::after { top: 8px; }
.nav-toggle.active .hamburger { transform: rotate(45deg); }
.nav-toggle.active .hamburger::before { transform: rotate(90deg) translate(-8px, 0px); bottom: 0; }
.nav-toggle.active .hamburger::after { transform: rotate(90deg) translate(8px, 0px); top: 0; }

/* ---------------------- HEADER (HERO) ---------------------- */
.header { padding: 120px 2rem 60px; text-align: center; min-height: 50vh; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
.header-content { max-width: 800px; z-index: 1; width: 100%; }
.header-title { font-size: 5rem; font-weight: 900; line-height: 1; margin-bottom: 1.5rem; letter-spacing: -2px; }
.header-subtitle { font-size: 1.2rem; color: #888; max-width: 600px; margin: 0 auto 3rem; line-height: 1.6; }

.search-bar { width: 100%; max-width: 650px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 25px; color: #666; display: flex; align-items: center; pointer-events: none; }
.search-bar input {
    width: 100%; padding: 22px 30px 22px 65px; border-radius: 40px; border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.03); color: white; font-size: 1.1rem; backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.search-bar input:focus { outline: none; background-color: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 15px 40px rgba(0,0,0,0.4); transform: translateY(-2px); }

.genre-chips { display: flex; justify-content: center; gap: 12px; margin-top: 2rem; flex-wrap: wrap; }
.genre-chip {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: #888;
    padding: 8px 18px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
}
.genre-chip:hover, .genre-chip.active { background: white; color: black; border-color: white; transform: translateY(-2px); }

/* ---------------------- CONTENT ---------------------- */
.content { padding: 0 4rem; max-width: 1600px; margin: 0 auto; position: relative; z-index: 1; }
.section { 
    margin-bottom: 5rem; 
    opacity: 1; 
    transform: none; 
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); 
}
.section.scroll-reveal-active { opacity: 1; transform: translateY(0); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; padding: 0 1rem; }
.section-title { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; }

.carousel-controls { display: flex; gap: 12px; }
.carousel-btn {
    background-color: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.05); color: white;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
}
.carousel-btn:hover { background-color: white; color: black; transform: scale(1.1); }

.carousel-container { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 2rem; overflow-x: auto; padding: 1rem; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel-container::-webkit-scrollbar { display: none; }
.results-grid { grid-auto-flow: row !important; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; overflow-x: visible !important; }
.results-subtitle { font-size: 1.2rem; font-weight: 700; color: #666; margin: 0 0 1.5rem 1rem; text-transform: uppercase; letter-spacing: 1px; }

.station-card {
    background-color: var(--card-color); border: 1px solid var(--glass-border); border-radius: 24px; padding: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); scroll-snap-align: start; cursor: pointer; position: relative; backdrop-filter: blur(10px);
}
.station-card:hover { background-color: var(--card-hover-color); border-color: rgba(255, 255, 255, 0.15); transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.station-card-image { width: 100%; aspect-ratio: 1/1; border-radius: 18px; background-color: #222; background-size: cover; background-position: center; position: relative; overflow: hidden; margin-bottom: 1rem; }

.play-button {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -40%) scale(0.8);
    width: 60px; height: 60px; background-color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: black; font-size: 1.2rem; opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.station-card:hover .play-button { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.favorite-btn {
    position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; cursor: pointer; transition: all 0.3s ease; z-index: 4;
}
.favorite-btn:hover { background-color: rgba(255, 255, 255, 0.1); transform: scale(1.1); }
.station-card.is-favorite .favorite-btn { background-color: var(--primary-color); border-color: var(--primary-color); color: white; }
.station-card.is-favorite .favorite-btn svg { fill: currentColor; }

.station-card-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 4px 0; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-card-subtitle { font-size: 0.9rem; color: #777; font-weight: 500; }

/* ---------------------- PLAYER BAR ---------------------- */
.player-bar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(150%);
    width: 95%; max-width: 1000px; height: 100px; background-color: rgba(20, 20, 20, 0.85); backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 50px; display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; padding: 0 2.5rem; z-index: 2000;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), height 0.4s ease; box-shadow: 0 25px 60px rgba(0,0,0,0.7);
}
.player-bar.active { transform: translateX(-50%) translateY(0); }
.player-bar.is-podcast { height: 130px; border-radius: 35px; }

.player-left { display: flex; align-items: center; gap: 1.2rem; overflow: hidden; }
.artwork-container { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
#player-artwork { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; border: 2px solid rgba(255,255,255,0.05); transition: all 0.5s ease; }
.player-bar.playing #player-artwork { transform: scale(1.05); border-color: var(--primary-color); }

.visualizer { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 2px; height: 12px; opacity: 0; transition: opacity 0.3s; background: rgba(0,0,0,0.5); padding: 2px 4px; border-radius: 4px; backdrop-filter: blur(4px); }
.player-bar.playing .visualizer { opacity: 1; }
.bar { width: 2px; height: 3px; background-color: var(--primary-color); border-radius: 1px; }
.player-bar.playing .bar { animation: bounce 0.6s infinite ease-in-out; }
.bar:nth-child(2) { animation-delay: 0.15s; }
.bar:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 100% { height: 3px; } 50% { height: 10px; } }

.player-info { display: flex; flex-direction: column; overflow: hidden; }
#player-station-name { font-weight: 700; color: white; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player-station-country { font-size: 0.8rem; color: #999; }

.player-center { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; width: 100%; }
.playback-controls-row { display: flex; align-items: center; justify-content: center; gap: 20px; }
.progress-container { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 500px; }
#player-progress-slider { flex-grow: 1; height: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; outline: none; -webkit-appearance: none; cursor: pointer; }
#player-progress-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: white; border-radius: 50%; }
#progress-current, #progress-duration { font-size: 0.7rem; color: #888; font-weight: 700; min-width: 40px; font-variant-numeric: tabular-nums; }

#player-play-pause-btn { background-color: white; border: none; color: #121212; cursor: pointer; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
#player-play-pause-btn:hover { transform: scale(1.1); background-color: var(--primary-color); color: white; }
.icon-wrapper { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }

.player-right { display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.volume-control { display: flex; align-items: center; gap: 10px; color: #888; }
#player-volume-slider { width: 100px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none; -webkit-appearance: none; cursor: pointer; }
#player-volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: white; border-radius: 50%; }

.player-control-small { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.05); color: #aaa; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.player-control-small:hover { color: white; background: rgba(255,255,255,0.15); }

/* ---------------------- SIDEBAR ---------------------- */
.now-playing-sidebar { position: fixed; top: 0; right: 0; width: 400px; height: 100vh; background-color: rgba(13, 13, 13, 0.9); backdrop-filter: blur(40px) saturate(150%); border-left: 1px solid rgba(255,255,255,0.05); z-index: 3000; transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-bg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; filter: blur(80px) brightness(0.2); opacity: 0.6; z-index: -1; }
.now-playing-sidebar.active { transform: translateX(0); }
.sidebar-header { padding: 1.5rem 2.5rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #666; }
.sidebar-content { padding: 1rem 2.5rem 2.5rem; overflow-y: auto; flex-grow: 1; }
.sidebar-image-container { width: 100%; aspect-ratio: 1/1; border-radius: 28px; overflow: hidden; margin-bottom: 2.5rem; box-shadow: 0 30px 60px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); }
#sidebar-artwork { width: 100%; height: 100%; object-fit: cover; }
#sidebar-station-name { font-size: 2.5rem; font-weight: 900; margin: 0 0 0.5rem 0; line-height: 1; letter-spacing: -1.5px; }
#sidebar-station-country { font-size: 1.2rem; color: var(--primary-color); font-weight: 600; margin-bottom: 2rem; }
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.tag { background-color: rgba(255,255,255,0.05); padding: 8px 16px; border-radius: 12px; font-size: 0.8rem; color: #999; border: 1px solid rgba(255,255,255,0.05); }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 2.5rem 0; }
.sidebar-extra h4 { color: #555; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 2px; margin-bottom: 1.2rem; }
#sidebar-description { color: #888; line-height: 1.7; font-size: 1rem; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: rgba(255, 255, 255, 0.03); border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; }
.history-item:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.1); transform: translateX(5px); }
.history-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.history-info { overflow: hidden; }
.history-name { font-size: 0.9rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-country { font-size: 0.75rem; color: #666; }
.icon-btn { background: none; border: none; color: #555; font-size: 1.8rem; cursor: pointer; }
.icon-btn:hover { color: white; }

/* ---------------------- TOAST ---------------------- */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; }
.toast { background-color: rgba(25, 25, 25, 0.9); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.1); color: white; padding: 16px 24px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 450px; transform: translateX(120%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.toast.active { transform: translateX(0); }
.toast-icon { width: 24px; height: 24px; flex-shrink: 0; }
.toast-error .toast-icon { color: #ff4444; }
.toast-success .toast-icon { color: #00C851; }
.toast-info .toast-icon { color: var(--primary-color); }
.toast-message { font-size: 0.95rem; font-weight: 500; }

/* ---------------------- MODAL ---------------------- */
.podcast-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 4000; display: none; align-items: center; justify-content: center; }
.podcast-modal.active { display: flex; }
.modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(20px); }
.modal-content { position: relative; width: 90%; max-width: 1000px; height: 85vh; background: #161616; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 32px; z-index: 1; overflow: hidden; display: flex; flex-direction: column; animation: modalPop 0.5s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 30px 100px rgba(0,0,0,0.8); }
@keyframes modalPop { 0% { opacity: 0; transform: scale(0.9) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
.close-modal-btn { position: absolute; top: 24px; right: 24px; width: 44px; height: 44px; background: rgba(255, 255, 255, 0.05); border: none; border-radius: 50%; color: white; font-size: 1.5rem; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.close-modal-btn:hover { background: rgba(255, 255, 255, 0.1); transform: rotate(90deg); }
.modal-header-info { padding: 3rem; display: flex; gap: 3rem; background: linear-gradient(180deg, rgba(255, 115, 0, 0.1), transparent); flex-shrink: 0; }
.modal-artwork-container { width: 220px; height: 220px; flex-shrink: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
#modal-podcast-artwork { width: 100%; height: 100%; object-fit: cover; }
.modal-text-info { display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
#modal-podcast-title { font-size: 2.5rem; font-weight: 900; margin: 0 0 0.5rem 0; line-height: 1.1; }
#modal-podcast-artist { font-size: 1.2rem; color: var(--primary-color); margin: 0 0 1.5rem 0; font-weight: 600; }
#modal-podcast-description { color: #888; line-height: 1.6; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.modal-episodes-section { flex-grow: 1; overflow-y: auto; padding: 0 3rem 3rem; }
.modal-episodes-section h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; position: sticky; top: 0; background: #161616; padding: 1rem 0; z-index: 2; }
.episode-item { display: flex; align-items: center; gap: 20px; padding: 1.2rem; background: rgba(255, 255, 255, 0.03); border-radius: 16px; cursor: pointer; transition: all 0.3s ease; border: 1px solid transparent; }
.episode-item:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.1); transform: translateX(10px); }
.ep-play-btn { width: 40px; height: 40px; background: white; color: black; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ep-info { overflow: hidden; }
.ep-title { font-weight: 700; color: white; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-meta { font-size: 0.85rem; color: #666; }

/* ---------------------- FOOTER ---------------------- */
.footer { padding: 4rem 4rem 160px; text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.05); color: #555; }
.social-links { margin-top: 1.5rem; display: flex; justify-content: center; gap: 2rem; }
.social-links a { color: #555; text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: color 0.3s; }
.social-links a:hover { color: white; }

/* ---------------------- RESPONSIVE ---------------------- */
@media (max-width: 1024px) {
    .header-title { font-size: 3.5rem; }
    .content { padding: 0 2rem; }
    nav.nav { padding: 0 2rem; }
}

@media (max-width: 768px) {
    body { padding-bottom: 180px; }
    nav.nav { padding: 0 1.5rem; }
    .nav-buttons {
        position: fixed; top: 0; right: 0; width: 75%; height: 100vh;
        background: #0d0d0d; flex-direction: column; align-items: flex-start;
        padding: 100px 2rem; transform: translateX(100%); transition: transform 0.4s ease;
        z-index: 999; border-left: 1px solid rgba(255,255,255,0.05);
    }
    .nav-buttons.active { transform: translateX(0); }
    .nav-button { width: 100%; font-size: 1.5rem; padding: 1rem 0; border-radius: 0; text-align: left; }
    .nav-toggle { display: block; }

    .header-title { font-size: 2.8rem; }
    .header-subtitle { font-size: 1rem; margin-bottom: 2rem; }
    .header { min-height: 40vh; padding-top: 100px; }
    .search-bar input { padding: 18px 25px 18px 55px; font-size: 1rem; }
    
    .carousel-container { grid-auto-columns: 220px; gap: 1rem; }
    .carousel-controls { display: none; }
    .section-title { font-size: 1.6rem; }

    .player-bar {
        width: 100%; bottom: 0; border-radius: 20px 20px 0 0;
        grid-template-columns: 1fr auto; padding: 1rem; height: auto; min-height: 80px;
    }
    .player-bar.is-podcast { min-height: 140px; padding-bottom: 1.5rem; }
    .player-left { gap: 0.8rem; }
    .artwork-container { width: 44px; height: 44px; }
    #player-station-name { font-size: 0.95rem; }
    .player-right { display: none; } /* Hide volume on mobile */
    
    .player-center { grid-row: 2; grid-column: 1 / span 2; margin-top: 10px; }
    .progress-container { max-width: 100%; }

    .now-playing-sidebar { width: 100%; z-index: 5000; }
    .modal-header-info { flex-direction: column; align-items: center; text-align: center; padding: 2rem; gap: 1.5rem; }
    .modal-artwork-container { width: 140px; height: 140px; }
    #modal-podcast-title { font-size: 1.6rem; }
    .modal-episodes-section { padding: 0 1rem 2rem; }
    .episode-item { padding: 1rem; gap: 15px; }
}
