/*
 * Thimago discovery modules
 * Scoped to Pages, Events, Games and Movies through page-specific loading.
 */

.th-discovery-hero {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  padding: 54px 24px 74px;
  background-color: #0c0d12;
  color: #fff;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.th-discovery-hero:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 75%);
  mask-image: linear-gradient(90deg, #000, transparent 75%);
}

.th-discovery-hero:after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 34%;
  pointer-events: none;
  background-color: var(--th-module-accent-soft, rgba(91, 66, 232, 0.18));
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0 100%);
}

.th-discovery-hero--pages {
  --th-module-accent: #21c7a8;
  --th-module-accent-soft: rgba(33, 199, 168, 0.18);
}

.th-discovery-hero--events {
  --th-module-accent: #ffb020;
  --th-module-accent-soft: rgba(255, 176, 32, 0.18);
}

.th-discovery-hero--games {
  --th-module-accent: #5b8cff;
  --th-module-accent-soft: rgba(91, 140, 255, 0.2);
}

.th-discovery-hero--movies {
  --th-module-accent: #f04464;
  --th-module-accent-soft: rgba(240, 68, 100, 0.2);
}

.th-discovery-shell--pages {
  --th-module-accent: #21c7a8;
}

.th-discovery-shell--events {
  --th-module-accent: #ffb020;
}

.th-discovery-shell--games {
  --th-module-accent: #5b8cff;
}

.th-discovery-shell--movies {
  --th-module-accent: #f04464;
}

.th-discovery-hero > .container,
.th-discovery-hero > .container-fluid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 540px);
  grid-template-areas:
    "title search"
    "description search";
  align-items: center;
  column-gap: 48px;
  min-height: 170px;
}

.th-discovery-hero h2 {
  grid-area: title;
  align-self: end;
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.th-discovery-hero h2:before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin-bottom: 18px;
  background: var(--th-module-accent);
  border-radius: 4px;
}

.th-discovery-hero p {
  grid-area: description;
  align-self: start;
  max-width: 520px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1.55;
}

.th-discovery-hero .row.mt20 {
  grid-area: search;
  width: 100%;
  margin: 0;
}

.th-discovery-hero .row.mt20 > div {
  width: 100%;
  max-width: none;
  padding: 0;
}

.th-discovery-hero .input-group {
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
}

.th-discovery-hero .form-control {
  min-height: 48px;
  padding-inline: 18px;
  border: 0;
  border-radius: 6px 0 0 6px;
  background: #fff;
  color: #161821;
}

[dir="RTL"] .th-discovery-hero .form-control {
  border-radius: 0 6px 6px 0;
}

.th-discovery-hero .form-control:focus {
  box-shadow: none;
}

.th-discovery-hero .input-group .btn {
  min-width: 112px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 0 6px 6px 0;
  border: 0;
  background: var(--th-module-accent);
  color: #101116;
  font-weight: 800;
}

[dir="RTL"] .th-discovery-hero .input-group .btn {
  border-radius: 6px 0 0 6px;
}

.th-discovery-hero .floating-img {
  z-index: 1;
  top: auto;
  right: max(28px, calc((100vw - 1240px) / 2));
  bottom: 6px;
  left: auto;
  width: min(32vw, 390px);
  max-height: 240px;
  opacity: 0.44;
  object-fit: contain;
  filter: saturate(0.8) brightness(1.15);
}

.th-discovery-hero .circle-2,
.th-discovery-hero .circle-3 {
  display: none;
}

.th-discovery-shell {
  position: relative;
  z-index: 3;
  margin-top: -38px;
  padding-bottom: 48px;
}

.th-discovery-tabs {
  display: flex;
  align-items: center;
  min-height: 68px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid rgba(38, 40, 58, 0.08);
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(22, 25, 45, 0.1) !important;
}

