/* =========================================================
   OnlyHits Radio – global styles
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #121212, #1e1e1e);
    color: #fff;
    position: relative;
    overflow-x: hidden;
    transition: background 1.5s ease;
    line-height: 1.6;
}

a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

#background-wrapper {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

#background-blur {
    position: absolute;
    top: -20px; left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    background-size: cover;
    background-position: center;
    filter: blur(30px);
    transform: scale(1.1);
    opacity: 0.4;
    transition: background-image 1s ease, opacity 1s ease;
}

#visualizer-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

canvas { display: block; width: 100%; height: 100%; }

/* =====  Top Navigation  ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(10, 10, 10, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}
.nav-brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-links {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    flex-wrap: wrap;
    margin-left: auto;
}
.nav-links a {
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e6e6e6;
    transition: background 0.25s ease, color 0.25s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* =====  Main layout  ===== */
.main-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* =====  Player  ===== */
.player-container {
    width: 100%;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
    z-index: 10;
    gap: 2rem;
}

.cover-container {
    width: 280px; height: 280px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cover-container:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7); }
.cover-image {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 1;
}
.cover-container:hover .cover-image { transform: scale(1.05); }

.content-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.station-label {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.4rem;
}
.station-label .live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff3b3b;
    margin-right: 0.5rem;
    animation: livePulse 1.6s infinite ease-in-out;
    vertical-align: middle;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.song-info { margin-bottom: 1.6rem; width: 100%; }
.song-title {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    line-height: 1.15;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    animation: textPulse 1.5s infinite alternate;
    transition: opacity 0.5s ease, transform 0.5s ease;
    word-break: break-word;
}
.song-artist {
    font-size: 1.4rem;
    color: #cccccc;
    opacity: 0.9;
    transition: opacity 0.5s ease, transform 0.5s ease;
    word-break: break-word;
}
@keyframes textPulse {
    from { text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); }
    to   { text-shadow: 0 2px 15px rgba(255, 255, 255, 0.3); }
}
.song-info.changing .song-title,
.song-info.changing .song-artist {
    opacity: 0;
    transform: translateY(10px);
}

.controls {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    flex-wrap: wrap;
}
.play-pause-btn {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f2f2f2, #e6e6e6);
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}
.play-pause-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.play-pause-btn:hover { transform: scale(1.1); }
.play-pause-btn:active::after { opacity: 0.6; transform: scale(0.9); }
.play-pause-btn i { font-size: 35px; color: #121212; transition: transform 0.3s ease; }

.volume-container { display: flex; align-items: center; gap: 1rem; }
.volume-icon { font-size: 24px; cursor: pointer; color: #cccccc; transition: color 0.3s ease, transform 0.3s ease; background: none; border: none; }
.volume-icon:hover { color: #fff; transform: scale(1.2); }
.volume-slider {
    -webkit-appearance: none; appearance: none;
    width: 150px; height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    transition: background 0.3s ease;
}
.volume-slider:hover { background: rgba(255, 255, 255, 0.3); }
.volume-slider::-webkit-slider-thumb,
.volume-slider::-moz-range-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}
.volume-slider::-webkit-slider-thumb:hover,
.volume-slider::-moz-range-thumb:hover { transform: scale(1.2); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.4); }

.track-history-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}
.track-history-btn::before {
    content: ''; position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.7s ease;
}
.track-history-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); }
.track-history-btn:hover::before { left: 100%; }

/* =====  Track history drawer  ===== */
.history-container {
    position: fixed;
    top: 0; right: -400px;
    width: 400px; height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1000;
    overflow-y: auto;
}
.history-container.active { right: 0; }
.history-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 2rem; padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.history-header h2 { font-size: 1.5rem; }
.close-history-btn {
    background: none; border: none; font-size: 1.5rem; color: #fff;
    cursor: pointer; transition: transform 0.3s ease;
}
.close-history-btn:hover { transform: rotate(90deg); }
.history-list { list-style: none; }
.history-item {
    padding: 1rem; margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}
.history-item:hover { transform: translateX(-5px); background: rgba(255, 255, 255, 0.1); border-left: 3px solid rgba(255, 255, 255, 0.3); }
.history-title { font-size: 1rem; font-weight: bold; margin-bottom: 0.3rem; }
.history-artist { font-size: 0.9rem; color: #cccccc; }
.history-time { font-size: 0.8rem; color: #999; margin-top: 0.5rem; }

.loading-indicator { display: none; justify-content: center; align-items: center; height: 40px; }
.loading-indicator span {
    width: 10px; height: 10px;
    margin: 0 5px;
    background: #fff; border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}
.loading-indicator span:nth-child(1) { animation-delay: 0s; }
.loading-indicator span:nth-child(2) { animation-delay: 0.2s; }
.loading-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
    0%, 100% { transform: scale(0.5); opacity: 0.5; }
    50%      { transform: scale(1);   opacity: 1;   }
}

.visual-toggle {
    position: fixed;
    bottom: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50px;
    color: #fff;
    padding: 10px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 100;
    display: flex; align-items: center; gap: 8px;
    transition: all 0.3s ease;
}
.visual-toggle:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-3px); }
.visual-toggle i { font-size: 16px; }

