/* ============================================================
   DANSBANDSRADIO.SE – SPOTIFY STYLE (CHRISTMAS EDITION)
   ============================================================ */

/* ---------- ROOT COLORS ---------- */
:root {
    --bg-main: #f4f7f5;
    --bg-gradient: linear-gradient(180deg, #b31b2c 0%, #d93848 32%, #f4f7f5 100%);

    --card: rgba(255, 255, 255, 0.88);
    --card-solid: #ffffff;

    --primary: #c41e3a;        /* Julröd */
    --primary-dark: #96142a;   /* Djup julröd */
    --secondary: #1b5e3a;      /* Granbarr / Mörkgrön */
    --secondary-dark: #13442a;
    --gold: #d4af37;           /* Varmt guld */

    --text: #1f1f1f;
    --text-muted: #5c6660;

    --radius: 18px;
    --shadow: 0 10px 30px rgba(150, 20, 42, 0.08);
    --transition: 0.25s ease;
}

/* ---------- BASE ---------- */
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Subtilt snöfall i bakgrunden (påverkar inte klick) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(3px 3px at 20px 30px, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2px 2px at 90px 80px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(3px 3px at 160px 120px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 230px 40px, rgba(255, 255, 255, 0.6), transparent);
    background-size: 260px 260px;
    animation: snowfall 14s linear infinite;
}

@keyframes snowfall {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 40px 260px, -30px 260px, 20px 260px, -20px 260px;
    }
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================================
   HEADER (Spotify Glass Style – Christmas)
   ============================================================ */

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    padding: 14px 10px;
    z-index: 1000;
    border-bottom: 2px solid rgba(212, 175, 55, 0.45);
    box-shadow: 0 4px 20px rgba(150, 20, 42, 0.08);
}

header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--primary);
    font-weight: 700;
}

header nav {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

header nav a,
.dropbtn {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 8px 14px;
    border-radius: 999px;
    transition: var(--transition);
}

header nav a:hover,
.dropbtn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   DROPDOWN
   ============================================================ */

.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-solid);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    display: none;
}

.dropbtn:focus + .dropdown-content,
.dropdown-content:hover {
    display: block;
}

.dropdown-content a {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
}

.dropdown-content a:hover {
    background: #fdf3f4;
    color: var(--primary);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */

main {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 850px;
    padding: 140px 20px 120px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ============================================================
   CARDS (Spotify-like Panels)
   ============================================================ */

section,
.welcome-text {
    background: var(--card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

section h2 {
    margin-top: 0;
    color: var(--primary);
}

/* ============================================================
   NOW PLAYING
   ============================================================ */

#nowPlayingBox {
    text-align: center;
    border-top: 3px solid var(--gold);
}

#nowPlaying {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

/* ============================================================
   SONG LIST (Spotify Cards)
   ============================================================ */

.song-list,
#playedList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.song-item,
.played-item {
    background: var(--card-solid);
    border: 1px solid rgba(27, 94, 58, 0.12);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.song-item:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.6);
}

.song-title {
    font-weight: 700;
}

.song-artist,
.played-time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS (Spotify Inspired – Christmas)
   ============================================================ */

.request-btn,
.played-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.request-btn:hover,
.played-btn:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

/* ============================================================
   SEARCH
   ============================================================ */

#searchInput {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: #fff;
    box-shadow: var(--shadow);
    font-size: 1rem;
    margin-bottom: 15px;
    outline: none;
    transition: var(--transition);
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

/* ============================================================
   PAGINATION
   ============================================================ */

#pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

#pagination a {
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: var(--shadow);
}

#pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================================
   PLAYER (Spotify Bottom Bar)
   ============================================================ */

.player {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    border-top: 2px solid rgba(212, 175, 55, 0.45);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    box-shadow: 0 -4px 20px rgba(150, 20, 42, 0.12);
    z-index: 1000;
}

/* Play Button */
#playBtn {
    background: var(--primary);
    color: #fff;
    border: 2px solid rgba(212, 175, 55, 0.5);
    font-size: 1.4rem;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: var(--transition);
}

#playBtn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Player Info */
.playerInfo {
    flex: 1;
    margin-left: 12px;
}

/* Progress bar */
.progressBar {
    height: 6px;
    background: #e6ece8;
    border-radius: 10px;
    overflow: hidden;
}

.progressBar div {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
}

/* Modern Grid-layout för sektionerna */
.listen-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .listen-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Stilrena kort/boxar */
.card {
    background: #fdfdfd;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(150, 20, 42, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

.card h3 {
    margin-top: 0;
    font-size: 1.25rem;
    color: #2b332e;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Knappar för externa plattformar och installation */
.platform-links {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn-platform {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s, transform 0.1s;
    flex: 1;
    min-width: 120px;
    border: none;
    cursor: pointer;
}

.btn-platform:hover {
    background-color: var(--primary-dark);
    color: #fff;
}

.btn-platform:active {
    transform: scale(0.98);
}

/* PWA Installationsknapp (Grangrön) */
.btn-install {
    background-color: var(--secondary);
    width: 100%;
    margin-bottom: 1rem;
}

.btn-install:hover {
    background-color: var(--secondary-dark);
}

/* Listning av strömmar / direktlänkar */
.stream-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stream-item {
    background: #f7faf8;
    border: 1px solid #e1e8e3;
    border-radius: 8px;
    padding: 1rem;
}

.stream-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.stream-title {
    font-weight: bold;
    color: #2f4237;
}

/* Kopieringsknappen */
.copy-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
}

.copy-btn:hover {
    background: var(--secondary-dark);
}

.copy-btn:active {
    transform: scale(0.95);
}

/* Visning av själva URL:en */
.stream-url {
    font-family: monospace;
    font-size: 0.85rem;
    color: #555;
    word-break: break-all;
    background: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #d8e2dc;
    display: block;
}

/* Popup / Modal för önskelåtar med timer */
.ad-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 10, 12, 0.65);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.ad-modal-content {
    background: #fff;
    border: 2px solid rgba(212, 175, 55, 0.5);
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    text-align: center;
    box-sizing: border-box;
    position: relative;
}

.ad-modal-banner {
    width: 100%;
    min-height: 150px;
    background: #fdf9f3;
    border: 2px dashed var(--gold);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #495057;
    font-weight: 500;
}

.ad-modal-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.ad-modal-timer {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.ad-modal-close {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: not-allowed;
    width: 100%;
    transition: background 0.2s;
}

.ad-modal-close.active {
    background-color: var(--primary);
    cursor: pointer;
}

.ad-modal-close.active:hover {
    background-color: var(--primary-dark);
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    .container {
        padding-bottom: 160px;
    }

    .song-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .request-btn {
        width: 100%;
        text-align: center;
    }

    .player {
        flex-direction: column;
        gap: 10px;
    }
}