:root {
    /*header*/
    --background: #222;
    --font-color: #fff;
    --font-hover: #ededed;
    --border: #444;
    --background-hover: #333;
    /*footer*/
    --foot-color: #ccc;
    --dev: #686868;
    /*NAV*/
    --nav-bg: #111, #222, #333, #111;
    --nav-shadow: 0, 0, 0;
    --nav-li: #333;
    --nav-font: #f49e09;
    --nav-after: #666;
    --nav-active: #010101;
    /*h1*/
    --h1-bg: #707070, #000000;
}
body {
  background-image: url('../images/pattern/inspiration-geometry.png');
  background-color: #000;
  background-repeat: repeat;
  color: var(--font-color);
  overflow-x: hidden;
}

a {
  color: var(--nav-font);
  text-decoration: none;
}
.container {
  max-width: 100vw;
  margin: 0 auto;
  padding: 0;
  background-image: url('../images/pattern/classy-fabric.png');
  background-repeat: repeat;
  background-color: var(--background);
  
}
.movie-grid {
    display: grid;
    gap: 12px;
    padding: 0px 0.5em;
    grid-template-columns: repeat(2, 1fr); /* Default: 2 cols */
}

.pure-g {
  letter-spacing: 0 !important;
}

@media (min-width: 768px) {
    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .movie-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1920px) {
    .movie-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* HEADER & MENU */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 998;
    display: none;
    transition: opacity 0.3s ease;
    opacity: 1;
    pointer-events: none;
  }
  
  body.menu-open .menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: all;
  }
  
  body.menu-open {
    overflow: hidden;
  }

.site-header {
    background-color: var(--background);
    background-image: url('../images/pattern/cross-stripes.png');
    background-repeat: repeat;
    padding: 0;
    border-bottom: 2px solid var(--border);
    margin: 0 auto;
    min-height: 100%;
  }
  
  .top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: relative;
  }
  
  .logo-area img {
    max-height: 75px;
    height: auto;
    display: block;
  }
  .search-area {
    flex: 1 1 40%;
    text-align: right;
    max-width: 30%;
  }
  .search-area input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    color: var(--font-color);
    background: var(--background);
    border-radius: 4px 0 0 4px;
    
  }
  .search-area button[type="submit"] {
    padding: 6px 10px;
    color: var(--border);
    background: var(--font-color);
    border: 1px solid var(--border) !important;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
  }
  
  .menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--font-color);
    font-size: 20px;
    position: absolute;
    left: 16px;
    top: 14px;
  }

  /*** FOOTER ***/
  .footer-links {
    margin-top: 1rem;
    font-size: 0.9rem;
  }
  
  .footer-links a {
    color: var(--foot-color);
    text-decoration: none;
    margin: 0 0.25rem;
  }
  
  .footer-links a:hover {
    text-decoration: none;
    color: var(--font-color);
  }

  .dev {
    color: var(--dev);
    margin: 1em;
  }

  
  /*** NAV MENU ***/
  .main-nav {
    margin: 0;
    background: linear-gradient(-45deg, var(--nav-bg));
    background-size: 300% 300%;
    animation: navMonoFlow 12s ease infinite;
    box-shadow: 0 0 10px rgba(var(--nav-shadow), 0.3);
    position: relative;
    z-index: 10;
  }
  
  @keyframes navMonoFlow {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }
    
  .main-nav ul.menu {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    justify-content: center;
  }
  .main-nav ul.menu li {
    position: relative;
  }
  .main-nav ul.menu li a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--font-color);
    text-decoration: none;
    font-size: 18px;
    transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
    position: relative;
  }
  
  .main-nav ul.menu li a:hover {
    background-color: var(--nav-li);
    color: var(--nav-font);
    transform: translateY(-2px);
  }

  .main-nav ul.menu li a i {
    margin-right: 6px;
    width: 18px;
    text-align: center;
    transition: color 0.3s ease;
  }
  
  .main-nav ul.menu li a:hover i {
    color: var(--nav-font);
  }
  
  .main-nav ul.menu li a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 16px;
    width: 0%;
    height: 2px;
    background: var(--nav-after);
    transition: width 0.3s ease;
  }
  
  .main-nav ul.menu li a:hover::after {
    width: calc(100% - 32px);
  }
  
  /*
  .has-dropdown:hover .submenu {
    display: block;
  }
    */
  .submenu {
    display: none;
    position: absolute;
    background: var(--background);
    top: 100%;
    left: 0;
    min-width: 280px;
    z-index: 10;
    padding: 6px 0;
    list-style: none; /* ❌ ลบจุดนำหน้า */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
  }