.th-discovery-tabs > ul {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.th-discovery-tabs > ul::-webkit-scrollbar {
  display: none;
}

.th-discovery-tabs > ul > li {
  flex: 0 0 auto;
}

.th-discovery-tabs > ul > li > a {
  display: flex;
  align-items: center;
  min-height: 66px;
  padding: 0 20px;
  border-bottom-width: 3px;
  color: #555d6f;
  font-weight: 700;
  white-space: nowrap;
}

.th-discovery-tabs > ul > li.active > a {
  color: #171821;
  border-bottom-color: var(--th-module-accent, #5b42e8);
}

.th-discovery-tabs .float-end {
  flex: 0 0 auto;
  margin: 0 0 0 14px !important;
}

[dir="RTL"] .th-discovery-tabs .float-end {
  margin: 0 14px 0 0 !important;
}

.th-discovery-tabs .btn {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #101116;
  color: #fff;
}

.th-discovery-layout {
  --bs-gutter-x: 20px;
  align-items: flex-start;
}

.th-discovery-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid #e7e9ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 23, 41, 0.06);
}

.th-discovery-sidebar .card-body {
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
}

.th-discovery-sidebar .side-nav {
  display: grid;
  gap: 3px;
}

.th-discovery-sidebar .side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-radius: 7px;
  color: #3d4556;
  font-weight: 600;
  line-height: 1.25;
}

.th-discovery-sidebar .side-nav a:hover {
  background: #f3f5f8;
  color: #11131a;
}

