/* =========================================================
 * M2F Single TVShow — Layout
 * ========================================================= */

#single.m2f-tvshow { margin: 0 auto; max-width: 1200px; }
#single.m2f-tvshow .content { padding: 20px 0; }

.m2f-tvshow h1, .m2f-tvshow h2, .m2f-tvshow h3 {
    font-family: inherit;
}

/* ===== Player (top, sticky-ish) ===== */
.m2f-player-wrap {
    background: #0d1117;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
    transition: opacity .2s;
}
.m2f-player-wrap[data-active="0"] .m2f-player-info { opacity: .6; }
.m2f-player-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, #1a1f29 0%, #0d1117 100%);
    color: #fff;
    gap: 12px;
    flex-wrap: wrap;
}
.m2f-player-title { flex: 1; min-width: 200px; }
.m2f-now-playing {
    font-weight: 600;
    font-size: 15px;
}
.m2f-player-nav {
    display: flex;
    gap: 8px;
}
.m2f-nav-btn {
    background: #2a3142;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background .15s;
}
.m2f-nav-btn:hover:not(:disabled) { background: #3b455c; }
.m2f-nav-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.m2f-player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}
.m2f-player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.m2f-player-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 16px;
}

/* ===== Head: Poster + Info ===== */
.m2f-tvhead {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}
.m2f-poster-big img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
    display: block;
}
.m2f-poster-empty {
    aspect-ratio: 2/3;
    background: #2a2f3a;
    color: #777;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.m2f-tvinfo { min-width: 0; }
.m2f-title {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 10px 0;
    font-weight: 700;
}
.m2f-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}
.m2f-tag {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    color: inherit;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 12px;
}
.m2f-tag small { opacity: .7; }
.m2f-tag a { color: inherit !important; text-decoration: none; }
.m2f-genres {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.m2f-genres a {
    background: #4a5568;
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
}
.m2f-genres a:hover { background: #2d3748; }
.m2f-synopsis {
    margin: 16px 0;
    line-height: 1.7;
    font-size: 14.5px;
}
.m2f-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 12px 0 18px 0;
    padding: 10px 14px;
    background: rgba(0,0,0,.06);
    border-radius: 6px;
    font-size: 13px;
}
.m2f-stats b { margin-right: 4px; }
.m2f-tags {
    margin-top: 14px;
    font-size: 12px;
    opacity: .8;
}

/* ===== People (Creator + Cast) ===== */
.m2f-people-block { margin-top: 18px; }
.m2f-people-block h3 {
    font-size: 15px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .9;
}
.m2f-people-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.m2f-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 6px;
    transition: background .15s;
}
.m2f-person:hover { background: rgba(255,255,255,.04); }
.m2f-person img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.m2f-person .m2f-pname {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: inherit !important;
    text-decoration: none;
}
.m2f-person .m2f-pname:hover { text-decoration: underline; }
.m2f-person .m2f-prole {
    display: block;
    font-size: 11px;
    opacity: .7;
}
.m2f-person.m2f-hidden { display: none; }
.m2f-people-block[data-collapsed="0"] .m2f-person.m2f-hidden { display: flex; }

.m2f-view-more-btn {
    margin-top: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    color: inherit;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.m2f-view-more-btn:hover { background: rgba(255,255,255,.06); }

/* ===== Seasons Accordion ===== */
.m2f-seasons-block { margin-top: 24px; }
.m2f-sec-title {
    font-size: 20px;
    margin: 0 0 14px 0;
    font-weight: 700;
}
.m2f-seasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.m2f-season-row {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    overflow: hidden;
}
.m2f-season-head {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.m2f-season-head:hover { background: rgba(255,255,255,.06); }
.m2f-season-row .m2f-caret {
    transition: transform .2s;
    font-size: 12px;
    opacity: .6;
}
.m2f-season-row.open .m2f-caret { transform: rotate(90deg); }
.m2f-season-label {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}
.m2f-season-count {
    font-size: 12px;
    opacity: .65;
    background: rgba(0,0,0,.15);
    padding: 3px 10px;
    border-radius: 12px;
}
.m2f-episodes-list {
    display: none;
    padding: 4px 10px 10px 10px;
    background: rgba(0,0,0,.1);
}
.m2f-season-row.open .m2f-episodes-list { display: block; }
.m2f-ep {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
    font-family: inherit;
    font-size: 13.5px;
}
.m2f-ep:last-child { border-bottom: none; }
.m2f-ep:hover { background: rgba(255,255,255,.08); }
.m2f-ep.m2f-active {
    background: rgba(76, 175, 80, .18);
    border-left: 3px solid #4caf50;
}
.m2f-ep-num {
    background: rgba(255,255,255,.1);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #ddd;
    flex-shrink: 0;
    min-width: 36px;
    text-align: center;
}
.m2f-ep-name { flex: 1; }
.m2f-ep-play {
    opacity: .4;
    font-size: 14px;
    transition: opacity .15s;
}
.m2f-ep:hover .m2f-ep-play { opacity: 1; }
.m2f-ep.m2f-active .m2f-ep-play { opacity: 1; color: #4caf50; }

/* watched mark */
.m2f-ep-status {
    font-size: 11px;
    opacity: 0;
    transition: opacity .15s;
    flex-shrink: 0;
}
.m2f-ep.m2f-watched .m2f-ep-status {
    opacity: 1;
    color: #4caf50;
}
.m2f-ep.m2f-watched .m2f-ep-status::before {
    content: "✓ ดูแล้ว";
    font-weight: 600;
}
.m2f-ep.m2f-watched .m2f-ep-name { opacity: .65; }
.m2f-ep.m2f-watched.m2f-active .m2f-ep-name { opacity: 1; }

.m2f-empty-eps {
    padding: 24px;
    text-align: center;
    opacity: .55;
    font-style: italic;
}

/* ===== Trailer button (ใน detail) ===== */
.m2f-trailer-btn-wrap { margin-top: 14px; }
.m2f-trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s;
    box-shadow: 0 2px 8px rgba(229,62,62,.3);
}
.m2f-trailer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(229,62,62,.45);
}
.m2f-trailer-btn:active { transform: translateY(0); }
.m2f-trailer-btn.m2f-active {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    box-shadow: 0 2px 8px rgba(76,175,80,.3);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .m2f-tvhead {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .m2f-poster-big {
        max-width: 220px;
        margin: 0 auto;
    }
    .m2f-title { font-size: 22px; }
    .m2f-player-info {
        flex-direction: column;
        align-items: stretch;
    }
    .m2f-player-nav { justify-content: space-between; }
    .m2f-nav-btn { flex: 1; }
    .m2f-people-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
