:root {
    --bg-dark: #121212;
    --bg-card: rgba(24, 24, 24, 0.75);
    --bg-card-hover: rgba(40, 40, 40, 0.85);
    --accent-green: #1db954;
    --accent-green-hover: #1ed760;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.backdrop-blur {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(10px) brightness(0.28);
    z-index: -1;
    opacity: 0;
    transition: background-image 0.4s ease, opacity 0.5s ease;
}

.app-container {
    max-width: 1150px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Now Playing Card */
.now-playing-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.now-playing-top {
    display: flex;
    align-items: center;
    gap: 28px;
    width: 100%;
}

.cover-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-green);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.track-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.track-info h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    font-size: 16px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress Bar & Timestamps underneath Art and Title */
.progress-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 14px;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-green);
    border-radius: 3px;
    transition: width 0.3s linear;
}

.time-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Admin Controls */
.admin-interface-card {
    width: 100%;
    margin-bottom: 16px;
    border: 2px solid #ffd700 !important;
    background: rgba(18, 18, 18, 0.88) !important;
    backdrop-filter: blur(14px);
    border-radius: 12px !important;
    padding: 12px 20px !important;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-controls,
.admin-played-config,
.admin-queue-actions {
    border: 2px solid #ffd700 !important;
    background: rgba(0, 0, 0, 0.45) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
    display: flex;
}

.admin-controls {
    margin-bottom: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.admin-top-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-cooldown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.admin-input {
    width: 60px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 13px;
    text-align: center;
}

.hidden {
    display: none !important;
}

.admin-badge {
    font-size: 11px;
    color: #ffd700;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.admin-btn-group {
    display: flex;
    gap: 8px;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--border-color);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: var(--accent-green);
    color: #000;
}

/* Siteload Section & QR Code Card stacking */
.siteload-section {
    position: relative;
    overflow: visible !important;
    z-index: 100 !important;
}

.qr-code-card {
    position: relative;
    z-index: 1 !important;
}

@media (min-width: 901px) {
    .search-overlay-wrapper {
        position: relative;
    }

    .search-suggestions {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: min(66vw, 900px);
        max-height: 480px;
        z-index: 99999;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 20px rgba(255, 215, 0, 0.15);
        background: rgba(18, 18, 18, 0.98);
        border: 1px solid #ffd700;
    }
}

.siteload-section h2 {
    font-size: 16px;
    margin-bottom: 6px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.siteload-form {
    display: flex;
    gap: 10px;
}

.siteload-form input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.siteload-form input:focus {
    border-color: var(--accent-green);
}

.primary-btn {
    background: var(--accent-green);
    color: black;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.primary-btn:hover {
    background: var(--accent-green-hover);
}

.primary-btn:active {
    transform: scale(0.97);
}

.feedback-msg {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
}

.feedback-msg.success {
    color: var(--accent-green);
}

.feedback-msg.error {
    color: #ff5252;
}

/* Search Suggestions */
.search-suggestions {
    margin-top: 14px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search-suggestions.hidden {
    display: none !important;
}

.suggestion-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.suggestion-title {
    grid-column: 1 / -1;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.suggestion-details {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.suggestion-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-status {
    font-size: 11px;
    font-weight: 600;
}

.suggestion-action {
    grid-column: 2;
    align-self: center;
}

.suggestion-add-btn {
    background: rgba(29, 185, 84, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(29, 185, 84, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-add-btn:hover {
    background: var(--accent-green);
    color: #000;
}

/* Queue Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.queue-counter {
    font-size: 13px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
}

.queue-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.queue-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}

.queue-item:hover {
    background: var(--bg-card-hover);
}

.queue-track-meta {
    flex: 1;
    overflow: hidden;
    padding-right: 12px;
}

.queue-track-meta h3 {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.queue-track-meta p {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Voting Buttons Group */
.voting-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.vote-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
    padding: 2px 4px;
}

.vote-btn:hover {
    color: white;
    transform: scale(1.2);
}

.vote-btn.active-up {
    color: var(--accent-green);
}

.vote-btn.active-down {
    color: #ff5252;
}

.vote-score {
    font-size: 14px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
}

.vote-score.positive {
    color: var(--accent-green);
}

.vote-score.negative {
    color: #ff5252;
}

/* Admin queue actions */
.admin-queue-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    margin-left: 10px;
}

.admin-queue-actions .admin-badge {
    font-size: 9px;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.admin-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.admin-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Main Two-Column Layout below Now Playing */
.main-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 6px;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.readd-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.readd-btn.active:hover {
    background: var(--accent-green);
    color: #000;
    border-color: var(--accent-green);
}

.readd-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.1);
}

.user-skip-row {
    margin-top: 14px;
}

.skip-vote-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.skip-vote-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--text-primary);
    transform: translateY(-1px);
}

/* Admin Played Config row inside Played Section */
.admin-played-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.config-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.config-item input {
    width: 60px;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 900px) {
    .now-playing-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .admin-controls {
        flex-direction: column;
        align-items: center;
    }

    .main-columns {
        display: flex;
        flex-direction: column;
        width: 100%;
        box-sizing: border-box;
        gap: 24px;
    }

    .right-column {
        display: contents;
    }

    .siteload-section {
        order: -1;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .left-column {
        order: 1;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .qr-code-card {
        order: -1;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;

    }

    .search-overlay-wrapper {
        position: static;
    }

    .search-suggestions {
        position: static;
        width: 100%;
        max-height: 320px;
        box-shadow: none;
        border: 1px solid var(--border-color);
        z-index: auto;
    }

    .track-info h1,
    .track-info p {
        white-space: normal;
    }
}

.vote-btn.voted-up,
.vote-btn.voted-down {
    color: #4caf50 !important;
    font-weight: 900;
    transform: scale(1.25);
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.in-page-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #ffb703;
    color: #121212;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 10000;
    cursor: pointer;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
}

.in-page-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Voting Disabled Overlay */
.voting-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 24px;
}

.voting-disabled-overlay.hidden {
    display: none !important;
}

.overlay-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 77, 77, 0.4);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.overlay-card h2 {
    color: #ff4d4d;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.overlay-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Siteload Dropdown & Suggestion Buttons */
.siteload-dropdown-btn {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.siteload-dropdown-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

.suggestion-add-btn.primary-local-btn {
    background: var(--accent-green);
    color: #000;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 8px;
}

.suggestion-add-btn.primary-local-btn:hover {
    background: #50e3c2;
    transform: translateY(-1px);
}

/* ==========================================================================
   TV MODUS (Breitbildoptimiert, ohne Suche/Player, 10 Songs & QR, klares Overlay)
   ========================================================================== */
body.tv-mode .siteload-section,
body.tv-mode .played-section,
body.tv-mode #admin-clear-queue-btn,
body.tv-mode #admin-interface-card,
body.tv-mode #admin-controls-header,
body.tv-mode #admin-skip-config,
body.tv-mode .vote-controls .vote-btn,
body.tv-mode .admin-queue-actions,
body.tv-mode .skip-vote-btn {
    display: none !important;
}

body.tv-mode {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
}

body.tv-mode .now-playing-card {
    display: flex !important;
    margin-bottom: 16px !important;
    flex-shrink: 0 !important;
    padding: 16px 24px !important;
}

body.tv-mode .now-playing-top {
    gap: 24px !important;
    align-items: center !important;
}

body.tv-mode .cover-wrapper {
    width: 140px !important;
    height: 140px !important;
    flex-shrink: 0 !important;
}

body.tv-mode #now-playing-title {
    font-size: 2.1rem !important;
    margin-bottom: 6px !important;
}

body.tv-mode #now-playing-artist {
    font-size: 1.25rem !important;
}

body.tv-mode .backdrop-blur {
    filter: blur(8px) brightness(0.52) !important;
}

body.tv-mode .glass-card {
    background: rgba(18, 18, 18, 0.40) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
}

body.tv-mode .app-container {
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 24px 36px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.tv-mode .main-columns {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 36px !important;
    align-items: stretch !important;
    margin-top: 0 !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

body.tv-mode .queue-section {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

body.tv-mode .queue-section h2 {
    font-size: 1.8rem !important;
    margin-bottom: 12px !important;
    color: var(--accent) !important;
    flex-shrink: 0 !important;
}

body.tv-mode #queue-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    overflow-y: hidden !important;
    flex: 1 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.tv-mode .queue-item {
    padding: 12px 20px !important;
    margin-bottom: 0 !important;
    border-radius: 12px !important;
    flex: 1 !important;
    max-height: 75px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

body.tv-mode .queue-track-meta {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    flex: 1 !important;
}

body.tv-mode .queue-track-meta h3 {
    font-size: 1.35rem !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-mode .queue-track-meta p {
    font-size: 1.1rem !important;
    color: #ccc !important;
    margin: 3px 0 0 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.tv-mode .vote-controls {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    padding: 0 12px !important;
    flex-shrink: 0 !important;
}

body.tv-mode .qr-code-card {
    padding: 1.5rem !important;
    border-radius: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.tv-mode .qr-code-card h3 {
    font-size: 1.45rem !important;
    margin-bottom: 6px !important;
}

body.tv-mode .qr-code-card p {
    font-size: 1.05rem !important;
    line-height: 1.35 !important;
    margin-bottom: 12px !important;
    text-align: center !important;
}

body.tv-mode #qr-code-container {
    padding: 12px !important;
    min-width: 210px !important;
    min-height: 210px !important;
    max-width: 330px !important;
    max-height: 330px !important;
}

body.tv-mode #qr-code-link {
    font-size: 1.15rem !important;
    margin-top: 10px !important;
}

body.tv-mode .tv-controls-floating {
    display: flex !important;
    position: fixed !important;
    bottom: 18px !important;
    right: 18px !important;
    gap: 12px !important;
    z-index: 1000 !important;
}

body.tv-mode .exit-tv-btn {
    display: inline-block !important;
    position: static !important;
    background: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    padding: 8px 16px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    border: 1px solid var(--border-color) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer !important;
}

body.tv-mode .exit-tv-btn:hover {
    background: rgba(29, 185, 84, 0.8) !important;
    transform: translateY(-2px);
}

@media (max-width: 1000px) {
    body.tv-mode .main-columns {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
}