/* =========================
   BASE
========================= */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0b0f14;
    color: #eee;
}

h1 {
    font-size: 22px;
    margin: 20px;
    color: #fff;
}

a {
    color: #38bdf8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   TOP BAR
========================= */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 12px 16px;

    background: #111923;
    border-bottom: 1px solid #1f2a38;

    position: sticky;
    top: 0;
    z-index: 20;
}

#clock {
    font-size: 14px;
    color: #aaa;
}

/* right-side link */
#main_site_link {
    margin-left: auto;

    color: #00ff99;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;

    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 153, 0.3);

    background: rgba(17, 25, 35, 0.8);
    backdrop-filter: blur(8px);

    transition: 0.2s ease;
}

#main_site_link:hover {
    border-color: rgba(0, 255, 153, 0.8);
    transform: translateY(-1px);
}

/* =========================
   LAYOUT
========================= */
.container {
    max-width: 1000px;
    margin: 10px auto;   /* 👈 only horizontal centering */
}

/* =========================
   CARDS (LIBRARY / GENRES)
========================= */
.card {
    background: #111923;
    border: 1px solid #1f2a38;

    padding: 14px;
    margin: 10px 20px;

    border-radius: 12px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    transition: 0.15s ease;
}

.card:hover {
    border-color: rgba(0, 255, 153, 0.25);
    transform: translateY(-1px);
}

/* =========================
   TEXT
========================= */
.title {
    font-weight: bold;
    color: #fff;
}

.meta {
    font-size: 12px;
    color: #aaa;
}

/* =========================
   BUTTONS
========================= */
button {
    background: linear-gradient(135deg, #1a2430, #0d141c);
    border: 1px solid #1f2a38;

    padding: 6px 10px;
    border-radius: 8px;

    color: #fff;
    cursor: pointer;

    transition: 0.2s ease;
}

button:hover {
    border-color: rgba(0, 255, 153, 0.6);
}

.actions button {
    margin-left: 6px;
}

.secondary {
    color: #ccc;
}

.secondary:hover {
    border-color: rgba(148, 163, 184, 0.5);
}

.danger {
    border-color: rgba(220, 38, 38, 0.5);
}

.danger:hover {
    border-color: rgba(220, 38, 38, 0.9);
}

/* =========================
   INPUTS (SEARCH ETC)
========================= */
input,
select {
    padding: 10px 12px;
    margin: 10px 20px;

    width: 280px;

    background: #111923;
    border: 1px solid #1f2a38;
    border-radius: 10px;

    color: #fff;
    outline: none;
}

input:focus,
select:focus {
    border-color: #00ff99;
}

/* full width search variant */
input {
    box-sizing: border-box;
}

/* =========================
   TABLE (GENRE / TRACK VIEW)
========================= */
.table-wrapper {
    margin: 10px 20px 20px 20px;

    max-height: 900px;
    overflow-y: auto;
    overflow-x: auto;   /* 👈 enables horizontal scroll */

    border-radius: 10px;
    border: 1px solid #1f2a38;

    background: rgba(17, 25, 35, 0.6);
}

.search-wrapper {
    max-height: 300px;   /* adjust as needed */
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;

    padding: 10px;

    background: #111923;
    color: #aaa;

    position: sticky;
    top: 0;
    z-index: 5;

    border-bottom: 2px solid #00ff99;
}

td {
    border-bottom: 1px solid #1a1a1a;
    padding: 10px;
    font-size: 14px;
    color: #ddd;
}

tr:hover {
    background: rgba(0, 255, 153, 0.06);
}

/* duration column */
td:nth-child(5) {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #aaa;
}

/* =========================
   SEARCH PANEL
========================= */
.scroll-y {
    max-height: 700px;
    overflow-y: auto;
}

.search-panel {
    margin: 0 20px 20px 20px;

    max-width: 1000px;

    background: rgba(17, 25, 35, 0.9);
    border: 1px solid #1f2a38;
    border-radius: 12px;

    padding: 12px;

    backdrop-filter: blur(8px);
}

/* =========================
   STATUS TEXT
========================= */
.meta {
    font-size: 12px;
    color: #aaa;
}

/* =========================
   LOGIN OVERLAY
========================= */
#loginBox {
    position: fixed;
    inset: 0;

    background: rgba(0, 0, 0, 0.92);

    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;

    z-index: 100;
}

#loginBox h2 {
    color: #fff;
}

#loginError {
    margin-top: 10px;
    color: #ff4d4d;
}


.panel {
    padding: 20px;
    flex: 1;
}

/* =========================
   SIDEBAR LAYOUT
========================= */

.sidebar-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1f2a38;
}

.sidebar-section input {
    width: 100%;
    margin: 6px 0;
}

