/**
 * Meldo Playlist Player – CSS
 * @since 3.81.06
 */

/* ===========================================
   CONTAINER
   =========================================== */

/* Reset to prevent theme (BuddyBoss etc.) overrides */
.mnw-pp,
.mnw-pp *,
.mnw-pp *::before,
.mnw-pp *::after {
    box-sizing: border-box;
}
.mnw-pp button {
    font-family: inherit;
    line-height: 1;
}
.mnw-pp svg {
    max-width: none !important;
    max-height: none !important;
}

.mnw-pp {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    font-family: var(--mnwd-schrift-text), 'Segoe UI', sans-serif;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* ===========================================
   VIEWPORT (16:9)
   =========================================== */

.mnw-pp-viewport {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #000;
}

.mnw-pp-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
    overflow: hidden;
}

.mnw-pp-canvas img {
    pointer-events: none;
    user-select: none;
}

.mnw-pp-overlays {
    position: absolute;
    top: 0; left: 0;
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
    pointer-events: none;
    z-index: 10;
}

.mnw-pp-transition {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
}

/* Loading */
.mnw-pp-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 30;
    transition: opacity 0.3s;
}
.mnw-pp-loading.hidden {
    opacity: 0;
    pointer-events: none;
}
.mnw-pp-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--mnwd-akzent);
    border-radius: 50%;
    animation: mnw-pp-spin 0.8s linear infinite;
}
@keyframes mnw-pp-spin {
    to { transform: rotate(360deg); }
}

/* ===========================================
   CONTROLS
   =========================================== */

.mnw-pp-controls {
    background: #222;
    padding: 0;
}

.mnw-pp-controls-row {
    display: flex;
    align-items: center;
}

/* Progress bar */
.mnw-pp-progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: #333;
    cursor: pointer;
    transition: height 0.15s;
}
.mnw-pp-progress:hover {
    height: 10px;
}
.mnw-pp-progress-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--mnwd-akzent), var(--mnwd-akzent2));
    border-radius: 0 3px 3px 0;
    transition: width 0.15s linear;
    z-index: 2;
}
.mnw-pp-progress-scenes {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}
.mnw-pp-progress-scene-marker {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

/* Main controls */
.mnw-pp-controls-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    gap: 12px;
}

.mnw-pp-controls-left,
.mnw-pp-controls-center,
.mnw-pp-controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
.mnw-pp-controls-center {
    flex: 1;
    justify-content: center;
}

/* Buttons */
.mnw-pp-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important; height: 36px !important;
    min-width: 36px !important;
    border: none !important;
    background: transparent !important;
    color: var(--mnwd-linie-stark) !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}
.mnw-pp-btn:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #fff !important;
}
.mnw-pp-btn svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
}
.mnw-pp-icon-play.mnw-pp-hidden,
.mnw-pp-icon-pause.mnw-pp-hidden {
    display: none !important;
}
.mnw-pp-btn-play {
    width: 44px !important; height: 44px !important;
    min-width: 44px !important;
    background: var(--mnwd-akzent) !important;
    color: #fff !important;
    border-radius: 50% !important;
}
.mnw-pp-btn-play:hover {
    background: var(--mnwd-akzent-l32-0) !important;
    color: #fff !important;
}
.mnw-pp-btn-play svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}
.mnw-pp-btn-play svg polygon,
.mnw-pp-btn-play svg rect {
    fill: currentColor !important;
}

/* Speed button */
.mnw-pp-btn-speed {
    width: auto !important;
    min-width: 32px !important;
    padding: 0 6px !important;
    font-family: var(--mnwd-schrift-titel);
    font-size: 12px;
    font-weight: 700;
}
.mnw-pp-speed-label {
    color: inherit;
    white-space: nowrap;
}