/* ✅ เงื่อนไขให้แสดงเมื่อมี class .open */
.submenu.open {
  display: block;
}

/* ✅ เมนูเลือกปี: layout เฉพาะตอนแสดงเท่านั้น */
.year-submenu.open {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--background);
}

/* ปรับรายการให้ดูแน่นขึ้นนิด */
.year-submenu li a {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 14px;
}

/* มือถือ: 1 คอลัมน์ */
@media (max-width: 480px) {
  .year-submenu.open {
    grid-template-columns: repeat(2, 1fr);
  }
}
  
  .submenu li {
    list-style: none; /* ❌ ป้องกันจุดใน <li> ด้วย */
  }
  
  .submenu li a {
    padding: 10px 16px;
    display: block;
    color: var(--font-color);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
  }
  
  .submenu li a:hover {
    background-color: var(--nav-li);
    color: var(--font-color); /* หรือจะเปลี่ยนเป็นสีอื่นตามธีมก็ได้ */
  }

  .has-dropdown {
    position: relative;
  }
  
  /*
  .has-dropdown:hover .submenu {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
  }
  */

  .children {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  
  .children li {
    padding-left: 0;
    margin-left: 20px;
  }
  
  .children li a {
    padding-left: 12px; /* เล็กน้อยพอเป็นสัดส่วน */
    display: block;
    color: var(--font-color);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.3s ease;
  }

  .children li a::before {
    content: "\f105"; /* fa-angle-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--font-color);
    font-size: 11px;
  }
  
  .children li a:hover {
    background: var(--nav-li);
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Responsive */
  @media (max-width: 1024px) {
    .top-bar {
      flex-direction: column;
      align-items: stretch;
      padding: 10px;
    }
    .logo-area {
        text-align: center;
        margin: 20px;
      }
    .logo-area img {
        max-height: 50px;
        height: auto;
        display: inline-block;
      }
    .search-area {
      max-width: 100%;
      flex: 1 1 100%;
      text-align: center;
      margin-bottom: 8px;
    }
    .search-area {
      order: 2;
    }
    .menu-toggle {
      display: block;
    }
    .menu-toggle i {
        transition: transform 0.3s ease, opacity 0.3s ease;
        font-size: 20px;
      }
      .menu-toggle i.fa-xmark {
        transform: rotate(90deg);
      }
    /* ซ่อนเมนูไว้ก่อน */
    .main-nav {
        position: fixed;
        top: 0px;
        left: -260px;
        width: 260px;
        height: 100vh;
        background: var(--background);
        z-index: 999;
        overflow-y: auto;
        transition: left 0.3s ease;
        padding-top: 30px; /* เว้นจากบนไว้เผื่อโลโก้/แถบบาร์ */
    }
    
    /* เมื่อคลาส .open ถูกเพิ่มเข้ามา */
    .main-nav.open {
        left: 0;
    }
    
    /* ปรับ ul ให้แสดงแนวตั้ง */
    .main-nav ul.menu {
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        margin: 0;
    }
    
    .main-nav ul.menu li {
        width: 100%;
    }
    
    .main-nav ul.menu li a {
        width: 100%;
        padding: 12px 20px;
        color: var(--font-color);
        text-decoration: none;
        display: block;
        transition: background 0.2s ease;
    }
    
    .main-nav ul.menu li a:hover {
        background: var(--nav-li);
    }
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--font-color);
        font-size: 22px;
        z-index: 1000;
        position: absolute;
        top: 12px;
        left: 16px;
      }
  }
