/* =========================================
   LiveGig — Dark Theme
   ========================================= */
:root {
    --accent:      #cc0000;
    --accent-glow: rgba(204,0,0,0.6);
    --bg:          #0b0b0b;
    --card-bg:     #131313;
    --card-border: #262626;
    --nav-bg:      #0d0d0d;
    --nav-border:  #1e1e1e;
    --row2-bg:     #111111;
}

/* Base */
html, body { background-color: var(--bg); color: #e0e0e0; min-height: 100vh; }

/* =========================================
   Fixed Nav — two rows
   ========================================= */
#clicktrack-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    z-index: 1050;
    padding: 0;
    width: 100%;
    top: 0;
    left: 0;
    right: 0;
}

/* Row 1: click track */
.ct-row-1 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 21px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--nav-border);
}

/* Row 2: navigation */
.ct-row-2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 21px;
    background: var(--row2-bg);
    flex-wrap: wrap;
    gap: 9px;
}

/* Spacer div replaces fixed padding-top so height is always exact */
#nav-spacer { flex-shrink: 0; }
#page-content { min-height: 100vh; } /* overridden for dashboard by body.page-dashboard rules */

/* Brand */
.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 4.5px;
    color: var(--accent);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =========================================
   Beat dots
   ========================================= */
.beat-dots { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.beat-dot {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1e1e1e;
    border: 2px solid #383838;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #444;
    transition: background 0.04s, box-shadow 0.04s;
    flex-shrink: 0;
    user-select: none;
}

.beat-dot.lit {
    background: var(--accent);
    border-color: #ff2222;
    color: #fff;
    box-shadow: 0 0 14px var(--accent-glow), 0 0 4px var(--accent-glow);
}

/* BPM display */
.ct-bpm-display {
    font-size: 1.875rem;
    font-weight: 700;
    color: #fff;
    min-width: 150px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    letter-spacing: 1px;
}

/* Song name */
.ct-song-display {
    font-size: 1.2rem;
    color: #999;
    min-width: 0;
    flex: 1 1 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggles */
.ct-toggles {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
}

.ct-toggle-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 1.1rem;
    color: #888;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.ct-toggle-label input[type="checkbox"] {
    width: 21px;
    height: 21px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* =========================================
   Navigation row 2
   ========================================= */
.ct-nav-links {
    display: flex;
    align-items: center;
    gap: 3px;
}

.ct-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 15px;
    border-radius: 5px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #888;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.ct-nav-link:hover {
    background: #1e1e1e;
    color: #ddd;
    text-decoration: none;
}

.ct-nav-link.active {
    background: rgba(204,0,0,0.12);
    color: #fff;
    border-bottom: 2px solid var(--accent);
}

.ct-nav-admin { color: #c8a000; }
.ct-nav-admin:hover { color: #ffd700; background: rgba(200,160,0,0.1); }
.ct-nav-admin.active { background: rgba(200,160,0,0.15); border-bottom-color: #ffd700; color: #ffd700; }

.ct-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ct-band-name {
    font-size: 1.15rem;
    color: #666;
    white-space: nowrap;
}

.ls-usage {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: default;
    white-space: nowrap;
}
.ls-usage-bar {
    display: block;
    width: 52px;
    height: 6px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.ls-usage-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #7a2222;
    transition: width 0.4s, background 0.4s;
    min-width: 2px;
}
.ls-usage-label {
    font-size: 0.68rem;
    color: #666;
    letter-spacing: 0.01em;
    transition: color 0.3s;
}
/* warn > 60 % */
.ls-usage.ls-warn .ls-usage-fill  { background: #b06820; }
.ls-usage.ls-warn .ls-usage-label { color: #a06020; }
/* full > 90 % */
.ls-usage.ls-full .ls-usage-fill  { background: #cc3333; }
.ls-usage.ls-full .ls-usage-label { color: #cc3333; }

/* =========================================
   Cards
   ========================================= */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
}

.card-header {
    background: #181818;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #aaa;
    text-transform: uppercase;
    padding: 8px 12px;
}

/* =========================================
   List groups
   ========================================= */
.list-group-item {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: #d0d0d0;
}

.list-group-item-action:hover { background: #1c1c1c; color: #fff; }

.list-group-item-action.selected {
    background: rgba(204,0,0,0.1);
    border-left: 3px solid var(--accent);
    color: #fff;
}
/* Compenseer de 3px border zodat tekst niet springt bij selectie */
.sl-item.selected { padding-left: 11px; }

/* =========================================
   Setlist-items: vinger-vriendelijke hoogte + starts-rij
   ========================================= */
.sl-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    padding: 10px 14px;
    gap: 8px;
}

.sl-item .sl-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sl-item .sl-title-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.sl-item .sl-num    { color: #555; font-size: 0.8rem; flex-shrink: 0; }
.sl-item .sl-title  { font-weight: 600; color: #e8e8e8; }
.sl-item .sl-artist { color: #777; font-size: 0.8rem; }

.sl-item .sl-starts {
    font-size: 0.72rem;
    color: #888;
    padding-left: 2px;
}
.sl-item .sl-starts i { color: #cc4444; margin-right: 3px; }

/* =========================================
   BPM badge
   ========================================= */
.bpm-badge {
    display: inline-block;
    background: #1a1a1a;
    border: 1px solid #2e2e2e;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Big BPM */
.bpm-big {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* =========================================
   Tables
   ========================================= */
.table-dark {
    --bs-table-bg: var(--card-bg);
    --bs-table-border-color: var(--card-border);
}
.table-dark thead th {
    background: #181818;
    color: #777;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-color: var(--card-border);
    padding: 8px 12px;
}
.table-dark td, .table-dark th { border-color: var(--card-border); vertical-align: middle; }
.table-hover tbody tr:hover td { background: #1a1a1a; }

/* =========================================
   Buttons
   ========================================= */
.btn-danger { background: var(--accent); border-color: var(--accent); }
.btn-danger:hover { background: #e60000; border-color: #e60000; }

.btn-xs {
    padding: 2px 7px;
    font-size: 0.7rem;
    line-height: 1.4;
    border-radius: 3px;
}

/* =========================================
   Forms
   ========================================= */
.form-control, .form-select {
    background: #181818;
    border-color: #2e2e2e;
    color: #e0e0e0;
}
.form-control:focus, .form-select:focus {
    background: #1c1c1c;
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(204,0,0,0.18);
}
.form-control::placeholder { color: #555; }

/* =========================================
   Login / register page
   ========================================= */
.login-page {
    background: radial-gradient(ellipse at 50% 30%, #180000 0%, #000 65%);
}

.login-card {
    background: #111;
    border: 1px solid #252525;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 0 80px rgba(204,0,0,0.07);
}

.login-logo {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 4px;
}

.login-logo .beat-dot { width: 26px; height: 26px; font-size: 0.55rem; }
.login-logo .beat-dot.lit {
    background: var(--accent);
    border-color: #ff2222;
    box-shadow: 0 0 10px var(--accent-glow);
    color: #fff;
}

/* =========================================
   Alerts — keep below nav
   ========================================= */
.page-alert {
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    margin: 0 0 16px 0;
    padding: 10px 16px;
    font-size: 0.85rem;
}

/* =========================================
   Setlist cards
   ========================================= */
.setlist-card { transition: border-color 0.2s; }
.setlist-card:hover { border-color: #383838; }

/* =========================================
   Scrollbar
   ========================================= */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* =========================================
   Dropdown dark
   ========================================= */
.dropdown-menu-dark { background: #161616; border: 1px solid #252525; }
.dropdown-menu-dark .dropdown-item { color: #ccc; font-size: 0.85rem; }
.dropdown-menu-dark .dropdown-item:hover { background: #202020; color: #fff; }
.dropdown-menu-dark .dropdown-item.active { background: rgba(204,0,0,0.18); color: #fff; }
.dropdown-header { color: #666; font-size: 0.72rem; }

/* =========================================
   Modals
   ========================================= */
.modal-content { background: #111 !important; border: 1px solid #252525; }
.modal-header, .modal-footer { border-color: #252525 !important; }
.modal-header .modal-title { font-size: 0.95rem; font-weight: 600; }

/* =========================================
   Tabs
   ========================================= */
.nav-tabs { border-color: #252525; }
.nav-tabs .nav-link { color: #777; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; font-size: 0.85rem; }
.nav-tabs .nav-link.active { color: #fff; border-bottom-color: var(--accent); background: none; }
.nav-tabs .nav-link:hover { color: #ccc; }

/* =========================================
   Song detail card
   ========================================= */
#song-detail-card { border-left: 3px solid var(--accent) !important; }

/* =========================================
   Inklapbare drumstructuur
   ========================================= */
.drum-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: #161616;
    border: 1px solid #222;
    border-radius: 5px;
    color: #666;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 5px 9px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: left;
}
.drum-toggle-btn:hover         { background: #1c1c1c; color: #bbb; }
.drum-toggle-btn.open          { border-radius: 5px 5px 0 0; border-bottom-color: transparent; }
.drum-toggle-btn .bi           { font-size: 0.8rem; transition: transform 0.15s; }

/* =========================================
   Music search results (songs modal)
   ========================================= */
.search-loading {
    font-size: 0.8rem;
    color: #666;
    padding: 6px 2px;
}

.search-source {
    font-size: 0.72rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding: 0 2px;
}

.search-result-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-result-item {
    background: #181818;
    border: 1px solid #252525;
    border-radius: 5px;
    padding: 4px 8px;
    transition: background 0.12s, border-color 0.12s;
    color: #d0d0d0;
}

.search-result-item:hover {
    background: #222;
    border-color: var(--accent);
    color: #fff;
}

.search-result-item > button.flex-grow-1 {
    color: inherit;
    padding: 2px 4px;
}

.search-result-item > button.flex-grow-1:hover,
.search-result-item > button.flex-grow-1:focus {
    color: #fff;
    outline: none;
    box-shadow: none;
}

.search-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-artist {
    font-size: 0.75rem;
    color: #777;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-dur {
    font-size: 0.72rem;
    color: #555;
    margin-left: 6px;
}

.search-result-badges {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
}

.search-badge {
    display: inline-block;
    background: #1e1e1e;
    border: 1px solid #2e2e2e;
    color: #999;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.search-badge-camelot {
    background: rgba(200, 160, 0, 0.1);
    border-color: rgba(200, 160, 0, 0.35);
    color: #c8a000;
    font-weight: 700;
}

.search-badge-pop {
    background: rgba(204, 0, 0, 0.08);
    border-color: rgba(204, 0, 0, 0.25);
    color: #cc6666;
}

/* =========================================
   Dashboard — full-viewport, no page scroll
   =========================================
   Strategy: make <body> a flex-column that is
   exactly 100dvh tall. nav-spacer takes its
   natural height; #page-content gets the rest.
   No calc() or CSS-variable tricks needed.
   ========================================= */

body.page-dashboard {
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.page-dashboard #nav-spacer { flex-shrink: 0; }

body.page-dashboard #page-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.db-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    padding: 10px 12px;
    gap: 8px;
    overflow: hidden;
}

.db-col-left {
    flex: 0 0 30%;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

.db-col-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* A card that fills its column */
.db-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Scrollable list inside a db-card */
.db-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* =========================================
   Dashboard detailkaart met tabs (notities / drumstructuur)
   ========================================= */
.db-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px;
    flex-shrink: 0;
}

.db-tabs {
    border-bottom: none;
    flex-wrap: wrap;
}
.db-tabs .nav-link {
    color: #888;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 9px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}
.db-tabs .nav-link:hover { color: #ddd; }
.db-tabs .nav-link.active {
    color: #fff;
    background: transparent;
    border-bottom: 2px solid var(--accent);
}
.db-tabs .nav-link .bi { font-size: 0.85rem; margin-right: 3px; }

/* Tab-inhoud vult de resterende hoogte; het actieve paneel scrollt */
.db-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
}
.db-tab-content > .tab-pane { width: 100%; }
.db-tab-content > .tab-pane.active {
    display: flex;
    flex-direction: column;
}

.db-pane {
    padding: 14px 16px;
    overflow: auto;
}
.db-notes {
    white-space: pre-wrap;
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.55;
    word-break: break-word;
}
.db-drum { overflow: auto; }
.db-chords {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* PDF-tab: iframe vult het paneel rand-tot-rand */
/* Compacte rol-dropdown in de ledenlijst (bands.php) */
.lg-role-select {
    width: auto;
    font-size: 0.7rem;
    padding: 1px 20px 1px 6px;
    height: auto;
}

.db-pane-pdf { padding: 0; overflow: hidden; }
.db-pdf-frame {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

/* Lege staat binnen een tab */
.db-pane-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #555;
    font-size: 0.9rem;
}
.db-pane-empty .bi { font-size: 2rem; opacity: 0.5; }

@media (max-width: 991.98px) {
    .db-wrap {
        flex-direction: column;
        overflow-y: auto;   /* één scroll-container voor de hele pagina */
        overflow-x: hidden;
    }

    /* Setlist-kolom: geen vaste hoogte, expandeer mee met de inhoud.
       Zo vermijden we geneste scroll-containers — de buitenste .db-wrap
       is de enige scroller, en alle nummers zijn altijd aanraakbaar. */
    .db-col-left {
        flex: none;
    }
    .db-col-left .db-card {
        flex: none;
        height: auto;
    }
    .db-col-left .db-list {
        flex: none;
        height: auto;
        overflow-y: visible;   /* geen eigen scroll op tablet */
        min-height: 0;
    }

    /* Detailkaart krijgt op tablet/mobiel een vaste hoogte zodat de tabs
       (notities/drum) bruikbaar blijven binnen de pagina-scroll. */
    .db-col-right { flex: none; }
    .db-col-right .db-card {
        flex: none;
        height: 70vh;
        min-height: 320px;
    }
}
