/*
Theme Name: Immersound
Theme URI: https://immersound.net
Author: Immersound
Description: Custom minimal theme for Immersound radio
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Private
Text Domain: immersound
*/

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --black:      #000000;
    --deep:       #050a12;
    --blue-dark:  #0a1628;
    --blue-mid:   #37679a;
    --blue-light: #7DE5FA;
    --blue-pale:  #80addd;
    --white:      #ffffff;
    --text:       #c8d8e8;
    --text-dim:   #6a8aaa;
    --accent:     #7DE5FA;
    --font-main:  'Raleway', sans-serif;
    --transition: 0.3s ease;
}

html { height: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--black);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: 0.02em;
}

a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.7; }
img { max-width: 100%; display: block; }

/* ── Background ───────────────────────────────────────────────────────────── */
.site-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: url('assets/bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    pointer-events: none;
}
.site-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, var(--black) 100%);
}

/* ── Site wrapper ─────────────────────────────────────────────────────────── */
.site {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 36px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-mail {
    font-size: 20px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-shadow: 0 0 14px rgba(125,229,250,0.6);
}

.header-players {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-players a img {
    height: 28px;
    width: auto;
    opacity: 0.8;
    transition: opacity var(--transition);
    filter: brightness(1.6) saturate(0.9);
}
.header-players a:hover img { opacity: 1; }

.header-right { display: flex; align-items: center; }

.header-link {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: lowercase;
    color: var(--accent);
    text-shadow: 0 0 14px rgba(125,229,250,0.6);
}

/* ── Main content ─────────────────────────────────────────────────────────── */
.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 240px 24px 40px;
    min-height: 100vh;
    width: 100%;
}

/* ── Panels ───────────────────────────────────────────────────────────────── */
.panel {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: none;
    animation: fadeIn 0.4s ease;
}
.panel.active { display: block; }
#panel-radio.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Radio panel ──────────────────────────────────────────────────────────── */
#panel-radio {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
#panel-radio.active { display: flex; }

/* ── Site title ───────────────────────────────────────────────────────────── */
.radio-title {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.45em;
    text-transform: lowercase;
    color: var(--blue-light);
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 0 40px rgba(125, 229, 250, 0.3);
}

#panel-mixes .radio-title {
    font-size: 24px;
}

/* ── Topbar fixe : titre + nav ────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 22px 24px 30px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.topbar .radio-title {
    margin-top: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.nav-tab {
    padding: 12px 36px;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: lowercase;
    color: var(--text-dim);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-main);
    transition: color var(--transition);
    position: relative;
}
.nav-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}
.nav-tab.active,
.nav-tab:hover { color: var(--accent); }
.nav-tab.active::after { width: 24px; }

/* Mini now playing info — visible uniquement dans le panneau mixes */
.topbar-np {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    overflow: hidden;
    max-width: 460px;
}
.topbar-np-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--blue-light);
    flex-shrink: 0;
}
.topbar-np-title {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.topbar-np-sep { color: var(--text-dim); flex-shrink: 0; }
.topbar-np-artist {
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Affiche le mini np seulement quand mixes est actif */
body.panel-mixes-active .topbar-np { display: flex; }

/* ── StreamRadio player wrapper ───────────────────────────────────────────── */
.player-wrapper {
    width: 100%;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(125, 229, 250, 0.08);
    border-radius: 4px;
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.player-wrapper .rtplwrapperForIe {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
.player-wrapper .rtplmain_window {
    float: none !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    margin: 0 auto !important;
    display: block !important;
}
#sc-player,
#sc-player > * {
    width: 100% !important;
    max-width: 100% !important;
}

/* ── Now playing widget ───────────────────────────────────────────────────── */
.nowplaying-wrapper { width: 100%; }

#rnp-widget {
    border-radius: 4px;
    border: 1px solid rgba(125, 229, 250, 0.08) !important;
    background: rgba(5, 10, 18, 0.7) !important;
    backdrop-filter: blur(12px);
}

/* ── Mixes panel ──────────────────────────────────────────────────────────── */
#panel-mixes { max-width: 800px; }

.mixes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 0;
}
.mixes-list .wp-block-embed,
.mixes-list iframe,
.mixes-list > * {
    margin: 0;
    border-radius: 3px;
    overflow: hidden;
    opacity: 0.85;
    transition: opacity var(--transition);
}
.mixes-list .wp-block-embed:hover,
.mixes-list > *:hover { opacity: 1; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 20px;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    opacity: 0.4;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-header { padding: 14px 16px; }
    .header-players a img { height: 22px; }
    .header-mail { font-size: 16px; }
    .header-link { font-size: 13px; }
    .site-main { padding: 260px 14px 30px; }
    .topbar { gap: 22px; padding: 18px 16px 26px; }
    .radio-title { font-size: 20px; letter-spacing: 0.3em; }
    .nav-tab { padding: 14px 32px; font-size: 15px; }
    .panel, #panel-radio { max-width: 100%; }
}

@media (min-width: 1200px) {
    .panel { max-width: 860px; }
    #panel-radio { max-width: 860px; }
}

/* ── Compact now playing in mixes panel ───────────────────────────────────── */
.nowplaying-compact #rnp-widget {
    background: rgba(5, 10, 18, 0.5) !important;
    border-color: rgba(125, 229, 250, 0.05) !important;
    margin-bottom: 8px;
}

/* ── Mini now playing bar in mixes ───────────────────────────────────────── */
.mixes-nowplaying {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(10, 22, 40, 0.6);
    border: 1px solid rgba(125, 229, 250, 0.08);
    border-radius: 4px;
    backdrop-filter: blur(8px);
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.mixes-np-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--blue-light);
    flex-shrink: 0;
}
.mixes-np-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.mixes-np-sep {
    color: var(--text-dim);
    flex-shrink: 0;
}
.mixes-np-artist {
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    flex: 1;
}
.mixes-back-btn {
    margin-left: auto;
    padding: 4px 14px;
    font-size: 10px;
    letter-spacing: 0.15em;
    flex-shrink: 0;
}

/* ── Bouton install PWA ───────────────────────────────────────────────────── */
#pwa-install-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    padding: 10px 20px;
    background: rgba(10, 22, 40, 0.85);
    border: 1px solid rgba(125, 229, 250, 0.3);
    border-radius: 24px;
    color: var(--accent);
    font-family: var(--font-main);
    font-size: 12px;
    letter-spacing: 0.12em;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all var(--transition);
}
#pwa-install-btn:hover {
    background: rgba(125, 229, 250, 0.12);
    border-color: var(--accent);
}
#pwa-install-btn.visible { display: block; }

/* Guide iOS */
#pwa-ios-guide {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 14px 20px;
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(125, 229, 250, 0.2);
    border-radius: 12px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
    backdrop-filter: blur(12px);
    max-width: 280px;
    width: calc(100% - 40px);
}
#pwa-ios-guide.visible { display: block; }
#pwa-ios-guide strong { color: var(--accent); }
#pwa-ios-guide .pwa-close {
    display: block;
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-dim);
    cursor: pointer;
    letter-spacing: 0.1em;
}