/*------------*/

/**** FOOTER ****/
.site-footer {
  background-color: var(--background);
  color: var(--foot-color);
  text-align: center;
  padding: 15px;
  font-size: 0.9rem;
  margin: 0 auto;
  min-height: 100%;
}

.site-footer a {
  color: var(--font-color);
  text-decoration: none;
  font-weight: bold;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer p {
  margin: 0.5rem 0;
}

@media (max-width: 600px) {
  .site-footer {
    font-size: 0.8rem;
    padding: 1.5rem 1rem;
  }
}

/**************/

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--font-color);
  margin: 1em 0em;
  padding: 0.3em 1em;
  background: linear-gradient(90deg, var(--h1-bg)); /* เปลี่ยนได้ */
  flex-grow: 1;
  border-left: 6px solid var(--font-color);
  box-shadow: 0 4px 4px rgba(var(--nav-shadow),0.5);
}

.single-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--font-color);
  margin: 0.5em 0 0.5em 0;
  padding: 0.3em 1em;
  background: linear-gradient(90deg, var(--h1-bg)); /* เปลี่ยนได้ */
  display: inline-block;
  border-left: 6px solid var(--font-color);
  box-shadow: 0 4px 4px rgba(var(--nav-shadow),0.5);
}

/* กล่องหนัง */
.movie-box {
    overflow: hidden;
    background: var(--background);
    /*border: 1px solid var(--border);*/
    border: 1px solid #2b2b2b;
    border-radius: 6px;
}

/* ปกหนัง */
.movie-link {
  color:#000;
}
.thumb-wrap {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--background);
    border-radius: 6px;
    margin: 0px;
}

.thumb-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: 2em;
  color: #ccc;
  pointer-events: none;
}

.thumb-wrap picture,
.thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease; /* ✅ ใส่ transition */
}

/* ✅ ตอน hover: ซูมออก (scale down) */
.thumb-wrap:hover picture,
.thumb-wrap:hover img {
    transform: scale(1.05);
    filter: contrast(110%) saturate(1.1);
    transition: transform 0.3s ease, filter 0.3s ease;
}


/* ชื่อเรื่อง */
.movie-title {
    font-size: 14px;
    color: var(--font-color);
    padding: 10px;
    margin: 0;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    text-align: center;
}

/* TOP LEFT */
.overlay-top-left {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.badge-score,
.badge-new,
.badge-hot {
    background: rgba(0,0,0,0.75);
    color: var(--font-color);
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
}

/* NEW / HOT */
.badge-new {
    background-color: #2979ff;
}
.badge-hot {
    background-color: #ff3d00;
}

/* TOP RIGHT */
.overlay-top-right {
    position: absolute;
    top: 6px;
    right: 6px;
}
.badge-voice {
    background: rgba(0,0,0,0.7);
    color: var(--font-color);
    font-size: 14px;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.soundthai {
  color: #17f389;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.9);
}

/* BOTTOM LEFT */
.overlay-bottom-left {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0,0,0,0.6);
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 4px;
    color: var(--font-color);
    display: flex;
    gap: 8px;
}

/* BOTTOM RIGHT */
.overlay-bottom-right {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 4px;
    color: var(--font-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* SERIES INFO (multi-line bottom-right) */
.overlay-series-info {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--font-color);
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
    max-width: 65%;
}
.overlay-series-info div {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}
.status-finished {
    color: #00e676;
}
.status-ongoing {
    color: #ff9100;
}

.text-green {
    color: #00e676;
}
.text-yellow {
    color: #fdd835;
}
.text-red {
    color: #ef5350;
}

.overlay-title-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: var(--font-color);
    padding: 8px 12px;
    font-size: 14px;
    text-align: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    border-radius: 4px;
    max-width: 99%;
    min-width: 90%;
    line-height: 1.4;
    white-space: normal;
}

/* แสดงตอน hover */
.thumb-wrap:hover .overlay-title-center {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
    z-index: 1000;
}

/** Load more (pagination) **/
#load-more {
    display: block;
    margin: 30px auto;
    padding: 10px 20px;
    font-size: 14px;
    background: var(--background);
    color: var(--font-color);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
  }
  #load-more:hover {
    background: var(--background-hover);
  }

  #load-more.loading {
    opacity: 0.5;
    pointer-events: none;
  }

