/* ===========================
   KD YouTube Sequencer – Shell
   =========================== */

.kd-yt-sequence-shell {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #020617 100%);
    border-radius: 18px;
    padding: 18px 18px 14px;
    color: #e5e7eb;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.18);
    max-width: 960px;
    margin: 24px auto;
}

/* Header */

.kd-yt-sequence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.kd-yt-sequence-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f9fafb;
}

.kd-yt-sequence-status {
    font-size: 11px;
    color: #9ca3af;
}

/* Hauptlayout: Player links, Programmliste rechts */

.kd-yt-sequence-main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.kd-yt-sequence-left {
    flex: 2 1 380px;
}

/* Player-Wrapper */

.kd-yt-sequence-wrapper {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #020617;
    border: 1px solid rgba(51, 65, 85, 0.9);
    max-width: 100%;
}

.kd-yt-sequence-player {
    width: 100%;
    aspect-ratio: 16 / 9;
}

/* Click-Layer (fängt alle Klicks ab, damit YT-UI nicht sichtbar wird) */

.kd-yt-click-layer {
    position: absolute;
    inset: 0;
    z-index: 7;
    background: transparent;
    cursor: pointer;
}

/* Overlay: Intermission & Unmute-Hinweis */

.kd-yt-sequence-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.1) 0, rgba(0, 0, 0, 0.95) 60%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 8;
}

/* Beim Segmentwechsel → komplett schwarz, Intermission als Bar unten */

.kd-yt-sequence-wrapper.is-fading .kd-yt-sequence-overlay {
    opacity: 1;
    pointer-events: auto;
    background: #000;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 32px;
}

/* Intermission – schlanke Bar unten mittig */

.kd-yt-intermission {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
    font-size: 12px;
}

.kd-yt-sequence-wrapper.is-fading .kd-yt-intermission {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: kdBlinkBar 1.4s ease-in-out infinite;
}

/* Wenn „ready, aber Ton noch aus“ → keine Intermission, nur Unmute-Hinweis */

.kd-yt-sequence-wrapper.is-ready:not(.audio-on) .kd-yt-intermission {
    opacity: 0 !important;
    animation: none !important;
}

/* Punkt in der Bar */

.kd-yt-intermission-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.35);
}

.kd-yt-intermission-text {
    white-space: nowrap;
}

/* Blink-Effekt für die Bar */

@keyframes kdBlinkBar {
    0%, 60% {
        opacity: 1;
    }
    80% {
        opacity: 0.35;
    }
    100% {
        opacity: 1;
    }
}

/* Unmute-Hinweis */

.kd-yt-sequence-unmute-hint {
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    cursor: pointer;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Player ist bereit, aber Audio noch nicht aktiv → Unmute-Hinweis */

.kd-yt-sequence-wrapper.is-ready:not(.audio-on) .kd-yt-sequence-overlay {
    opacity: 1;
    pointer-events: auto;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4), rgba(0, 0, 0, 0.9));
}

.kd-yt-sequence-wrapper.is-ready:not(.audio-on) .kd-yt-sequence-unmute-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Sobald Audio an → Overlay weg */

.kd-yt-sequence-wrapper.audio-on .kd-yt-sequence-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Loading-State */

.kd-yt-sequence-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 9;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.35), rgba(15, 23, 42, 0.95));
}

.kd-yt-sequence-wrapper.is-ready .kd-yt-sequence-loading {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.kd-yt-sequence-spinner {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.4);
    border-top-color: #f97316;
    animation: kd-yt-spin 0.9s linear infinite;
}

.kd-yt-sequence-loading-text {
    font-size: 12px;
    color: #e5e7eb;
    opacity: 0.85;
}

@keyframes kd-yt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Vollbild-Button */

.kd-yt-sequence-fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.kd-yt-sequence-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Dev-Button (nur Admin) */

.kd-yt-dev-controls {
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}

.kd-yt-dev-end {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
}

.kd-yt-dev-end:hover {
    border-style: solid;
    color: #e5e7eb;
}

/* ===========================
   Jetzt / Nächstes – Statusleiste
   =========================== */

.kd-yt-sequence-program {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #ffffff;
    gap: 8px;
    flex-wrap: wrap;
}

.kd-yt-sequence-program .kd-yt-label {
    font-weight: 600;
    margin-right: 4px;
}

/* Live / Replay Indicator */

.kd-yt-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    margin-right: 8px;
}

.kd-live-tv {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fecaca;
}

.kd-live-replay {
    background: rgba(75, 85, 99, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
}

.kd-yt-live-dot,
.kd-yt-replay-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.kd-yt-live-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35);
    animation: kdPulseLive 1.3s ease-out infinite;
}

.kd-yt-replay-dot {
    background: #6b7280;
}

.kd-yt-live-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    font-size: 10px;
}