.th-discovery-sidebar .side-nav > li.active > a {
  color: #11131a;
  background: color-mix(in srgb, var(--th-module-accent, #5b42e8) 14%, #fff);
  box-shadow: inset 3px 0 0 var(--th-module-accent, #5b42e8);
}

[dir="RTL"] .th-discovery-sidebar .side-nav > li.active > a {
  box-shadow: inset -3px 0 0 var(--th-module-accent, #5b42e8);
}

.th-discovery-main {
  min-width: 0;
}

.th-discovery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  margin-bottom: 16px;
  padding: 8px 10px 8px 18px;
  border: 1px solid #e7e9ef;
  border-radius: 8px;
  background: #fff;
}

.th-discovery-toolbar > span {
  color: #151720;
  font-size: 1.05rem;
  font-weight: 800;
}

.th-discovery-toolbar .float-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.th-discovery-toolbar .countries-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  margin: 0 !important;
  padding: 0 12px;
  border: 1px solid #e1e4eb;
  border-radius: 8px;
  background: #f8f9fb;
  color: #303746;
  font-size: 0.86rem;
  font-weight: 700;
}

.th-discovery-toolbar .countries-filter:hover {
  border-color: var(--th-module-accent, #5b42e8);
  background: #fff;
}

.th-discovery-content {
  min-height: 460px;
  padding: 4px 0;
}

.th-discovery-content > ul.row {
  --bs-gutter-x: 18px;
  --bs-gutter-y: 18px;
  margin-top: 0;
  margin-bottom: 0;
}

.th-discovery-content > ul.row > li {
  display: flex;
}

.th-discovery-content .ui-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  min-height: 286px;
  margin: 0;
  padding: 0 0 16px;
  overflow: hidden;
  border: 1px solid #e5e8ef;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 28px rgba(17, 21, 38, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.th-discovery-content .ui-box:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--th-module-accent, #5b42e8) 36%, #e5e8ef);
  box-shadow: 0 18px 34px rgba(17, 21, 38, 0.11);
}

.th-discovery-content .ui-box .img {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
  background: #eceff4;
}

.th-discovery-content .ui-box .img a {
  display: block;
  width: 100%;
}

.th-discovery-content .ui-box .img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 0;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.th-discovery-content .ui-box:hover .img img {
  transform: scale(1.035);
}

.th-discovery-shell--games .th-discovery-content .ui-box .img img {
  aspect-ratio: 1 / 1;
}

.th-discovery-content .ui-box > .mt10 {
  margin: 0 !important;
  padding: 12px 14px 0;
}

.th-discovery-content .ui-box > .mt10:first-of-type {
  flex: 1;
}

.th-discovery-content .ui-box .h6 {
  display: inline;
  color: #171923;
  font-size: 0.98rem;
  line-height: 1.35;
  font-weight: 800;
}

.th-discovery-content .ui-box .h6 + div,
.th-discovery-content .ui-box .text-sm {
  margin-top: 5px;
  color: #747d90;
  font-size: 0.82rem;
}

.th-discovery-content .ui-box .btn {
  width: 100%;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  border-color: #11131a;
  background: #11131a;
  color: #fff;
}

.th-discovery-content > .text-center.text-muted {
  display: flex;
  min-height: 360px;
  margin: 0 !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed #d9dde6;
  border-radius: 8px;
  background: #fff;
}

.th-discovery-content .no-data {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 7px;
  background: #f3f5f8;
  color: #5c6578;
}

.th-discovery-content .see-more {
  min-height: 46px;
  margin-top: 18px;
  border-radius: 8px;
  text-align: center;
}

.th-game-player .post {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
}

.th-game-player .ratio {
  overflow: hidden;
  border-radius: 8px;
  background: #090a0e;
  box-shadow: 0 18px 44px rgba(8, 10, 17, 0.18);
}

.th-movies-main > .ads {
  margin-bottom: 16px;
}

.th-movie-grid {
  --bs-gutter-x: 20px;
  --bs-gutter-y: 22px;
}

.th-movie-grid > li {
  display: flex;
}

.th-movie-grid .movie-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0 0 14px;
  overflow: hidden;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 22, 39, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.th-movie-grid .movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(18, 22, 39, 0.13);
}

.th-movie-grid .movie-card-top {
  overflow: hidden;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #11131a;
}

.th-movie-grid .movie-picture {
  min-height: 0;
  aspect-ratio: 2 / 3;
  background-position: center top;
  transition: transform 0.35s ease;
}

.th-movie-grid .movie-card:hover .movie-picture {
  transform: scale(1.035);
}

.th-movie-grid .movie-info {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  background: rgba(8, 9, 13, 0.76);
}

.th-movie-grid .movie-info .meta {
  margin-bottom: 7px;
  font-size: 0.86rem;
}

.th-movie-grid .movie-info .btn {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 7px;
  background: #fff;
  border-color: #fff;
  color: #11131a;
}

.th-movie-grid .movie-card-bottom {
  padding: 12px 14px 0;
}

.th-movie-grid .movie-title {
  color: #171923;
  font-size: 0.95rem;
  font-weight: 800;
}

.th-movie-grid .movie-year {
  margin-top: 5px;
  color: #747d90;
}

.th-movies-main .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 24px;
}

.th-movies-main .page-link {
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px !important;
}

.th-movie-detail {
  overflow: hidden;
  padding: 24px;
  border: 1px solid #e4e7ed;
  border-radius: 8px !important;
  background: #fff;
  box-shadow: 0 14px 36px rgba(18, 22, 39, 0.08);
}

.th-movie-detail .post-avatar-picture {
  box-shadow: 0 0 0 3px #fff, 0 8px 20px rgba(18, 22, 39, 0.14);
}

body.night-mode .th-discovery-tabs,
body.night-mode .th-discovery-sidebar,
body.night-mode .th-discovery-toolbar,
body.night-mode .th-discovery-content .ui-box,
body.night-mode .th-discovery-content > .text-center.text-muted,
body.night-mode .th-movie-grid .movie-card,
body.night-mode .th-movie-detail,
body.night-mode .th-game-player .post {
  background: var(--card-dark-color);
  border-color: var(--card-dark-divider);
}

body.night-mode .th-discovery-tabs > ul > li > a,
body.night-mode .th-discovery-sidebar .side-nav a,
body.night-mode .th-discovery-toolbar > span,
body.night-mode .th-discovery-content .ui-box .h6,
body.night-mode .th-movie-grid .movie-title {
  color: var(--body-color-dark);
}

