/*
 * Project CSS for trex-iptv-source.
 * Shared classes for website sections.
 */

/* Small authentic TREX X logo accents mixed into the existing Home icon backgrounds. */
section:has(img[src*="trex-x-mark-transparent.webp"]),
section:has(img[src="/assets/images/live.png"]),
section:has(#searchInput),
section:has(img[src*="trex-reseller-panel-3200x1470.webp"]),
#trexControlDeck {
  isolation: isolate;
}

section:has(img[src*="trex-x-mark-transparent.webp"])::before,
section:has(img[src="/assets/images/live.png"])::before,
section:has(#searchInput)::before,
section:has(img[src*="trex-reseller-panel-3200x1470.webp"])::before,
#trexControlDeck::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    url('/assets/images/sections/trex-x-mark-transparent.webp'),
    url('/assets/images/sections/trex-x-mark-transparent.webp'),
    url('/assets/images/sections/trex-x-mark-transparent.webp');
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: 40px auto, 34px auto, 32px auto;
  opacity: 0.22;
  z-index: 0;
}

section:has(img[src*="trex-x-mark-transparent.webp"])::before {
  background-position: 11% 19%, 88% 42%, 21% 83%;
}
section:has(img[src="/assets/images/live.png"])::before {
  background-position: 7% 31%, 91% 18%, 84% 79%;
}
section:has(#searchInput)::before {
  background-position: 14% 28%, 83% 23%, 70% 81%;
}
section:has(img[src*="trex-reseller-panel-3200x1470.webp"])::before {
  background-position: 9% 22%, 90% 35%, 18% 78%;
}
#trexControlDeck::before {
  background-position: 8% 18%, 92% 29%, 76% 82%;
}

/* TREX compact action system: dark glass + orange/turquoise signal edge. */
.trex-action-bar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  width: 100%;
}
.trex-action-bar--center { justify-content: center; }
.trex-action-bar--left { justify-content: flex-start; }
.trex-action-bar--end { justify-content: flex-end; }
.trex-action-bar--section-end {
  max-width: 80rem;
  margin: 28px auto 0;
  padding: 0 20px;
}

.trex-action-btn {
  position: relative;
  display: inline-flex !important;
  min-height: 39px !important;
  align-items: center;
  justify-content: center;
  gap: 8px !important;
  padding: 0 14px !important;
  border: 1px solid transparent !important;
  border-radius: 11px !important;
  background:
    linear-gradient(rgba(7,30,43,.94), rgba(7,30,43,.94)) padding-box,
    linear-gradient(115deg, rgba(231,126,68,.92), rgba(239,160,113,.42) 48%, rgba(23,199,175,.88)) border-box !important;
  color: #EAF2F5 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  font-weight: 650 !important;
  letter-spacing: .01em;
  text-decoration: none !important;
  box-shadow: 0 9px 24px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.025);
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease, filter .25s ease;
}
.trex-action-btn::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #E77E44 0%, #17C7AF 100%);
  box-shadow: 0 0 10px rgba(23,199,175,.24);
}
.trex-action-btn:hover {
  transform: translateY(-1px);
  color: #fff !important;
  background:
    linear-gradient(110deg, rgba(231,126,68,.12), rgba(7,30,43,.96) 52%, rgba(23,199,175,.10)) padding-box,
    linear-gradient(115deg, #E77E44 0%, #EFA071 46%, #17C7AF 100%) border-box !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.19), 0 0 20px rgba(23,199,175,.055);
}
.trex-action-btn[aria-disabled="true"] {
  cursor: default;
}
.trex-action-btn[aria-disabled="true"]:hover {
  transform: none;
}

.trex-action-btn--signal {
  color: #fff !important;
  border: 1px solid rgba(23,199,175,.78) !important;
  background: #E77E44 !important;
  box-shadow:
    0 10px 28px rgba(231,126,68,.16),
    0 0 0 1px rgba(23,199,175,.06),
    inset 0 1px 0 rgba(255,255,255,.10);
}
.trex-action-btn--signal::before {
  background: rgba(255,255,255,.90);
  opacity: .90;
  box-shadow: 0 0 8px rgba(255,255,255,.16);
}
.trex-action-btn--signal:hover {
  border-color: rgba(23,199,175,.95) !important;
  background: #EF8950 !important;
  box-shadow:
    0 12px 32px rgba(231,126,68,.18),
    0 0 0 1px rgba(23,199,175,.08),
    0 0 18px rgba(23,199,175,.07);
}

/* Keep the catalog search action compact and inside the same visual system. */
#searchBtn {
  min-height: 40px !important;
  padding-left: 14px !important;
  padding-right: 14px !important;
  border: 1px solid rgba(255,255,255,.055) !important;
  border-radius: 11px !important;
  background: linear-gradient(108deg, #E77E44 0%, #D97D52 58%, #149987 132%) !important;
  font-size: 12px !important;
  box-shadow: 0 9px 24px rgba(231,126,68,.12);
}
#searchBtn:hover {
  background: linear-gradient(108deg, #EF8950 0%, #DB7E50 52%, #17A993 126%) !important;
}

/* TREX panel gallery modal: make all 8 HQ previews large, readable and above the site header. */
#trexFeatureModal {
  z-index: 9999 !important;
  padding: 12px !important;
}
#trexFeatureModal > div {
  width: min(98vw, 1760px) !important;
  max-width: 1760px !important;
  max-height: 96vh !important;
  grid-template-columns: minmax(0, 2.2fr) minmax(320px, .8fr) !important;
}
#trexFeatureModalImage {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 90vh !important;
  object-fit: contain !important;
}
#trexFeatureModalImage + * { min-width: 0; }
#trexFeatureModal > div > div:first-of-type {
  min-height: 72vh !important;
  padding: 8px !important;
  background: #081f2c !important;
}
#trexFeatureModalTitle {
  display: block !important;
  visibility: visible !important;
}

@media (max-width: 1023px) {
  #trexFeatureModal > div {
    grid-template-columns: 1fr !important;
    max-height: 96vh !important;
    overflow-y: auto !important;
  }
  #trexFeatureModal > div > div:first-of-type {
    min-height: 0 !important;
    padding: 6px !important;
  }
  #trexFeatureModalImage {
    width: 100% !important;
    max-height: 68vh !important;
  }
}

@media (max-width: 640px) {
  section:has(img[src*="trex-x-mark-transparent.webp"])::before,
  section:has(img[src="/assets/images/live.png"])::before,
  section:has(#searchInput)::before,
  section:has(img[src*="trex-reseller-panel-3200x1470.webp"])::before,
  #trexControlDeck::before {
    background-size: 34px auto, 30px auto, 28px auto;
    opacity: 0.18;
  }

  .trex-action-bar {
    gap: 8px;
  }
  .trex-action-bar--section-end {
    margin-top: 22px;
    padding: 0 16px;
  }
  .trex-action-btn {
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 11.5px !important;
  }
  #trexFeatureModal {
    padding: 6px !important;
  }
  #trexFeatureModalImage {
    max-height: 58vh !important;
  }
}