.mtrxf-video-wrapper { position: relative; overflow: hidden; cursor: pointer; transition: all 0.3s ease; width: 100%; display: block; }
.mtrxf-video-thumbnail, .mtrxf-video-iframe-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; margin: 0; padding: 0; }
.mtrxf-thumb-img, .mtrxf-video-iframe-wrapper iframe{ width: 100%; height: 100%; object-fit: cover; /* Default */ border: none; transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;}
.mtrxf-play-button, .mtrxf-play-image { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease; z-index: 2; }
.mtrxf-play-button i { font-size: 30px; transition: all 0.3s ease; }
.mtrxf-play-button-icon { display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; }
.mtrxf-play-button img { width: 100%; height: 100%; object-fit: contain; }

/* Video Default Play Button */
.mtrxf-play-icon{width: 80px;height: 80px;background-color: #00000070;border-style: solid;border-width: 2px 2px 2px 2px;border-color: #FFFFFF;margin: 20px 20px 20px 20px;border-radius: 80px 80px 80px 80px;display: flex; justify-content: center; align-items: center;}
.mtrxf-play-icon i {color: #FFFFFF;font-size: 19px;}

.mtrxf-video-duration { position: absolute; background-color: rgba(0, 0, 0, 0.85); color: #fff; font-size: 12px; font-family: sans-serif; padding: 4px 8px; border-radius: 4px; z-index: 3; pointer-events: none; line-height: 1; display: inline-flex; align-items: center; gap: 5px; }
.mtrxf-video-duration svg { width: 1em; height: 1em; fill: currentColor; }

/* Base Toolbar Styling */
.mtrxf-player-toolbar { display: flex; justify-content: space-between; align-items: center; background: #16161a; padding: 8px 12px; color: #fff; font-family: sans-serif; font-size: 13px; user-select: none; box-sizing: border-box; }

/* Screen Docked Modes */
.mtrxf-player-toolbar.screen-docked { position: fixed; z-index: 100001; }
.mtrxf-player-toolbar.screen-docked.dock-top { top: 0; left: 0; width: 100%; border-bottom: 1px solid #232329; flex-direction: row; }
.mtrxf-player-toolbar.screen-docked.dock-bottom { bottom: 0; left: 0; width: 100%; border-top: 1px solid #232329; flex-direction: row; }
.mtrxf-player-toolbar.screen-docked.dock-left { top: 0; left: 0; height: 100%; border-right: 1px solid #232329; flex-direction: column; padding: 12px 10px; width: auto; }
.mtrxf-player-toolbar.screen-docked.dock-right { top: 0; right: 0; height: 100%; border-left: 1px solid #232329; flex-direction: column; padding: 12px 10px; width: auto; }

/* Video Docked Mode (Small View) */
.mtrxf-player-toolbar.video-docked { position: relative; width: 100%; border-bottom: 1px solid #232329; border-radius: 6px 6px 0 0; }

.mtrxf-player-toolbar.screen-docked.dock-left .mtrxf-toolbar-modes,
.mtrxf-player-toolbar.screen-docked.dock-right .mtrxf-toolbar-modes { flex-direction: column; width: 100%; align-items: stretch; }
.mtrxf-player-toolbar.screen-docked.dock-left .mtrxf-toolbar-btn,
.mtrxf-player-toolbar.screen-docked.dock-right .mtrxf-toolbar-btn { justify-content: center; }

.mtrxf-player-toolbar.screen-docked.dock-left .mtrxf-toolbar-right,
.mtrxf-player-toolbar.screen-docked.dock-right .mtrxf-toolbar-right { flex-direction: column; margin-top: auto; padding-top: 15px; }
.mtrxf-player-toolbar.screen-docked.dock-left .mtrxf-dock-controls,
.mtrxf-player-toolbar.screen-docked.dock-right .mtrxf-dock-controls { flex-direction: column; border-right: none; border-bottom: 1px solid #3f3f46; padding-right: 0; padding-bottom: 10px; margin-right: 0; margin-bottom: 10px; }

.mtrxf-toolbar-modes { display: flex; gap: 8px; align-items: center; }
.mtrxf-toolbar-btn { background: #232329; border: 1px solid #3f3f46; color: #a1a1aa; padding: 6px; font-size: 13px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; transition: all 0.2s ease; }
.mtrxf-toolbar-btn:hover, .mtrxf-toolbar-btn.active { background: #dab875; color: #000; border-color: #dab875; }

.mtrxf-toolbar-right { display: flex; align-items: center; }
.mtrxf-dock-controls { display: flex; gap: 4px; align-items: center; border-right: 1px solid #3f3f46; padding-right: 10px; margin-right: 10px; }
.mtrxf-dock-btn { background: transparent; border: 1px solid transparent; color: #a1a1aa; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; cursor: pointer; font-size: 13px; transition: all 0.2s ease; }
.mtrxf-dock-btn:hover, .mtrxf-dock-btn.active { background: #3f3f46; color: #fff; }
.mtrxf-toolbar-close { font-size: 24px; color: #fff; cursor: pointer; line-height: 1; transition: color 0.2s; padding: 0 4px; }
.mtrxf-toolbar-close:hover { color: #ff4d4d; }

.mtrxf-player-toolbar.is-small-mode { cursor: move; }
.mtrxf-player-toolbar.is-small-mode .mtrxf-dock-controls { display: none !important; }

/* Custom Loading Text & Spinner CSS */
/* =====================================
   PEERTUBE STYLE LOADER
   ===================================== */

.mtrxf-loader-container {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;

    width: 48px !important;
    height: 48px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 100 !important;
    pointer-events: none !important;
}

.mtrxf-spinner {
    width: 44px !important;
    height: 44px !important;

    box-sizing: border-box !important;

    border: 5px solid rgba(255, 255, 255, 0.22) !important;
    border-top-color: #ffffff !important;

    border-radius: 50% !important;

    animation: mtrxf-peertube-spin 0.8s linear infinite !important;
}

.mtrxf-loading-text {
    display: none !important;
}

@keyframes mtrxf-peertube-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}
/* .mtrxf-loading-text { color: #fff; font-family: sans-serif; font-size: 13px; font-weight: 500; letter-spacing: 1px; }
.mtrxf-loading-text span { animation: mtrxf-blink 1.4s infinite both; }
.mtrxf-loading-text span:nth-child(2) { animation-delay: 0.2s; }
.mtrxf-loading-text span:nth-child(3) { animation-delay: 0.4s; }

@keyframes mtrxf-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes mtrxf-blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } } */

.mtrxf-video-wrapper:hover .mtrxf-hover-zoom-in .mtrxf-thumb-img { transform: scale(1.1); }
.mtrxf-video-wrapper:hover .mtrxf-hover-zoom-out .mtrxf-thumb-img { transform: scale(0.9); }
.mtrxf-video-wrapper:hover .mtrxf-hover-fade .mtrxf-thumb-img { opacity: 0.7; }
.mtrxf-video-wrapper:hover .mtrxf-hover-rotate .mtrxf-thumb-img { transform: rotate(5deg); }
/* =====================================
   TIMESTAMP LINK STYLING
   ===================================== */

.mtrxf-inline-description .mtrxf-timestamp {
    color: #222222;
    text-decoration: none;
    font-weight: 600;

    background:#eadda1;

    padding: 2px 6px;
    border-radius: 4px;

    display: inline-block;
    margin: 2px 2px;

    cursor: pointer;

    transition: all 0.2s ease;
}

.mtrxf-inline-description .mtrxf-timestamp:hover {
    background: #dab875;
    color: #000;
}


/* =====================================
   YOUTUBE STYLE TIMELINE MARKERS
   ===================================== */

.mtrxf-timeline-markers {
    position: absolute;

    left: 8px;
    right: 8px;
    bottom: 36px;

    height: 12px;

    pointer-events: none;

    z-index: 50;

    opacity: 0;

    transition: opacity 0.2s ease;
}

.mtrxf-timeline-markers.mtrxf-controls-visible {
    opacity: 1;
    pointer-events: none;
}


/* Individual marker */

.mtrxf-timeline-marker {
    position: absolute;

    top: 50%;

    width: 7px;
    height: 7px;

    padding: 0;
    margin: 0;

    transform: translate(-50%, -50%);

    border: none;
    border-radius: 50%;

    background: #ffffff;

    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 1px 4px rgba(0, 0, 0, 0.6);

    cursor: pointer;

    pointer-events: auto;

    z-index: 51;
}


/* Marker hover */

.mtrxf-timeline-marker:hover {
    width: 11px;
    height: 11px;

    background: #ff0000;

    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.7);
}


/* Inner dot */

.mtrxf-timeline-marker span {
    display: block;

    width: 100%;
    height: 100%;

    border-radius: 50%;
}


/* =====================================
   INLINE VIDEO INFO BUTTON
   ===================================== */

.mtrxf-inline-info-btn {
    position: absolute;

    top: 12px;
    right: 12px;

    width: 25px;
    height: 25px;

    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255,255,255,0.8);

    border-radius: 50%;

    background: rgba(0,0,0,0.65);

    color: #fff;

    cursor: pointer;

    z-index: 20;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.mtrxf-inline-info-btn:hover {
    background: rgba(0,0,0,0.85);

    transform: scale(1.08);
}

.mtrxf-inline-info-btn.active {
    background: rgba(0,0,0,0.9);
}

.mtrxf-inline-info-btn i {
    font-size: 15px;
}


/* =====================================
   INLINE DESCRIPTION
   OUTSIDE ASPECT RATIO
   ===================================== */

.mtrxf-inline-description {
    width: 100%;

    margin: 0;
    padding: 0;

    box-sizing: border-box;

    background: #ffffff;
    color: #111;
}


/* Description content */

.mtrxf-inline-description .mtrxf-video-desc-bottom {
    width: 100%;

    max-height: 180px;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 14px 16px;

    box-sizing: border-box;

    background: #fff;
    color: #111;

    font-size: 14px;
    line-height: 1.6;
}
.mtrxf-video-desc-bottom{
    padding: 14px 16px;

    box-sizing: border-box;

    background: #fff;
    color: #111;

    font-size: 14px;
    line-height: 1.6;
}

/* Description scrollbar */

.mtrxf-inline-description
.mtrxf-video-desc-bottom::-webkit-scrollbar {
    width: 6px;
}

.mtrxf-inline-description
.mtrxf-video-desc-bottom::-webkit-scrollbar-track {
    background: transparent;
}

.mtrxf-inline-description
.mtrxf-video-desc-bottom::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);

    border-radius: 10px;
}

.mtrxf-inline-description
.mtrxf-video-desc-bottom::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}

/* =====================================
   AUTOPLAY VIDEO LOADING
   ===================================== */

.mtrxf-autoplay-wrapper {
    position: relative;
    background: #000 !important;
    overflow: hidden;
}

.mtrxf-autoplay-loader {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.mtrxf-autoplay-loader .mtrxf-spinner {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

.mtrxf-autoplay-loader .mtrxf-loading-text {
    color: #fff !important;
}

/* =====================================
   AUTOPLAY DESCRIPTION
   ===================================== */

.mtrxf-video-wrapper.mtrxf-has-autoplay {
    overflow: visible !important;
}

.mtrxf-autoplay-description {
    width: 100%;
    background: #ffffff;
    color: #101014;
    box-sizing: border-box;
}

.mtrxf-autoplay-description
.mtrxf-video-desc-bottom {
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    box-sizing: border-box;
    background: #ffffff;
    color: #101014;;
    font-size: 14px;
    line-height: 1.6;
}
.mtrxf-inline-info-btn {
    pointer-events: auto !important;
    z-index: 999 !important;
}
.mtrxf-lightbox-overlay {
    background: rgba(0, 0, 0, 0.85); /* Default fallback */
}
/* =====================================
   LIGHTBOX PLAYLIST SIDEBAR STYLING
   ===================================== */
.mtrxf-lightbox-layout {
    display: flex;
    width: 95%;
    max-width: 1400px;
    margin: 40px 50px;
    gap: 20px;
    transition: all 0.4s ease;
}

.mtrxf-lightbox-player-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents overflow issues */
}

.mtrxf-lightbox-playlist-area {
    width: 380px;
    background: #16161a;
    padding: 15px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mtrxf-lightbox-playlist-area::-webkit-scrollbar {
    width: 6px;
}
.mtrxf-lightbox-playlist-area::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}

.mtrxf-playlist-header {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #232329;
    font-family: sans-serif;
}

.mtrxf-playlist-item {
    display: flex;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #232329;
    border: 1px solid transparent;
}

.mtrxf-playlist-item:hover {
    background: #2a2a32;
    border-color: #dab875;
}

.mtrxf-playlist-item.active {
    background: #dab875;
    color: #000;
}

.mtrxf-playlist-item.active .mtrxf-playlist-title {
    color: #000;
}

.mtrxf-playlist-thumb {
    width: 130px;
    height: 73px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.mtrxf-playlist-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mtrxf-playlist-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mtrxf-playlist-title {
    font-size: 14px;
    font-family: sans-serif;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

/* Responsive: Mobile/Tablet par playlist video ke niche chali jayegi */
@media (max-width: 992px) {
    .mtrxf-lightbox-layout {
        flex-direction: column;
        margin: 20px 40px;
    }
    .mtrxf-lightbox-playlist-area {
        width: 100%;
        max-height: 400px;
    }
}