:root {
    --mv-primary-color: #e50914;
    /* Netflix Red vibe */
    --mv-glass-bg: rgba(20, 20, 20, 0.6);
    --mv-glass-border: rgba(255, 255, 255, 0.1);
    --mv-text-color: #ffffff;
    --mv-accent-color: #00d2ff;
}

.monagas-player-container {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    /* Use theme font */
    color: white;
}

.mv-player-wrapper {
    position: relative;
    width: 100%;
    /* Max width removed to allow full container fill */
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mv-player-wrapper.glassware {
    background: radial-gradient(circle at center, #1a1a1a, #000);
    border: 1px solid var(--mv-glass-border);
}

/* Header */
.mv-player-wrapper header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    pointer-events: none;
    /* Let clicks pass through */
}

.mv-channel-logo {
    height: 50px;
    /* Adjusted for embedding */
    width: auto;
    object-fit: contain;
    pointer-events: auto;
}

/* Video */
.mv-video-container {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mv-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure video isn't cropped */
}

/* Controls */
.mv-controls {
    position: absolute;
    bottom: 20px;
    /* Lifted slightly */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    padding: 12px 20px;
    border-radius: 16px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 30;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mv-controls.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

/* Buttons */
.mv-btn-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s;
}

.mv-btn-icon:hover {
    opacity: 1;
    color: var(--mv-accent-color);
    transform: scale(1.1);
}

.mv-btn-text {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.mv-btn-text:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Volume Slider */
.mv-volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

#mv-volumeSlider {
    width: 80px;
    accent-color: var(--mv-accent-color);
    cursor: pointer;
}

/* Live Badge */
.mv-live-badge {
    background-color: #cc0000;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mv-live-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
}

.mv-spacer {
    flex-grow: 1;
}

/* Quality Menu */
.mv-quality-container {
    position: relative;
}

.mv-quality-menu {
    position: absolute;
    bottom: 120%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    min-width: 100px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.mv-quality-menu.hidden {
    display: none;
}

.mv-quality-option {
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #aaa;
    transition: 0.2s;
    text-align: left;
}

.mv-quality-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.mv-quality-option.active {
    color: var(--mv-accent-color);
    font-weight: bold;
}

/* Loading */
.mv-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mv-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.mv-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--mv-accent-color);
    border-radius: 50%;
    animation: mv-spin 1s linear infinite;
}

@keyframes mv-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer (Overlay inside plugin optional) */
.mv-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 5px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 15;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .mv-controls {
        width: 95%;
        padding: 10px;
        gap: 10px;
    }

    #mv-volumeSlider {
        display: none;
        /* Auto hide volume slider on mobile */
    }

    .mv-channel-logo {
        height: 35px;
    }

    .mv-live-badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
}