/*** FILTER ***/
.page-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 0 0 0.5em;
}


.filter-buttons  {
  margin: 0.5em;
  display: flex;
  gap: 0.5em;
  flex-shrink: 0;
  justify-content: flex-end;
}

.filter-buttons a{
  margin-left: 0;
}

/*** BUTTON **/
.button-success,
.button-error,
.button-warning,
.button-secondary {
    color: var(--font-color);
    border-radius: 4px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.button-success {
    background: rgb(28, 184, 65);
    /* this is a green */
}

.button-error {
    background: rgb(202, 60, 60);
    /* this is a maroon */
}

.button-warning {
    background: rgb(223, 117, 20);
    /* this is an orange */
}

.button-secondary {
    background: rgb(66, 184, 221);
    /* this is a light blue */
}

/**** Single movie ****/

.single-content-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.single-movie {
  padding: 0;
  color: var(--font-color);
  width: 100%;
  box-sizing: border-box;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 1em;
}

.movie-info {
  background-color: #000;
  padding: 0.5em;
  border-radius: 0px;
  overflow: hidden;
}

.movie-info > * {
  position: relative;
  z-index: 1;
}

.movie-tabs {
  background: rgba(0, 0, 0, 0.7);
}

.tab-header {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1em;
  flex-wrap: wrap;
}

.tab-header button {
  padding: 0.5em 1em;
  background: var(--background);
  color: var(--font-color);
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.tab-header button:hover {
  background: var(--background-hover);
}

.tab-header button.active {
  border-bottom: 3px solid var(--font-color);
  background: var(--nav-active);
  font-weight: bold;
}

.tab-content {
  display: none;
  padding: 15px;
}

.tab-content.active {
  display: block;
}

.movie-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
  align-items: flex-start;
}

.poster-column img {
  width: 240px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(var(--nav-shadow).3);
}

.info-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  /*gap: 1em;*/
}

.share-buttons button,
.dislike-button {
  margin-right: 0.5em;
  padding: 0.4em 0.8em;
  border: none;
  background: var(--nav-after);
  color: var(--font-color);
  cursor: pointer;
  border-radius: 4px;
}

.view-dislike {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin: 1em 0;
  flex-wrap: wrap;
}

.view-count {
  color: var(--font-color);
  font-size: 1rem;
}

.button-group {
  display: flex;
  gap: 0.5em;
}

.like-button,
.dislike-button {
  background-color: var(--border);
  border: none;
  color: var(--font-color);
  padding: 0.4em 0.8em;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.like-button:hover {
  background-color: #28a745; /* เขียว */
}

.dislike-button:hover {
  background-color: #dc3545; /* แดง */
}

.like-button i,
.dislike-button i {
  margin-right: 5px;
}

.vote-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.vote-btn {
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--font-color);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
  transition: transform 0.1s ease;
}

.vote-btn:active {
  transform: scale(1.1);
}

.vote-btn.voted {
  background: rgb(202, 60, 60);
  color: var(--font-color);
  border-color: rgb(224, 12, 16);
}

.vote-percent {
  font-size: 0.9rem;
  color: var(--foot-color);
}

.view-count {
  margin-right: 1em;
  display: inline-block;
}

.movie-description {
  line-height: 1.6;
  font-size: 1rem;
}

.movie-meta-list {
  list-style: none;
  padding-left: 0;
  margin: 1em 0;
}