/* Scene info */
.mnw-pp-scene-info {
    font-size: 13px;
    color: var(--mnwd-schwach);
    font-family: var(--mnwd-schrift-titel);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* ===========================================
   OVERLAY ANIMATIONS
   =========================================== */

/* ===========================================
   SUBTITLES
   =========================================== */

.mnw-pp-subtitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
}
.mnw-pp-subtitle.mnw-pp-subtitle-visible {
    opacity: 1;
}
.mnw-pp-subtitle span {
    display: inline-block;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: var(--mnwd-schrift-text);
    font-size: 18px;
    line-height: 1.5;
    padding: 10px 24px;
    max-width: 90%;
    letter-spacing: 0.3px;
}

/* Active button state (subtitles on) */
.mnw-pp-btn.mnw-pp-btn-active {
    background: var(--mnwd-akzent-a2) !important;
    color: var(--mnwd-akzent) !important;
}
.mnw-pp-btn.mnw-pp-btn-active:hover {
    background: var(--mnwd-akzent-a3) !important;
}

@media (max-width: 600px) {
    .mnw-pp-subtitle span {
        font-size: 14px;
        padding: 6px 14px;
    }
}

/* ===========================================
   TASK HINT TOAST
   =========================================== */

.mnw-pp-task-hint {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(17, 20, 22, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 50;
    max-width: 420px;
    width: max-content;
    animation: mnw-pp-hint-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    pointer-events: none;
}
.mnw-pp-task-hint-out {
    animation: mnw-pp-hint-out 0.3s ease both !important;
}
.mnw-pp-task-hint-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.mnw-pp-task-hint-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mnw-pp-task-hint-text strong {
    font-family: var(--mnwd-schrift-titel);
    font-size: 14px;
    font-weight: 700;
    color: var(--mnwd-akzent2);
}
.mnw-pp-task-hint-text span {
    font-family: var(--mnwd-schrift-text);
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    line-height: 1.4;
}
@keyframes mnw-pp-hint-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes mnw-pp-hint-out {
    from { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    to   { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(0.95); }
}

/* ===========================================
   TASK FRAME (preloaded iframe)
   =========================================== */

.mnw-pp-task-frame {
    display: none;
    width: 100%;
    background: #FAF8F3;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    position: relative;
}
.mnw-pp-task-frame.mnw-pp-task-active {
    display: block;
    aspect-ratio: 16 / 9;
}
.mnw-pp-task-frame iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    transition: opacity 0.2s ease;
}
.mnw-pp-task-loader {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAF8F3;
    z-index: 2;
}

/* ===========================================
   SCENE SIDEBAR
   =========================================== */

.mnw-pp-sidebar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 25;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.08);
}
.mnw-pp-sidebar.mnw-pp-sidebar-open {
    transform: translateX(0);
}
.mnw-pp-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.mnw-pp-sidebar-header span {
    font-family: var(--mnwd-schrift-titel);
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
}
.mnw-pp-sidebar-close {
    width: 28px !important; height: 28px !important;
    min-width: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: rgba(255,255,255,0.06) !important;
    color: var(--mnwd-schwach) !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: background 0.15s, color 0.15s;
}
.mnw-pp-sidebar-close:hover {
    background: rgba(255,255,255,0.12) !important;
    color: #fff !important;
}
.mnw-pp-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.mnw-pp-sidebar-list::-webkit-scrollbar { width: 4px; }
.mnw-pp-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.mnw-pp-sidebar-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.mnw-pp-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    position: relative;
}
.mnw-pp-sidebar-item:hover {
    background: rgba(255,255,255,0.05);
}
.mnw-pp-sidebar-item.mnw-pp-sidebar-active {
    background: var(--mnwd-akzent-a12);
    border-left-color: var(--mnwd-akzent);
}
.mnw-pp-sidebar-item-num {
    width: 24px; height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    font-family: var(--mnwd-schrift-titel);
    flex-shrink: 0;
}
.mnw-pp-sidebar-active .mnw-pp-sidebar-item-num {
    background: var(--mnwd-akzent);
    color: #fff;
}
.mnw-pp-sidebar-item-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.mnw-pp-sidebar-item-title {
    flex: 1;
    font-size: 12px;
    color: var(--mnwd-linie-stark);
    font-family: var(--mnwd-schrift-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.mnw-pp-sidebar-active .mnw-pp-sidebar-item-title {
    color: #fff;
    font-weight: 600;
}

/* Groups */
.mnw-pp-sidebar-group {
    margin: 2px 0;
}
.mnw-pp-sidebar-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}
.mnw-pp-sidebar-group-header:hover {
    background: rgba(255,255,255,0.05);
}
.mnw-pp-group-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
    opacity: 0.5;
}
.mnw-pp-sidebar-group:not(.mnw-pp-group-collapsed) .mnw-pp-group-chevron {
    transform: rotate(90deg);
}
.mnw-pp-group-name {
    flex: 1;
    font-family: var(--mnwd-schrift-titel);
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mnw-pp-group-has-active .mnw-pp-group-name {
    color: var(--mnwd-akzent);
}
.mnw-pp-group-count {
    flex-shrink: 0;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--mnwd-schrift-titel);
}
.mnw-pp-sidebar-group-items {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    max-height: 2000px;
    opacity: 1;
}
.mnw-pp-group-collapsed .mnw-pp-sidebar-group-items {
    max-height: 0;
    opacity: 0;
}
.mnw-pp-sidebar-item-grouped {
    padding-left: 28px !important;
}