.sidebar-search-results {
    max-height: 250px;
    overflow-y: auto;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    background: #0f1620;
    border-right: 1px solid #1f2a38;

    display: flex;
    flex-direction: column;
    padding: 12px;

    position: sticky;
    top: 0;
    height: 100vh;
}

/* Logo / title */
.sidebar .logo {
    font-size: 16px;
    font-weight: bold;
    color: #fff;

    padding: 10px 12px;
    margin-bottom: 10px;
}

/* NAV LINKS */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;
    margin: 4px 0;

    border-radius: 10px;

    color: #ccc;
    text-decoration: none;

    transition: 0.15s ease;
}

.nav-link:hover {
    background: rgba(0, 255, 153, 0.08);
    color: #fff;
}

/* ACTIVE PAGE */
.nav-link.active {
    background: rgba(0, 255, 153, 0.15);
    color: #00ff99;
    border: 1px solid rgba(0, 255, 153, 0.3);
}

/* ICON (optional emoji or svg) */
.nav-icon {
    width: 18px;
    text-align: center;
}

/* MAIN CONTENT AREA */
.main-content {
    flex: 1;

    display: flex;
    flex-direction: column;

    align-items: center;         /* horizontal center */
    justify-content: flex-start; /* force top */

    min-width: 0;
}

.main-content .container {
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
    min-width: 0;   /* 👈 also important in flex layouts */
}

/* =========================
   SIDEBAR STRUCTURE CLEANUP
========================= */

.sidebar-section {
    margin-top: auto;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

/* divider line */
.sidebar-divider {
    height: 1px;
    background: #1f2a38;
    margin: 12px 0;
}

/* section label already exists, but make it tighter */
.sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;

    margin-bottom: 6px;
}

/* ensure spacing is controlled */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* inputs fit sidebar nicely */
.sidebar input,
.sidebar select {
    width: 100%;
    margin: 0;
}

/* =========================
   SIDEBAR SECTIONS
========================= */

.sidebar-section {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #1f2a38;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;

    padding: 0 4px;
}

/* Make inputs fit sidebar */
.sidebar input,
.sidebar select {
    width: 100%;
    margin: 0;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 800px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .logo {
        display: none;
    }

    .nav-link span {
        display: none;
    }
}

/* =========================
   SCROLL PANELS (NEW)
========================= */

.scroll-box {
    max-height: calc(95vh - 200px); /* dynamic height */
    overflow-y: auto;

    border: 1px solid #1f2a38;
    border-radius: 12px;

    background: rgba(17, 25, 35, 0.6);

    padding: 10px;
    margin: 10px 20px;
}

/* nicer scrollbar (optional but helpful) */
.scroll-box::-webkit-scrollbar {
    width: 8px;
}

.scroll-box::-webkit-scrollbar-thumb {
    background: #1f2a38;
    border-radius: 8px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 800px) {
    input,
    select {
        width: calc(100% - 40px);
    }

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

/* =========================
   XML IMPORT DROPZONE (SPECIAL)
========================= */

.dropzone {
    margin: 10px 20px;

    padding: 18px;

    border: 2px dashed rgba(0, 255, 153, 0.25);
    border-radius: 12px;

    background: rgba(17, 25, 35, 0.6);

    color: #888;
    text-align: center;

    cursor: pointer;

    transition: all 0.2s ease;

    user-select: none;
}

.dropzone:hover {
    border-color: rgba(0, 255, 153, 0.6);
    color: #00ff99;
    transform: translateY(-1px);
}

.dropzone.dragover {
    border-color: #00ff99;
    background: rgba(0, 255, 153, 0.08);
    color: #00ff99;
}

/* =========================
   SPECIAL EVENT VISUAL TUNING
========================= */

/* NOW events = urgent red accent */
.card.now {
    border-left: 4px solid #ff4d4d;
}

/* SOON events = amber */
.card.soon {
    border-left: 4px solid #f39c12;
}

/* make special cards feel more "broadcast system" */
.panel h1 {
    margin: 10px 20px;
}

/* tighten spacing inside left panel */
.panel input,
.panel select {
    margin: 6px 20px;
}

/* button alignment consistency */
.panel button {
    margin: 10px 20px;
}

/* improve readability for event lists */
#upcoming .card,
#history .card {
    margin: 8px 0;
}

/* subtle separation between sections */
.panel hr {
    border: none;
    border-top: 1px solid #1f2a38;
    margin: 20px;
}

.chip {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px 4px 2px 0;

    background: #2b2b2b;
    border: 1px solid #444;

    border-radius: 999px;

    font-size: 11px;
    color: #ddd;

    white-space: nowrap;
}

.chip:hover {
    background: #3a3a3a;
    cursor: pointer;
}

.playlist {
    width: 100%;
}