.movie-meta-list li {
  padding: 0.3em 0;
  font-size: 0.95rem;
  color: var(--font-color);
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.movie-meta-list li i {
  color: #ffc107; /* สีเหลืองทอง IMDb */
  min-width: 1.2em;
  text-align: center;
}

.taxonomy-info, .actors-info {
  font-size: 1rem;
  line-height: 1.5;
}

.trailer-container {
  text-align: center;
}

#load-trailer {
  padding: 0.6em 1.2em;
  background: var(--background-hover);
  color: var(--font-color);
  border: 2px solid var(--border);
  cursor: pointer;
  font-weight: bold;
  border-radius: 4px;
}

#trailer-iframe iframe {
  margin-top: 1em;
  max-width: 100%;
}

.similar-movies h2 {
  margin: 0.5em 0 0 0.5em;
  border-left: 6px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  padding-left: 0.6em;
  font-size: 1.4rem;
  color: var(--font-color);
}

@media screen and (max-width: 768px) {
  .movie-columns {
    flex-direction: column;
    align-items: center;
  }

  .poster-column img {
    width: 100%;
    max-width: 300px;
  }

  .tab-header {
    flex-direction: column;
  }

  .footer-links {
    font-size: 0.7rem;
  }
}

a.category-tag,
a.tag-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4em 0.7em;
  margin: 0.2em;
  border-radius: 4px;
  color: var(--font-color);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.3s ease;
}

a.category-tag {
  background-color: var(--background);
}
a.category-tag:hover {
  background-color: var(--background-hover);
}

a.tag-tag {
  background-color: var(--background);
}
a.tag-tag:hover {
  background-color: var(--background-hover);
}

.actor-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--background);
  color: var(--font-color);
  padding: 0.4em 0.8em;
  margin: 0.2em;
  border-radius: 4px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.actor-tag:hover {
  background-color: var(--background-hover);
}

.actors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.actor-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--font-color);
  width: 100px;
}

.actor-box img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-bottom: 0.5rem;
}

.actor-box span {
  font-size: 0.85rem;
  text-align: center;
}


.trailer-wrapper iframe {
  max-width: 100%;
  max-height: 720px;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.movie-player {
  padding: 0 0.5em 0 0.5em;
}

.video-embed-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background-color: #000; /* กันเวลายังไม่มีวิดีโอ */
  border-radius: 8px; /* ขอบมน */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* เงานุ่มๆ */
  margin-top: 1rem;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px; /* ขอบ iframe มนด้วย */
}

.related-section {
  margin-top: 1rem;
}
.related-section .section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  margin-left: 0.5rem;
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  margin-left: 0.5rem;
}

/**** SHARE BTN ***/
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.share-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 0.8em;
  border-radius: 4px;
  color: var(--font-color);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.3s;
}

