/* ============================================================
   DANSBANDSRADIO – FULL DESIGN + WCAG KONTRASTFIX + CLS-FIX
   ============================================================ */

/* ---------- Färgtema (WCAG AA godkänt) ---------- */
:root {
    --bg-main: #14394d;
    --bg-alt: #1a4c66;
    --bg-card: #102a38;

    --primary: #e6b23c;
    --primary-dark: #c9972f;

    --text: #ffffff;
    --text-muted: #dfe6ea;

    --shadow: 0 4px 12px rgba(0,0,0,0.35);
    --radius: 14px;
    --transition: 0.2s ease;
}

/* ---------- Grundlayout ---------- */
html {
    font-display: swap; /* förhindrar font-hopp */
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #1d4f68 0%, #14394d 40%, #0c2736 100%);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: var(--transition);
    font-weight: 600;
}

a:hover {
    color: #ffdd7a;
}

/* ============================================================
   HEADER – CENTRERAD LOGGA + MENY
   ============================================================ */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 30, 45, 0.95);
    border-bottom: 2px solid var(--primary);
    padding: 15px 10px 12px 10px;
    text-align: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(230,178,60,0.7);
    font-weight: 700;
    line-height: 1.3;
}

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

header nav a,
header nav .dropbtn {
    padding: 6px 12px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.10);
    color: var(--text);
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
}

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

/* Språkväljare */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 110%;
    background: var(--bg-card);
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

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

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

main {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    padding-top: 150px;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* ============================================================
   BOXAR / SEKTIONER
   ============================================================ */

section,
.welcome-text {
    background: var(--bg-card);
    padding: 22px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
}

/* CLS FIX – reservera höjd för välkomsttexten */
#welcomeText {
    min-height: 420px;
    display: block;
}

section h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.35rem;
    color: var(--primary);
    text-shadow: 0 0 6px rgba(230,178,60,0.4);
}

/* ============================================================
   NOW PLAYING – FAST HÖJD (CLS FIX)
   ============================================================ */

#nowPlayingBox {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#nowPlaying {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 6px;
    overflow-wrap: break-word;
}

/* ============================================================
   KOMMER HÄRNÄST – FAST HÖJD PER RAD (CLS FIX)
   ============================================================ */

#comingNext div {
    background: #0f3344;
    padding: 14px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    min-height: 60px;
    overflow-wrap: break-word;
}

/* ============================================================
   ÖNSKA LÅT – NAVIGERING, PAGINERING, SÖK, LISTA
   ============================================================ */

.search-box,
.played-search {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px 0;
}

.search-box input[type="text"],
.played-search input[type="text"] {
    width: 100%;
    max-width: 350px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.15);
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    box-shadow: var(--shadow);
}

.search-box input::placeholder,
.played-search input::placeholder {
    color: var(--text-muted);
}

/* Paginering */
.pagination,
.played-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pagination a,
.played-pagination a {
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pagination a:hover,
.played-pagination a:hover {
    background: var(--primary);
    color: #1b1300;
}

.pagination .active,
.played-pagination .active {
    background: var(--primary);
    color: #1b1300;
}

/* Låtlista */
.song-list,
.played-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.song-item,
.played-item {
    background: #0f3344;
    padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    box-shadow: var(--shadow);
}

/* Önska-knapp */
.song-item .request-btn,
.played-item .played-btn {
    padding: 8px 14px;
    background: var(--primary);
    color: #1b1300;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.song-item .request-btn:hover,
.played-item .played-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Spelade-info */
.played-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.played-title {
    font-size: 1.1rem;
    font-weight: 700;
}

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

/* ============================================================
   PLAYER – SUPERKOMPAKT + CLS FIX
   ============================================================ */

.player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0d2533;
    border-top: 2px solid var(--primary);
    min-height: 58px; /* CLS fix */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.35);
    z-index: 1000;
}

#playBtn {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    padding: 6px 14px;
    color: #1b1300;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

#playBtn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.playerInfo {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.progressBar {
    height: 6px;
    background: #24485f;
    border-radius: 5px;
    overflow: hidden;
    margin: 3px 0;
}

.progressBar div {
    height: 100%;
    background: var(--primary);
    transition: width 0.5s;
}

/* ============================================================
   MOBILANPASSNING
   ============================================================ */

@media (max-width: 600px) {

    header h1 {
        font-size: 1.25rem;
        padding: 0 10px;
    }

    header nav {
        gap: 10px;
    }

    .container {
        padding-top: 170px;
    }

    section {
        padding: 18px;
    }

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

    .song-item .request-btn,
    .played-item .played-btn {
        width: 100%;
        text-align: center;
    }

    .pagination a,
    .played-pagination a {
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .player {
        height: auto;
        flex-direction: column;
        padding-bottom: 12px;
    }

    #playBtn {
        width: 20%;
        text-align: center;
    }
}
/* GPU-accelererade hover-effekter (ersätter gamla) */
header nav a:hover,
header nav .dropbtn:hover,
.song-item .request-btn:hover,
.played-item .played-btn:hover,
.share-facebook:hover,
#playBtn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    background: var(--primary);
    color: #1b1300;
}