@keyframes kdPulseLive {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Material-Button */

.kd-yt-material {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
	float:right;
}

.kd-yt-material-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: #0b1120;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.55);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.kd-yt-material-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(34, 197, 94, 0.7);
}

.kd-yt-material-btn.is-disabled {
    background: rgba(55, 65, 81, 0.7);
    color: #9ca3af;
    box-shadow: none;
    cursor: default;
    transform: none;
}

/* ===========================
   Programmliste rechts
   =========================== */

.kd-yt-program-list {
    flex: 1 1 260px;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #020617, #111827);
    color: #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.4);
}

.kd-yt-program-list-title {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.kd-yt-program-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Programmliste – Einträge */

.kd-yt-program-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 999px;
    cursor: default; /* kein Skip, nur Anzeige */
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
    position: relative;
}

.kd-yt-program-item + .kd-yt-program-item {
    margin-top: 4px;
}

.kd-yt-program-item-number {
    font-weight: 600;
    color: #6b7280;
    min-width: 22px;
    text-align: right;
    font-size: 12px;
}

.kd-yt-program-item-title {
    flex: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-size: 13px;
}

/* Hover nur optisch, kein Klick-Skip */

.kd-yt-program-item:hover {
    background: rgba(148, 163, 184, 0.18);
}

/* Aktives Segment */

.kd-yt-program-item.is-active {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    color: #0b1120;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.55);
    transform: translateY(-1px) scale(1.01);
}

.kd-yt-program-item.is-active .kd-yt-program-item-number {
    color: #022c22;
}

/* Ad / Sponsor Block – sehr dezent */

.kd-yt-program-item.is-ad {
    background: rgba(15, 23, 42, 0.9);
    border: 1px dashed rgba(148, 163, 184, 0.45);
    box-shadow: none;
}

/* NEU-Badge mit kurzer Animation beim Wechsel */

.kd-yt-program-item.is-new::after {
    content: "NEU";
    position: absolute;
    right: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f97316;
    color: #111827;
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);
    animation: kdPulseNew 0.9s ease-out 0s 1;
}

@keyframes kdPulseNew {
    0% {
        transform: scale(0.7);
        opacity: 0;
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.5);
    }
    40% {
        transform: scale(1.05);
        opacity: 1;
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0.0);
    }
    100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.0);
    }
}

/* Legende */

.kd-yt-program-legend {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: #9ca3af;
}

.kd-yt-program-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kd-yt-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.kd-yt-legend-dot-talk {
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
}

.kd-yt-legend-dot-ad {
    background: rgba(148, 163, 184, 0.6);
}

/* ===========================
   Werbeblock-Countdown
   =========================== */

.kd-yt-countdown-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(15,23,42,0.7), rgba(15,23,42,0.95));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 11;
}

.kd-yt-countdown-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.kd-yt-countdown-box {
    padding: 14px 22px;
    border-radius: 16px;
    background: rgba(15,23,42,0.95);
    border: 1px solid rgba(248,250,252,0.12);
    box-shadow: 0 16px 40px rgba(15,23,42,0.7);
    text-align: center;
}

.kd-yt-countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #f97316;
    margin-bottom: 4px;
    font-weight: 600;
}

.kd-yt-countdown-timer {
    font-size: 14px;
    color: #e5e7eb;
}

/* ===========================
   Sendeschluss-Screen
   =========================== */

.kd-yt-end-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at bottom, rgba(15,23,42,0.92), rgba(0,0,0,0.98));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 12;
}

.kd-yt-end-screen.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.kd-yt-end-box {
    max-width: 420px;
    padding: 20px 24px;
    border-radius: 18px;
    background: rgba(17,24,39,0.96);
    border: 1px solid rgba(148,163,184,0.35);
    box-shadow: 0 24px 60px rgba(15,23,42,0.9);
    text-align: center;
}

.kd-yt-end-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #f97316;
    margin-bottom: 6px;
    font-weight: 600;
}

.kd-yt-end-title {
    font-size: 18px;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 6px;
}

.kd-yt-end-sub {
    font-size: 13px;
    color: #e5e7eb;
    opacity: 0.9;
    margin-bottom: 12px;
}

.kd-yt-end-restart {
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: #0b1120;
    box-shadow: 0 12px 30px rgba(34,197,94,0.5);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.kd-yt-end-restart:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(34,197,94,0.65);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 640px) {
    .kd-yt-sequence-shell {
        padding: 14px 12px 10px;
        border-radius: 14px;
        margin: 16px auto;
    }

    .kd-yt-sequence-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .kd-yt-sequence-status {
        font-size: 10px;
    }

    .kd-yt-sequence-main-layout {
        flex-direction: column;
    }

    .kd-yt-program-list {
        width: 100%;
    }
}

.elementor-kit-7 a {
    color: black !important;
    font-weight: 600;
    text-decoration: underline;
}