.share-line { background: #00c300; }
.share-facebook { background: #1877f2; }
.share-telegram { background: #0088cc; }
.share-instagram { background: #e1306c; }
.share-twitter { background: #1da1f2; }
.share-copy { background: #666; }

.share-buttons i {
  margin-right: 0.4em;
}

/*** TAGS ***/
.tag-group {
  display: block;
  width: 100%;
  border-bottom: 1px solid var(--border);
  margin: 0 0.5em;
}

.tag-letter {
  font-size: 1.4rem;
  width: 100%;
  margin: 2rem 0 1rem;
  color: var(--font-color);
  padding-left: 8px;
  border-left: 4px solid var(--border);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 10px 0 0px;
  margin: 0 0 30px;
}

.tag-list li {
  display: flex;
  align-items: center;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.95rem;
  color: var(--font-color);
  white-space: nowrap;
  max-width: 100%;
  transition: background 0.2s;
}

.tag-list li::before {
  content: "\f02b"; /* Unicode ของ fa-tag */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 0.5em;
  color: var(--font-color);
}

.tag-list li a {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.tag-list li:hover {
  background: var(--background-hover);
}



@media (max-width: 600px) {
  .tag-list {
      flex-direction: column;
      gap: 6px;
  }

  .tag-list li {
      width: 100%;
  }
}



/**** Single Series *****/


.single-series {
  padding: 0em;
  color: var(--font-color);
  width: 100%;
  box-sizing: border-box;
}

.series-info {
  background-color: #000;
  padding: 0.5em;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}

.season-tab-header {
  display: flex;
  gap: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.season-tab-header button {
  background: var(--background);
  color: var(--font-color);
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  font-weight: bold;
}
.season-tab-header button.active {
  background: var(--nav-active);
}

.season-tab-content {
  display: none;
}
.season-tab-content.active {
  display: block;
}

.ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1em;
}

.ep-box {
  flex: 0 0 auto;
  width: 160px;
  background: var(--background);
  color: var(--font-color);
  text-align: center;
  font-size: 0.9rem;
  border-radius: 0 0 4px 4px;
}

/* แสดง 2 คอลัมน์บนจอเล็ก */
@media (max-width: 600px) {
  .ep-box {
    width: calc(50% - 0.5rem); /* 2 คอลัมน์ พร้อมเว้นช่องห่าง */
  }
}

.ep-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.ep-title {
  padding: 0.5rem;
  font-weight: bold;
  border-radius: 0 0 4px 4px;
  background: var(--background);
}

.thumb-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 4px 4px 0 0; /* ถ้ามีขอบมน */
}


.thumb-wrapper img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  cursor:pointer;
  transition: transform 0.3s ease;
}

.thumb-wrapper:hover img {
  transform: scale(1.05); /* ขยาย 5% */
  filter: contrast(120%) brightness(1.1) saturate(1.1);
  transition: transform 0.3s ease, filter 0.3s ease;
}


.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events:none;
  cursor:pointer;
}

.thumb-wrapper:hover .play-overlay {
  opacity: 1;
}

.ep-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.85);
}

.ep-modal-content {
  background-color: #111;
  margin: 5% auto;
  padding: 0;
  border: none;
  width: 90%;
  max-width: 800px;
  border-radius: 0;
  position: relative;
  box-shadow: 0 0 40px #000;
}

.ep-modal-close {
  color: var(--font-color);
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1;
}

.ep-modal-body {
  padding: 0;
}

.ep-embed-wrap iframe {
  width: 100%;
  height: 450px;
  border: none;
  display: block;
}

.thumb-wrapper.watched img {
  filter: grayscale(100%);
  opacity: 0.8;
  transition: filter 0.3s, opacity 0.3s;
}

.thumb-wrapper.watched:hover img {
  filter: none;
  opacity: 1;
}

.watched-badge {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: #e1306c;
  color: var(--font-color);
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.watched-badge i {
  font-size: 0.85rem;
}

/*** 404 ****/
.not-found-container {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.not-found-container h1 {
  color: var(--font-color);
  margin-bottom: 1rem;
}

.not-found-container p {
  color: var(--foot-color);
}

.not-found-container a.pure-button {
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--nav-li);
  border: none;
  color: var(--font-color);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.not-found-container a.pure-button:hover {
  background: var(--nav-after);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.glitch {
  position: relative;
  display: inline-block;
  font-size: 12rem;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  font-family: 'Orbitron', monospace; /* ใช้ฟอนต์แนวดิจิทัลจะเนียน */
  text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 
               0.025em 0.04em 0 #fffc00;
  animation: glitch 750ms infinite;
}

.glitch span {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  color: #fff;
}

.glitch span:first-child {
  animation: glitch 500ms infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  opacity: 0.75;
}

.glitch span:last-child {
  animation: glitch 375ms infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.04em, 0.03em);
  opacity: 0.75;
}

@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
      0.025em 0.04em 0 #fffc00;
  }
  15% {
    text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff,
      0.025em 0.04em 0 #fffc00;
  }
  16% {
    text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
      -0.05em -0.05em 0 #fffc00;
  }
  49% {
    text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.035em 0 #fc00ff,
      -0.05em -0.05em 0 #fffc00;
  }
  50% {
    text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
      0 -0.04em 0 #fffc00;
  }
  99% {
    text-shadow: 0.05em 0.035em 0 #00fffc, 0.03em 0 0 #fc00ff,
      0 -0.04em 0 #fffc00;
  }
  100% {
    text-shadow: -0.05em 0 0 #00fffc, -0.025em -0.04em 0 #fc00ff,
      -0.04em -0.025em 0 #fffc00;
  }
}

/***** LAGAL PAGE *****/
.legal-wrapper {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -47vw;
  margin-right: -50vw;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1;
}

.legal-page {
  width: 100%;
  
  max-width: 800px;
  background: var(--background);
  padding: 2rem;
  color: var(--font-color);
  line-height: 1.8;
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
  color: var(--font-color);
  margin-bottom: 1rem;
}

.legal-page h1 {
  font-size: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-page h1::before {
  content: "📄";
  font-size: 1.5rem;
}

.legal-page h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  border-left: 4px solid var(--border);
  padding-left: 0.5rem;
}

.legal-page p {
  margin: 1rem 0;
}

.legal-page hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.legal-page .last-updated {
  text-align: right;
  font-size: 0.85rem;
  color: var(--foot-color);
  margin-top: 3rem;
}

/**** DMCA FORM ****/
#dmca-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#dmca-form label {
  font-weight: bold;
  color: var(--foot-color);
}

#dmca-form input,
#dmca-form textarea {
  padding: 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--font-color);
  font-size: 1rem;
  border-radius: 4px;
}

