/*
Theme Name: DooPlay Child
Theme URI: https://doothemes.com/items/dooplay/
Description: DooPlay Child Theme
Author: Doothemes
Author URI: https://doothemes.com/
Template: dooplay
Version: 2.7
*/

@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Noto+Sans+Thai&display=swap');

body {
    font-family: 'Noto Sans Thai', sans-serif !important;
}



/* User Requested Layout Adjustments */
/* Adjusted Layout: Centered Container */
body.home #contenedor,
body.home .module,
body.home .content,
body.home .container,
body.home .adt {
    max-width: 1200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Add padding only to the inner grid wrapper so edges aren't touching screen */
.custom-movie-grid {
    padding: 0 10px;
}

/* Custom Movie Grid Styles */
.custom-movie-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    /* Negative margin for wider spacing */
    justify-content: flex-start;
    /* Align left */
}

.movie-box-item {
    width: 25%;
    /* 4 items per row (User request) */
    padding: 10px;
    box-sizing: border-box;
}

@media (max-width: 1600px) {
    .movie-box-item {
        width: 25%;
    }

    /* Keep 4 items */
}

@media (max-width: 1024px) {
    .movie-box-item {
        width: 25%;
    }

    /* Force 4 items on Tablet */
}

@media (max-width: 768px) {
    .movie-box-item {
        width: 25%;
    }

    /* Force 4 items on Mobile Landscape */
}

@media (max-width: 480px) {
    .movie-box-item {
        width: 50%;
    }

    /* Keep 2 items on very small vertical phones for readability */
}

/* User Provided Box Style + Adjustments */
.movie-box {
    position: relative;
    width: 100%;
    /* Remove fixed height to allow aspect ratio */
    height: auto;
    background: rgb(36, 36, 36);
    margin: 0px;
    padding: 0;
    border: 1px solid rgb(68, 68, 68);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.movie-box:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    border-color: #007aff;
    transform: translateY(-4px);
    z-index: 5;
}

.movie-box-poster {
    width: 100%;
    height: 0;
    /* 150% = 2:3 Aspect Ratio (Vertical Poster) */
    padding-bottom: 150%;
    background-size: 100% 100%;
    /* Force Full Image Fit */
    background-position: center top;
    position: relative;
}

/* Badges */
.movie-quality-badge {
    position: absolute;
    top: 12px;
    right: -30px;
    background: #FF0000;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 30px;
    transform: rotate(45deg);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    width: 90px;
    text-align: center;
}

.movie-rating-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

.movie-box-content {
    background: rgb(36, 36, 36);
    padding: 8px 5px;
    text-align: center;
    min-height: 55px;
    /* Ensure consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #333;
}

.movie-title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}

.movie-title a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.2s;
}

.movie-title a:hover {
    color: #007aff;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-box:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}

/* Pagination Styles
 * NOTE: parent theme's front.mobile.min.css contains:
 *   .pagination, footer.main, header.main { display: none }
 * which hides pagination on phones. We override with !important below.
 */
.pagination {
    display: block !important;
    margin: 40px 0;
    text-align: center;
    width: 100%;
    padding: 0 8px;
    box-sizing: border-box;
}

.pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex !important;
    flex-wrap: wrap; /* allow buttons to wrap on small screens */
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span.current,
.pagination span.dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    background: #242424;
    border: 1px solid #444;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.pagination span.dots {
    background: transparent;
    border-color: transparent;
    cursor: default;
    padding: 0 6px;
    min-width: 24px;
}

.pagination a:hover {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
}

.pagination span.current {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
}

.pagination i {
    font-size: 12px;
}

/* Tablet & smaller */
@media (max-width: 768px) {
    .pagination ul {
        gap: 6px;
    }
    .pagination a,
    .pagination span.current {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}

/* Phones: collapse Prev/Next labels to icons only and tighten spacing */
@media (max-width: 480px) {
    .pagination {
        margin: 24px 0;
    }
    .pagination ul {
        gap: 4px;
    }
    .pagination a,
    .pagination span.current {
        min-width: 34px;
        height: 34px;
        padding: 0 8px;
        font-size: 12px;
    }
    /* Hide the "Prev" / "Next" word — keep only the arrow icons */
    .pagination .pag-label {
        display: none;
    }
    .pagination span.dots {
        height: 34px;
        min-width: 18px;
        padding: 0 2px;
    }
}
/* === BEGIN m2f-custom-archives badges (auto-generated) === */
/* ใช้กับ /top-movie/ และ /imdb/ */

.m2f-rank-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffcc00;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 10;
}

.m2f-views-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}

@media (max-width: 480px) {
    .m2f-rank-badge {
        font-size: 11px;
        padding: 2px 6px;
        bottom: 6px;
        left: 6px;
    }
    .m2f-views-badge {
        font-size: 10px;
        padding: 2px 6px;
        bottom: 6px;
        right: 6px;
    }
}
/* === END m2f-custom-archives badges === */

/* === BEGIN m2f-pagination-override === */
/* DooPlay parent has .current{color:#408bea} which clashes with our blue button bg.
 * Force white text + boost specificity. */
.pagination span.page-numbers.current,
.pagination .page-numbers.current,
.pagination li span.current {
    color: #ffffff !important;
    background: #007aff !important;
    border-color: #007aff !important;
}
/* === END m2f-pagination-override === */


/* === BEGIN m2f-cast-section v3 === */
/* Override DooPlay parent's #single .sbox border + .person padding/border */

/* 1) เอา border-bottom ของ #cast.sbox (DooPlay parent: #single .content .sbox{border-bottom:solid 3px}) */
#single .content .sbox.m2f-cast-section,
.m2f-cast-section {
    border-bottom: 0 !important;
    background: transparent !important;
    padding: 20px 40px !important;
    float: left !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 2) Toggle button */
