/* ==========================================================================
   Modern Responsive Video Player & Preview Container
   ========================================================================== */
.video-container {
    position: relative;
    width: 100%;
    max-width: 660px;
    margin: 15px auto 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #0d0e15;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(115, 103, 240, 0.2);
}

.video-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio - never collapses */
    background: #12131c;
    overflow: hidden;
}

/* YouTube IFrame Embed Container */
.video-player-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-player-wrapper iframe,
.video-player-wrapper #player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* Video Preview Overlay (Poster State) */
.video-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.video-preview-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preview-thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.video-preview-overlay:hover .preview-thumb-img {
    transform: scale(1.04);
    filter: brightness(0.9);
}

/* Gradient Shade Over Preview */
.preview-gradient-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.85) 100%);
    z-index: 2;
}

/* Centered YouTube-style Red Play Button */
.preview-play-btn {
    position: relative;
    z-index: 3;
    width: 72px;
    height: 50px;
    background: #ff0000;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.45);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease;
}

.preview-play-btn::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px;
}

.video-preview-overlay:hover .preview-play-btn {
    transform: scale(1.15);
    background: #cc0000;
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.65);
}

/* Video Meta Info Bar on Preview */
.preview-meta-bar {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.preview-video-title {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.preview-payout-badge {
    background: rgba(40, 199, 111, 0.92);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(40, 199, 111, 0.4);
    backdrop-filter: blur(4px);
}

/* Skeleton Loading State inside Video Ratio Box */
.preview-skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #181a26 25%, #222536 50%, #181a26 75%);
    background-size: 200% 100%;
    animation: previewSkeletonPulse 1.5s infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 4;
    color: #8891aa;
    transition: opacity 0.3s ease;
}

@keyframes previewSkeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.preview-skeleton.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Empty / Unavailable State */
.video-empty-state {
    position: absolute;
    inset: 0;
    z-index: 6;
    background: #12131c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

/* ==========================================================================
   Modern Theme Toggle Switch (Matching ViewCash Theme #7367f0)
   ========================================================================== */
.themeButton {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 50px;
    height: 26px;
    padding: 0;
    margin: 0 10px 0 0;
    background: #e5e8f2;
    border: 1.5px solid #d2d6e6;
    border-radius: 20px;
    cursor: pointer;
    outline: none !important;
    vertical-align: middle;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.themeButton:hover,
.themeButton:focus {
    border-color: #7367f0;
    box-shadow: 0 0 0 3px rgba(115, 103, 240, 0.15);
    background: #dde1ee;
}

/* Background Icons in Track */
.themeButton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    pointer-events: none;
    /* Faint Moon icon on the right in light mode */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238891aa'%3E%3Cpath d='M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 13px 13px;
    transition: opacity 0.3s ease, background-image 0.3s ease;
    opacity: 0.7;
}

/* Sliding Knob with Interactive Icon */
.themeButton::before {
    content: '';
    position: absolute;
    top: 1.5px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    /* Sun Icon inside knob in light mode */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f59e0b'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath stroke='%23f59e0b' stroke-width='2' stroke-linecap='round' d='M12 1.5v2m0 17v2M4.58 4.58l1.41 1.41m12.02 12.02l1.41 1.41M1.5 12h2m17 0h2M4.58 19.42l1.41-1.41m12.02-12.02l1.41-1.41'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

/* ==========================================================================
   Dark Mode State (.dark-alt)
   ========================================================================== */
body.dark-alt .themeButton {
    background: #7367f0;
    border-color: #7367f0;
    box-shadow: 0 0 10px rgba(115, 103, 240, 0.45);
}

body.dark-alt .themeButton:hover,
body.dark-alt .themeButton:focus {
    background: #5e50ee;
    border-color: #5e50ee;
    box-shadow: 0 0 14px rgba(115, 103, 240, 0.6);
}

/* In dark mode: Faint Sun icon on the left */
body.dark-alt .themeButton::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffdf7e'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath stroke='%23ffdf7e' stroke-width='2' stroke-linecap='round' d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32l1.41-1.41'/%3E%3C/svg%3E");
    background-position: left 6px center;
    opacity: 0.85;
}

/* Knob moves to the right with Moon Icon */
body.dark-alt .themeButton::before {
    transform: translateX(24px);
    background-color: #1e1e2d;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    /* Lavender Moon Icon inside knob in dark mode */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a5b4fc'%3E%3Cpath d='M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
}