#dmca-form button {
  padding: 0.75rem 1.5rem;
  background: var(--nav-li);
  color: var(--font-color);
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 1;
}

.success {
  background-color: #1e4620;
  color: #b2f2bb;
  border-left: 5px solid #2ecc71;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 6px;
  font-size: 1rem;
  position: relative;
  animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/****** SLIDER ******/
.top10-slider {
  position: relative;
  width: 100%;
}


.top10-slider .swiper {
  width: 100%; /* ชดเชย padding ของ container */
  position: relative;
  width: 100vw; /* เต็มจอ */
  margin: 0;
  overflow: hidden;
  border-radius: 0; /* เผื่อธีมมี border-radius */
}

.swiper-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  transition-property: transform;
  box-sizing: content-box;
}

.swiper-slide {
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
}

.top10-card.full-slide {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 0em;
  display: flex;
  align-items: center;
  height: 550px;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
  background-color:rgba(0,0,0,0.8);
  overflow: hidden;
}

.top10-card.full-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 40%, rgba(0,0,0,1.1) 100%);
  pointer-events: none;
}


.top10-slide-inner {
  display: flex;
  gap: 3em;
  align-items: center;
  z-index: 1;
  /*padding:0 20px 0 0;*/
  margin: 0 auto;
  max-width: 60%;
}
.poster-area {
  position: relative;
}
.poster-area img {
  height: 250px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.poster-area img:hover {
  transform: scale(1.05); /* ขยาย 5% */
  filter: contrast(120%) brightness(1.1) saturate(1.1);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.info-area {
  flex: 1;
  padding-top: 0;
}

.entry-title {
  padding: 0 !important;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.description {
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.play-button {
  background: #f00;
  padding: 0.5em 1.5em;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s;
}

.play-button:hover {
  background: #c00;
}

.rank-badge.large {
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  font-size: 2rem;
  background: rgba(255, 0, 0, 0.6);
  padding: 0.3em 0.7em;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.swiper-pagination {
  position: absolute;
  bottom: 20px; /* ระยะจากล่างขึ้นบน ปรับตามใจ */
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.swiper-pagination-bullet {
  width: 16px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: all 0.3s ease;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  width: 32px;
  background-color: #ffffff !important;
}

@media (min-width: 1920px) {

}

@media (min-width: 1024px) {
  .top10-slider .swiper {
    width: 100vw;
    position: relative;
    margin-left: 0;
    margin-right: 0;
  }
  .poster-area img {
    height: 450px;
  }
  .rank-badge.large {
    font-size: 1.5rem;
  }
  .description {
    font-size: 20px;
  }
  .entry-title {
    font-size: 2rem;
  }

  .top10-slide-inner {
    gap: 1.5em;
  }
}

@media screen and (max-width: 768px) {
  .top10-slide-inner {
    display: flex;
    gap: 0.5em;
    align-items: center;
    z-index: 1;
    /*padding:0 20px 0 0;*/
    margin: 0 auto;
    max-width: 100%;
  }
  .top10-card.full-slide {
    height: 300px;
  }
  .poster-area img {
    margin-left: 10px;
  }
  .rank-badge.large {
    font-size: 1.5rem;
  }
  .description {
    font-size: 12px;
  }
  .entry-title {
    font-size: 1.2rem;
  }
  .rank-badge.large {
    top: 0;
    left: 10px;
  }
}
/* กล่องหัวหน้า page: บังคับเรียงลงล่าง ไม่ปะปนกับ list */
.actor-page-header{
  display:flex;
  flex-direction:column;
  gap:.55rem;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px;
  position: relative;
  z-index: 5;
  width: 100%;
}

/* กัน CSS เดิมของธีมที่ชอบ float title */
.actor-page-header .page-title{
  margin: 0;
  float: none !important;
  width: 100%;
  display: block;
}

/* nav ต้องเป็น block เต็มบรรทัด ไม่ไปแทรกกับ title */
.actor-page-header nav{
  float: none !important;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* main ต้องเริ่มหลัง header เสมอ */
.actorlist-page,
.actorlist-page > ul,
.actor-list {
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 10px;
  gap: 10px 14px;
}
/* li ต้องไม่กำหนดความกว้างเอง */
.actor-list li,
.actor-item {
  width: auto !important;
  max-width: none !important;
  float: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
}

/* กัน CSS เดิมที่ชอบบังคับ 50% */
.actor-list li[class*="pure"],
.actor-list li[class*="span"],
.actor-list li[class*="col"] {
  width: auto !important;
  flex: unset !important;
}
.actor-mode-nav{
  display:flex; flex-wrap:wrap; gap:.4rem;
  margin:.75rem 0 .75rem;
}
.actor-mode-nav .mode-item{
  padding:.35rem .65rem;
  border:1px solid rgba(255,255,255,.15);
  border-radius:8px;
  text-decoration:none;
}
.actor-mode-nav .mode-item.is-active{ font-weight:700; }

.actor-az-nav{
  display:flex; flex-wrap:wrap; gap:.35rem;
  margin:.25rem 0 1rem;
}
.actor-az-nav .az-item{
  padding:.25rem .55rem;
  border:1px solid rgba(255,255,255,.15);
  border-radius:6px;
  text-decoration:none;
}
.actor-az-nav .az-item.is-active{ font-weight:700; }

.actor-az-subtitle{ opacity:.85; margin-bottom:1rem; }

.actor-list.az-mode{
  list-style:none; padding:0; margin:0;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:.5rem 1rem;
}
.actor-item{ display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.actor-link{ display:flex; align-items:center; gap:.5rem; text-decoration:none; min-width: 0; }
.actor-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.actor-thumb-small{ width:36px; height:36px; border-radius:6px; object-fit:cover; }
.actor-count{ opacity:.8; flex:0 0 auto; }

.unlock-pagination ul{
  list-style:none; display:flex; gap:.4rem; padding:0; margin:1rem 0 0; flex-wrap:wrap;
}
.unlock-pagination li a,
.unlock-pagination li span{
  display:inline-block; padding:.35rem .6rem;
  border:1px solid rgba(255,255,255,.15);
  border-radius:6px; text-decoration:none;
}
.unlock-pagination li .current{ font-weight:700; }