.m2f-cast-section .m2f-cast-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(0,122,255,0.15), rgba(0,122,255,0.08));
    color: #4ea3ff !important;
    border: 1px solid rgba(0, 122, 255, 0.4) !important;
    border-radius: 24px !important;
    padding: 10px 22px !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px -4px rgba(0, 122, 255, 0.3);
}

.m2f-cast-section .m2f-cast-toggle:hover {
    background: linear-gradient(135deg, rgba(0,122,255,0.3), rgba(0,122,255,0.18)) !important;
    color: #fff !important;
    border-color: rgba(0, 122, 255, 0.7) !important;
    box-shadow: 0 6px 18px -4px rgba(0, 122, 255, 0.5);
    transform: translateY(-1px);
}

.m2f-cast-section .m2f-cast-toggle:active {
    transform: scale(0.98);
}

.m2f-cast-section .m2f-cast-toggle i {
    font-size: 13px;
    transition: transform 0.25s ease;
}

.m2f-cast-section .m2f-cast-toggle .m2f-cast-chevron {
    margin-left: 4px;
}

.m2f-cast-section .m2f-cast-toggle[aria-expanded="true"] .m2f-cast-chevron {
    transform: rotate(180deg);
}

/* 3) Panel (collapsed by default via [hidden] HTML attribute) */
.m2f-cast-section .m2f-cast-panel {
    margin-top: 20px;
    padding: 20px 22px;
    background: rgba(20, 20, 22, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    animation: m2f-cast-fade 0.25s ease-out;
}

.m2f-cast-section .m2f-cast-panel[hidden] {
    display: none !important;
}

@keyframes m2f-cast-fade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 4) Section heading inside panel */
.m2f-cast-section .m2f-cast-heading {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #fff !important;
    margin: 0 0 14px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    float: none !important;
    width: 100% !important;
    line-height: 1.3 !important;
}

.m2f-cast-section .m2f-cast-heading + .m2f-persons-grid {
    margin-bottom: 22px;
}

.m2f-cast-section .m2f-cast-heading:not(:first-child) {
    margin-top: 6px !important;
}

/* 5) Grid of persons (override DooPlay's .person layout completely) */
.m2f-cast-section .m2f-persons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
}

/* 6) Person card — RESET DooPlay .person styles */
.m2f-cast-section .m2f-persons-grid .person,
.m2f-cast-section .m2f-persons-grid .m2f-person {
    /* Reset DooPlay parent rules */
    position: relative !important;
    padding: 0 !important;
    padding-left: 0 !important;
    min-height: 0 !important;
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    border-bottom: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;

    /* Our card style */
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.m2f-cast-section .m2f-persons-grid .person:hover,
.m2f-cast-section .m2f-persons-grid .m2f-person:hover {
    border-color: rgba(0, 122, 255, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px -10px rgba(0, 122, 255, 0.4);
}

/* 7) Photo — RESET DooPlay's absolute positioning */
.m2f-cast-section .m2f-persons-grid .person .img,
.m2f-cast-section .m2f-persons-grid .m2f-person .img {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #111;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    float: none !important;
    border-radius: 0 !important;
}

.m2f-cast-section .m2f-persons-grid .person .img a,
.m2f-cast-section .m2f-persons-grid .m2f-person .img a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.m2f-cast-section .m2f-persons-grid .person .img img,
.m2f-cast-section .m2f-persons-grid .m2f-person .img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease;
}

.m2f-cast-section .m2f-persons-grid .person:hover .img img,
.m2f-cast-section .m2f-persons-grid .m2f-person:hover .img img {
    transform: scale(1.05);
}

/* 8) Name + role */
.m2f-cast-section .m2f-persons-grid .person .data,
.m2f-cast-section .m2f-persons-grid .m2f-person .data {
    padding: 10px 12px 12px !important;
    background: transparent !important;
    border: 0 !important;
    margin: 0 !important;
    float: none !important;
    width: 100% !important;
    box-sizing: border-box;
    flex: 1;
    text-align: left;
}

.m2f-cast-section .m2f-persons-grid .person .data .name,
.m2f-cast-section .m2f-persons-grid .m2f-person .data .name {
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1.35 !important;
    margin: 0 0 4px !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
}

.m2f-cast-section .m2f-persons-grid .person .data .name a,
.m2f-cast-section .m2f-persons-grid .m2f-person .data .name a {
    color: #f0f0f0 !important;
    text-decoration: none !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

.m2f-cast-section .m2f-persons-grid .person .data .name a:hover,
.m2f-cast-section .m2f-persons-grid .m2f-person .data .name a:hover {
    color: #4ea3ff !important;
}

.m2f-cast-section .m2f-persons-grid .person .data .caracter,
.m2f-cast-section .m2f-persons-grid .m2f-person .data .caracter {
    font-size: 11.5px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 300 !important;
    line-height: 1.35 !important;
    float: none !important;
    width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
}

/* 9) Responsive */
@media (max-width: 1024px) {
    .m2f-cast-section .m2f-persons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    #single .content .sbox.m2f-cast-section,
    .m2f-cast-section { padding: 16px 14px !important; }
    .m2f-cast-section .m2f-cast-panel { padding: 14px 12px; }
    .m2f-cast-section .m2f-persons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .m2f-cast-section .m2f-cast-toggle {
        font-size: 13px;
        padding: 8px 18px !important;
    }
    .m2f-cast-section .m2f-persons-grid .person .data,
    .m2f-cast-section .m2f-persons-grid .m2f-person .data {
        padding: 8px 10px 10px !important;
    }
}
/* === END m2f-cast-section v3 === */