/* =====  Station switcher  ===== */
.station-switcher {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}
.station-button {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; align-items: center; gap: 0.5rem;
    min-width: 120px; justify-content: center;
    text-decoration: none;
    text-align: center;
}
.station-button:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.station-button.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}
.station-button i { font-size: 1rem; }

/* =====  Content section (SEO body)  ===== */
.content-section {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    padding: 2.4rem clamp(1.2rem, 4vw, 2.5rem);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}
.content-section h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 0.8rem;
    letter-spacing: -0.01em;
}
.content-section .intro {
    font-size: 1.15rem;
    color: #d8d8d8;
    margin-bottom: 2rem;
    max-width: 70ch;
}
.content-section h2 {
    font-size: 1.55rem;
    margin-top: 2.2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.content-section h3 {
    font-size: 1.2rem;
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
}
.content-section p { margin-bottom: 1rem; color: #d0d0d0; max-width: 75ch; }
.content-section ul, .content-section ol { padding-left: 1.3rem; margin-bottom: 1rem; color: #d0d0d0; max-width: 75ch; }
.content-section li { margin-bottom: 0.4rem; }
.content-section strong { color: #fff; }
.content-section a { color: #77e0ff; text-decoration: underline; text-underline-offset: 3px; }
.content-section a:hover { color: #fff; }

/* =====  Station grid on homepage  ===== */
.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    width: 100%;
    margin: 1.2rem 0 1rem;
}
.station-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
    position: relative;
    overflow: hidden;
}
.station-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 0% 0%, var(--accent, #fff) 0%, transparent 60%);
    opacity: 0.15;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.station-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.station-card:hover::before { opacity: 0.28; }
.station-card h3 { font-size: 1.15rem; font-weight: 700; }
.station-card .genre { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.65); }
.station-card .desc { font-size: 0.95rem; color: #c9c9c9; }
.station-card .card-play {
    align-self: flex-start;
    margin-top: auto;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #111;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.station-card .card-play i { color: inherit; }

/* =====  FAQ  ===== */
.faq-section details {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.7rem;
    transition: background 0.2s ease;
}
.faq-section details[open] { background: rgba(255, 255, 255, 0.08); }
.faq-section summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.02rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after {
    content: '+';
    font-size: 1.4rem;
    line-height: 1;
    color: rgba(255,255,255,0.6);
    transition: transform 0.2s ease;
}
.faq-section details[open] summary::after { content: '−'; }
.faq-section .answer { margin-top: 0.7rem; color: #c9c9c9; }

/* =====  Breadcrumbs  ===== */
.breadcrumbs {
    width: 100%;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.2rem;
}
.breadcrumbs li + li::before {
    content: '/';
    margin-right: 0.5rem;
    color: rgba(255,255,255,0.35);
}
.breadcrumbs a { color: rgba(255,255,255,0.85); text-decoration: none; }
.breadcrumbs a:hover { color: #fff; text-decoration: underline; }

/* =====  Footer  ===== */
.site-footer {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 2.5rem 1.25rem 2rem;
    color: #b8b8b8;
    font-size: 0.92rem;
    margin-top: auto;
}
.footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.footer-grid h4 { color: #fff; font-size: 0.95rem; margin-bottom: 0.9rem; text-transform: uppercase; letter-spacing: 0.12em; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid a { color: #b8b8b8; text-decoration: none; transition: color 0.2s ease; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
    max-width: 1280px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}

/* =====  Responsive  ===== */
@media (max-width: 992px) {
    .player-container { flex-direction: column; padding: 1.5rem; gap: 1.5rem; }
    .cover-container  { width: 250px; height: 250px; }
    .song-title       { font-size: 1.8rem; text-align: center; }
    .song-artist      { font-size: 1.25rem; text-align: center; }
    .song-info        { text-align: center; }
    .station-label    { text-align: center; }
    .controls         { justify-content: center; flex-wrap: wrap; gap: 1.5rem; }
}
@media (max-width: 768px) {
    .main-container   { padding: 1rem 0.9rem 2.5rem; gap: 1.5rem; }
    .player-container { padding: 1.25rem; margin: 0; }
    .cover-container  { width: 200px; height: 200px; }
    .song-title       { font-size: 1.5rem; }
    .song-artist      { font-size: 1.1rem; }
    .controls         { gap: 1rem; flex-wrap: wrap; }
    .history-container { width: 100%; right: -100%; }
    .play-pause-btn   { width: 70px; height: 70px; }
    .play-pause-btn i { font-size: 30px; }
    .station-switcher { padding: 0.8rem; gap: 0.6rem; }
    .station-button   { padding: 0.55rem 1rem; font-size: 0.8rem; min-width: 90px; }
    .content-section  { padding: 1.5rem 1.2rem; }
    .nav              { gap: 0.5rem; padding: 0.75rem 1rem; }
    .nav-links        { gap: 0.2rem; }
    .nav-links a      { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    #visualizer-container { display: none; }
}