/* Task scene items */
.mnw-pp-sidebar-task {
    border-left: 3px solid var(--mnwd-warnung) !important;
    background: rgba(255, 152, 0, 0.06);
}
.mnw-pp-sidebar-task .mnw-pp-sidebar-item-num {
    background: rgba(255, 152, 0, 0.15);
    color: var(--mnwd-warnung);
}
.mnw-pp-sidebar-task.mnw-pp-sidebar-active {
    background: rgba(255, 152, 0, 0.12);
    border-left-color: var(--mnwd-warnung) !important;
}
.mnw-pp-sidebar-task.mnw-pp-sidebar-active .mnw-pp-sidebar-item-num {
    background: #FF9800;
    color: #fff;
}

@media (max-width: 600px) {
    .mnw-pp-sidebar {
        width: 100%;
    }
}

/* ===========================================
   OVERLAY ANIMATIONS
   =========================================== */

.mnw-pp-ol {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

/* v3.81.70: Animations ONLY animate opacity - never touch transform (preserves inline position/scale/rotation) */
.mnw-pp-ol-fadeIn  { animation: mnw-pp-fadeIn 0.4s ease backwards; }
.mnw-pp-ol-fadeOut { animation: mnw-pp-fadeOut 0.3s ease both; }
@keyframes mnw-pp-fadeIn  { from { opacity: 0; } }
@keyframes mnw-pp-fadeOut { to { opacity: 0; } }

.mnw-pp-ol-slideUp   { animation: mnw-pp-fadeIn 0.4s ease backwards; }
.mnw-pp-ol-slideDown { animation: mnw-pp-fadeIn 0.4s ease backwards; }
.mnw-pp-ol-slideLeft { animation: mnw-pp-fadeIn 0.4s ease backwards; }
.mnw-pp-ol-slideRight { animation: mnw-pp-fadeIn 0.4s ease backwards; }
.mnw-pp-ol-scaleIn  { animation: mnw-pp-fadeIn 0.35s ease backwards; }
.mnw-pp-ol-pop { animation: mnw-pp-fadeIn 0.4s cubic-bezier(0.34,1.56,0.64,1) backwards; }

/* Typewriter handled in JS */

/* ===========================================
   SCENE TRANSITIONS
   =========================================== */

.mnw-pp-trans-fade {
    animation: mnw-pp-trans-fade 0.5s ease both;
}
@keyframes mnw-pp-trans-fade {
    0%   { opacity: 1; }
    45%  { opacity: 0; }
    55%  { opacity: 0; }
    100% { opacity: 1; }
}

.mnw-pp-trans-slide-left  { animation: mnw-pp-slide-l 0.5s ease both; }
.mnw-pp-trans-slide-right { animation: mnw-pp-slide-r 0.5s ease both; }
.mnw-pp-trans-slide-up    { animation: mnw-pp-slide-u 0.5s ease both; }
.mnw-pp-trans-slide-down  { animation: mnw-pp-slide-d 0.5s ease both; }

@keyframes mnw-pp-slide-l {
    0%   { transform: translateX(0); opacity: 1; }
    45%  { transform: translateX(-100%); opacity: 0; }
    55%  { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes mnw-pp-slide-r {
    0%   { transform: translateX(0); opacity: 1; }
    45%  { transform: translateX(100%); opacity: 0; }
    55%  { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
@keyframes mnw-pp-slide-u {
    0%   { transform: translateY(0); opacity: 1; }
    45%  { transform: translateY(-100%); opacity: 0; }
    55%  { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes mnw-pp-slide-d {
    0%   { transform: translateY(0); opacity: 1; }
    45%  { transform: translateY(100%); opacity: 0; }
    55%  { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.mnw-pp-trans-zoom-in  { animation: mnw-pp-zoom-in 0.5s ease both; }
.mnw-pp-trans-zoom-out { animation: mnw-pp-zoom-out 0.5s ease both; }
@keyframes mnw-pp-zoom-in {
    0%   { transform: scale(1); opacity: 1; }
    45%  { transform: scale(1.3); opacity: 0; }
    55%  { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes mnw-pp-zoom-out {
    0%   { transform: scale(1); opacity: 1; }
    45%  { transform: scale(0.7); opacity: 0; }
    55%  { transform: scale(1.3); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ===========================================
   FULLSCREEN
   =========================================== */

.mnw-pp.mnw-pp-fullscreen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0;
    z-index: 999999;
    background: #000;
    display: flex;
    flex-direction: column;
}
.mnw-pp.mnw-pp-fullscreen .mnw-pp-viewport {
    flex: 1;
    padding-bottom: 0;
}
.mnw-pp.mnw-pp-fullscreen .mnw-pp-canvas,
.mnw-pp.mnw-pp-fullscreen .mnw-pp-overlays {
    /* Scale computed by JS */
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 600px) {
    .mnw-pp {
        border-radius: 10px;
    }
    .mnw-pp-controls-main {
        padding: 4px 6px;
        gap: 2px;
    }
    .mnw-pp-btn {
        width: 30px !important; height: 30px !important;
        min-width: 30px !important;
    }
    .mnw-pp-btn svg {
        width: 16px !important; height: 16px !important;
        min-width: 16px !important; min-height: 16px !important;
    }
    .mnw-pp-btn-play {
        width: 36px !important; height: 36px !important;
        min-width: 36px !important;
    }
    .mnw-pp-btn-play svg {
        width: 18px !important; height: 18px !important;
    }
    .mnw-pp-controls-center {
        display: none !important;
    }
    .mnw-pp-controls-left,
    .mnw-pp-controls-right {
        gap: 1px;
    }
    .mnw-pp-speed-label {
        font-size: 10px !important;
    }
}

@media (max-width: 400px) {
    .mnw-pp-controls-main {
        padding: 3px 4px;
        gap: 1px;
    }
    .mnw-pp-btn {
        width: 28px !important; height: 28px !important;
        min-width: 28px !important;
    }
    .mnw-pp-btn svg {
        width: 14px !important; height: 14px !important;
        min-width: 14px !important; min-height: 14px !important;
    }
    .mnw-pp-btn-play {
        width: 32px !important; height: 32px !important;
        min-width: 32px !important;
    }
}
