/* Partikel & Radio Stylesheet */

body {
    margin: 0;
    padding: 0;
    background-image: url("pics/met.gif");
    background-repeat: repeat;
    background-attachment: fixed;
    font-family: Arial, sans-serif;
}

.background {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    z-index: -1;
}

.content {
    position: relative;
    z-index: 1;
    padding-top: 50px;
    /* pointer-events: none allows clicks to pass through to canvas when a tool is active */
    pointer-events: none;
}

/* Re-enable pointer events for actual links and images */
.content a, .content img {
    pointer-events: auto;
}
















/* ── Settings panel ─────────────────────────────────────────── */
/* settings-panel defined in bar section below */

#settings-panel h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    font-weight: bold;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 0;
}

.setting-row label {
    font-size: 11px;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 6px;
    min-width: 90px;
}

.setting-val {
    font-size: 11px;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 38px;
    text-align: right;
    margin-right: 6px;
}

.setting-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: #3366ff;
    cursor: pointer;
}

.setting-row input[type="color"] {
    width: 36px;
    height: 20px;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 1px;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

#settings-panel .btn-row {
    display: flex;
    gap: 6px;
    margin-top: 9px;
}

#settings-panel .btn-row button {
    flex: 1;
    font-size: 11px;
    padding: 4px 6px;
    background: rgba(240,240,240,0.9);
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
}

#settings-panel .btn-row button:hover { background: #fff; }

#settings-panel .btn-row button.apply-btn {
    background: rgba(51,102,255,0.12);
    border-color: #3366ff;
    color: #1a44cc;
    font-weight: bold;
}

.setting-section {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 8px 0 4px 0;
    border-top: 1px solid #eee;
    padding-top: 6px;
}

#hint {
    background: rgba(255,255,255,0.75);
    border: 1px solid #bbb;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    color: #444;
    max-width: 240px;
    text-align: right;
}

#clear-btn {
    font-size: 11px;
    padding: 3px 7px;
    color: #800;
    border-color: #c88;
}

/* Crosshair cursor when a tool is active */
body.tool-active { cursor: crosshair; }

/* ═══════════════════════════════════════════════════════════
   MAIN BAR  (Footer oder Header)
═══════════════════════════════════════════════════════════ */
#main-bar {
    position: fixed;
    left: 0; right: 0;
    height: 48px;
    z-index: 200;
    background: rgba(240,240,240,0.96);
    display: flex;
    align-items: stretch;
    pointer-events: auto;
    font-family: Arial, sans-serif;
    font-size: 12px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.10);
}
#main-bar.bar-bottom {
    bottom: 0; top: auto;
    border-top: 1px solid #bbb;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.10);
}
#main-bar.bar-top {
    top: 0; bottom: auto;
    border-bottom: 1px solid #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
body.has-bar-bottom { padding-bottom: 52px; }
body.has-bar-top    { padding-top:    52px; }

/* Popup-Panels klappen entgegengesetzt zur Bar */
#main-bar.bar-bottom .panel-popup { bottom: 48px; top: auto; border-radius: 6px 6px 0 0; }
#main-bar.bar-top    .panel-popup { top: 48px; bottom: auto; border-radius: 0 0 6px 6px; }

/* ── Bar-Segmente ── */
#bar-radio    { display: flex; align-items: center; padding: 0 10px; gap: 7px; flex-shrink: 0; min-width: 260px; border-right: 1px solid #ccc; position: relative; }
#bar-text     { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px; color: #666; font-size: 10px; text-align: center; }
#bar-particle { display: flex; align-items: center; padding: 0 10px; gap: 5px; flex-shrink: 0; border-left: 1px solid #ccc; position: relative; }

/* ── Radio im Bar ── */
#radio-play-btn {
    background: none; border: none; cursor: pointer;
    font-size: 15px; color: #333; padding: 2px 3px; flex-shrink: 0; line-height: 1;
}
#radio-play-btn:hover { color: #000; }
#radio-play-btn.playing { color: #006622; }

#radio-sender-label {
    flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 11px; color: #333; cursor: pointer;
    min-width: 60px; max-width: 140px;
}
#radio-sender-label:hover { color: #3366ff; }

#radio-vol-mini { width: 65px; accent-color: #3366ff; cursor: pointer; flex-shrink: 0; }

#radio-db-label { font-size: 10px; color: #666; width: 46px; text-align: right; flex-shrink: 0; white-space: nowrap; }

#radio-expand-btn {
    background: none; border: 1px solid #bbb; border-radius: 3px;
    cursor: pointer; font-size: 10px; color: #888; padding: 1px 5px; flex-shrink: 0;
}
#radio-expand-btn:hover { color: #333; border-color: #888; }

/* ── Radio Popup ── */
#radio-popup {
    display: none; position: absolute; left: 0;
    width: 260px;
    background: rgba(255,255,255,0.97);
    border: 1px solid #aaa;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 8px; z-index: 300;
    max-height: 380px; overflow-y: auto;
}
#radio-popup.open { display: block; }

#radio-popup-url-row { display: flex; gap: 4px; margin-bottom: 6px; }
#radio-list-url {
    flex: 1; font-size: 10px; padding: 2px 4px;
    border: 1px solid #bbb; border-radius: 3px; color: #444;
}
#radio-list-load-btn {
    font-size: 10px; padding: 2px 6px;
    border: 1px solid #bbb; border-radius: 3px;
    background: rgba(240,240,240,0.9); cursor: pointer;
}
#radio-list-load-btn:hover { background: #fff; }
#radio-popup-status { font-size: 10px; color: #888; margin-bottom: 4px; }
#radio-popup-status.error { color: #cc2200; }

.radio-group-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 6px; background: rgba(225,225,225,0.9);
    border: 1px solid #ccc; border-radius: 4px; cursor: pointer;
    font-size: 11px; font-weight: bold; color: #333;
    user-select: none; margin-bottom: 2px;
}
.radio-group-header:hover { background: rgba(210,210,210,0.95); }
.radio-group-header .arrow { font-size: 9px; display: inline-block; transition: transform 0.12s; }
.radio-group-header.open .arrow { transform: rotate(90deg); }
.radio-group-items { display: none; flex-direction: column; gap: 1px; padding: 2px 0 4px 8px; }
.radio-group-items.open { display: flex; }
.radio-item { padding: 3px 6px; font-size: 11px; color: #222; cursor: pointer; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-item:hover { background: rgba(51,102,255,0.12); color: #1a44cc; }
.radio-item.active { background: rgba(0,160,60,0.12); color: #006622; font-weight: bold; }

/* ── Partikel-Toolbar im Bar ── */
#bar-particle select, #bar-particle button {
    background: rgba(255,255,255,0.85);
    border: 1px solid #999; border-radius: 4px;
    padding: 3px 5px; cursor: pointer; font-size: 11px; color: #222;
}
#bar-particle select:hover, #bar-particle button:hover { background: rgba(255,255,255,1); }
#bar-particle button { min-width: 26px; font-size: 12px; }
#bar-particle button.active { background: rgba(60,120,255,0.2); border-color: #3366ff; font-weight: bold; }
#bar-particle select { font-size: 11px; max-width: 160px; }

/* ── Settings Popup (klappt aus bar-particle) ── */
#settings-panel {
    display: none; position: absolute; right: 0;
    width: 260px;
    background: rgba(255,255,255,0.97);
    border: 1px solid #aaa;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    padding: 10px 12px; z-index: 300;
    max-height: 420px; overflow-y: auto;
}
#settings-panel.open { display: block; }