body.night-mode .th-discovery-toolbar .countries-filter {
  border-color: var(--card-dark-divider);
  background: var(--card-dark-input);
  color: var(--body-color-dark);
}

@media (min-width: 1200px) {
  .th-discovery-content > ul.row > li.col-lg-3 {
    width: 33.333333%;
  }
}

@media (max-width: 991.98px) {
  .th-discovery-hero {
    min-height: 260px;
    padding-top: 42px;
  }

  .th-discovery-hero > .container,
  .th-discovery-hero > .container-fluid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "description"
      "search";
    gap: 0;
  }

  .th-discovery-hero .row.mt20 {
    max-width: 620px;
    margin-top: 20px;
  }

  .th-discovery-hero .floating-img {
    right: 14px;
    width: 320px;
    opacity: 0.2;
  }

  .th-discovery-hero:after {
    width: 42%;
  }

  .th-discovery-tabs > ul > li > a {
    padding-inline: 15px;
  }
}

@media (max-width: 767.98px) {
  .th-discovery-hero {
    min-height: 245px;
    padding: 32px 16px 68px;
  }

  .th-discovery-hero h2 {
    font-size: 2rem;
  }

  .th-discovery-hero p {
    font-size: 0.95rem;
  }

  .th-discovery-hero .floating-img {
    display: block !important;
    width: 220px;
    opacity: 0.14;
  }

  .th-discovery-shell {
    margin-top: -40px;
    padding-inline: 12px;
  }

  .th-discovery-tabs {
    min-height: auto;
    padding: 0 8px;
    flex-wrap: wrap;
  }

  .th-discovery-tabs > ul {
    order: 1;
    width: 100%;
  }

  .th-discovery-tabs > ul > li > a {
    min-height: 54px;
    padding-inline: 14px;
  }

  .th-discovery-tabs .float-end {
    order: 0;
    width: 100%;
    margin: 8px 0 0 !important;
  }

  .th-discovery-tabs .float-end .btn {
    width: 100%;
  }

  .th-discovery-layout {
    gap: 14px;
  }

  .th-discovery-shell .th-discovery-layout > .col-md-4.sg-offcanvas-sidebar {
    position: static !important;
    right: auto !important;
    width: 100%;
    z-index: auto;
    transform: none;
  }

  .th-discovery-sidebar {
    position: static;
    max-height: none;
  }

  .th-discovery-sidebar .card-body {
    max-height: none;
    overflow: visible;
    padding: 10px;
  }

  .th-discovery-sidebar .side-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
  }

  .th-discovery-sidebar .side-nav::-webkit-scrollbar {
    display: none;
  }

  .th-discovery-sidebar .side-nav > li {
    flex: 0 0 auto;
  }

  .th-discovery-sidebar .side-nav a {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e4e7ed;
    white-space: nowrap;
  }

  .th-discovery-sidebar .side-nav > li.active > a {
    box-shadow: none;
    border-color: var(--th-module-accent, #5b42e8);
  }

  .th-discovery-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .th-discovery-toolbar .float-end {
    width: 100%;
    justify-content: flex-start;
  }

  .th-discovery-toolbar .countries-filter {
    flex: 1 1 auto;
    justify-content: center;
  }

  .th-discovery-content {
    min-height: 320px;
  }

  .th-discovery-content .ui-box {
    min-height: 0;
  }

  .th-movie-grid {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 16px;
  }

  .th-movie-detail {
    padding: 16px;
  }
}

@media (max-width: 575.98px) {
  .th-discovery-hero .input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .th-discovery-hero .form-control,
  .th-discovery-hero .input-group .btn {
    width: 100%;
    min-width: 0;
  }

  .th-discovery-content > ul.row > li {
    width: 100%;
  }

  .th-movie-grid > li {
    width: 50%;
  }

  .th-movie-grid .movie-card-bottom {
    padding-inline: 10px;
  }

  .th-movie-grid .movie-title {
    font-size: 0.86rem;
  }
}
