/* ========== MAIN PLAYER + SKIN FRAME ========== */

/* Wraps frame + skin */
.mmsyh-player-area {
    position: relative;
    display: block;
    max-width: 100%;
}

/* Main player frame with 16:9 ratio by default */
.mmsyh-player-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    overflow: hidden;
    z-index: 2; /* above the skin frame */
}

/* 16:9 box */
.mmsyh-player-frame::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16 / 9 * 100 */
}

/* When a portrait video is active, use a tall box */
.mmsyh-wrapper.mmsyh-orient-portrait .mmsyh-player-frame::before {
    padding-top: 177.78%; /* 9 / 16 * 100 */
}

.mmsyh-player-frame iframe.mmsyh-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 2;
}

/* Skin overlay: frame AROUND the player, behind the iframe */
.mmsyh-skin-overlay {
    position: absolute;
    top: -44px;
    left: -44px;
    right: -44px;
    bottom: -44px;

    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;  /* keeps your PNG fully visible */

    pointer-events: none;      /* never block player controls */
    z-index: 1;                /* behind the video */
}

/* ========== PLAYER CONTROLS (PREV / NEXT) ========== */

.mmsyh-player-controls {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.mmsyh-player-controls .button {
    font-size: 13px;
    line-height: 1.4;
    padding: 4px 10px;
}

/* ========== PLAYLIST LIST / GRID ========== */

.mmsyh-list-area {
    margin-top: 1rem;
}

/* Wrapper for each video item */
.mmsyh-video-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Inner layout: thumbnail + text */
.mmsyh-video-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Thumbnail wrapper */
.mmsyh-video-thumb-wrap {
    flex: 0 0 96px;
    max-width: 96px;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}

/* Thumbnail image itself */
.mmsyh-video-thumb {
    display: block;
    width: 100%;
    height: auto;
}

/* Text area */
.mmsyh-video-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.mmsyh-video-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 2px;
}

.mmsyh-video-url {
    font-size: 11px;
    color: #777;
    word-break: break-all;
}

/* Hover + active */
.mmsyh-video-item:hover {
    background-color: #f7f7f7;
}

.mmsyh-video-item.is-active {
    background-color: #e9f3ff;
    box-shadow: inset 2px 0 0 #2271b1;
}

/* ========== GRID VARIANT ========== */

.mmsyh-list-area.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.mmsyh-list-area.layout-grid .mmsyh-video-item {
    border: 1px solid #eee;
    border-radius: 6px;
}

/* In grid mode, let the item breathe more */
.mmsyh-list-area.layout-grid .mmsyh-video-item {
    padding: 0.75rem;
}

/* On really narrow screens, shrink the thumb a bit */
@media (max-width: 480px) {
    .mmsyh-video-thumb-wrap {
        flex-basis: 72px;
        max-width: 72px;
    }
}
