/* -------------------------------------------------
   WOODLAND THEME – US woodland / forest camo vibes
   ------------------------------------------------- */

:root {
  --ec-primary:       #14532d;  /* deep forest green */
  --ec-primary-dark:  #052e16;
  --ec-secondary:     #a16207;  /* warm brown / gold */
  --ec-bg:            #020617;
  --ec-bg-soft:       #02120c;
  --ec-surface:       #022c22;
  --ec-surface-alt:   #064e3b;

  --ec-text-main:     #ecfdf3;
  --ec-text-muted:    rgba(236, 253, 245, 0.75);

  --ec-accent-green:  #22c55e;
  --ec-accent-lime:   #a3e635;
  --ec-accent-blue:   #4ade80;
}

/* Base ----------------------------------------------------- */

html,
body {
  height: 100%;
}

body {
  background:
    radial-gradient(circle at top, var(--ec-secondary) 0, var(--ec-primary-dark) 40%, #000 100%);
  color: var(--ec-text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Text */

p,
.page-index main p,
.page-model main p,
.page-tv main p,
.lead {
  color: var(--ec-text-main);
}

.text-muted {
  color: var(--ec-text-muted) !important;
}

.text-success {
  color: var(--ec-accent-green) !important;
}

.text-warning {
  color: var(--ec-accent-lime) !important;
}

/* Links */

a {
  color: var(--ec-accent-lime);
  text-decoration: none;
}

a:hover {
  color: #f4ff76;
  text-decoration: underline;
}

/* Headings */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #ffffff;
}

/* Layout container */

main.container {
  max-width: 1320px;
}

/* NAVBAR --------------------------------------------------- */

.ec-navbar {
  background: linear-gradient(
    to right,
    rgba(2, 16, 10, 0.98),
    rgba(5, 46, 22, 0.98)
  );
  border-bottom: 1px solid rgba(15, 118, 110, 0.9);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ec-accent-lime) !important;
}

.navbar-brand:hover {
  color: #ffffff !important;
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--ec-text-muted);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
  color: var(--ec-accent-green);
}

.ec-navbar-tagline {
  color: var(--ec-text-muted);
}

/* Cards (global) ------------------------------------------ */

.card {
  background: radial-gradient(
    circle at top left,
    var(--ec-surface-alt) 0,
    var(--ec-surface) 60%
  ) !important;
  border: 1px solid rgba(16, 78, 50, 0.9) !important;
  color: var(--ec-text-main) !important;
  border-radius: 0.85rem;
  box-shadow: 0 18px 45px rgba(2, 44, 34, 0.85);
}

.card-header {
  background: rgba(3, 30, 18, 0.96) !important;
  border-bottom: 1px solid rgba(16, 78, 50, 0.9) !important;
  color: #ffffff !important;
  font-weight: 600;
}

.card-body {
  color: var(--ec-text-main) !important;
}

/* Buttons -------------------------------------------------- */

.btn-primary {
  background: linear-gradient(135deg, var(--ec-accent-green), var(--ec-accent-lime));
  border-color: var(--ec-accent-green);
  color: #041b04;
  font-weight: 600;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4ade80, var(--ec-accent-lime));
  border-color: var(--ec-accent-green);
  color: #020b02;
}

.btn-outline-light {
  border-color: var(--ec-accent-lime);
  color: var(--ec-accent-lime);
}

.btn-outline-light:hover {
  background: var(--ec-accent-lime);
  color: #041b04;
}

/* Pagination ---------------------------------------------- */

.pagination .page-link {
  background-color: var(--ec-bg-soft);
  border-color: rgba(16, 78, 50, 0.9);
  color: var(--ec-text-muted);
}

.pagination .page-item.active .page-link {
  background-color: var(--ec-accent-green);
  border-color: var(--ec-accent-green);
  color: #021017;
}

/* Footer --------------------------------------------------- */

footer.site-footer {
  border-top: 1px solid rgba(16, 78, 50, 0.9);
  background-color: var(--ec-bg-soft);
  color: var(--ec-text-muted);
}

/* ---------------------------------------------------------
   INDEX PAGE (directory)
   --------------------------------------------------------- */

body.page-index {
  background:
    radial-gradient(circle at top, var(--ec-secondary) 0, var(--ec-primary) 40%, #000 100%);
}

/* Filter bar (supports both classes) */

.ec-filterbar,
.index-filter-bar {
  background-color: rgba(3, 30, 18, 0.98);
  border-radius: 1rem;
  border: 1px solid rgba(16, 78, 50, 0.9);
  padding: 1.3rem 1.6rem;
  color: var(--ec-text-main);
  box-shadow: 0 18px 45px rgba(2, 44, 34, 0.9);
}

.ec-filterbar label,
.index-filter-bar label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ec-text-muted);
  margin-bottom: 0.35rem;
}

.ec-filterbar .form-control,
.ec-filterbar .form-select,
.index-filter-bar .form-control,
.index-filter-bar .form-select {
  background-color: var(--ec-bg);
  border-color: rgba(16, 78, 50, 0.9);
  color: var(--ec-text-main);
}

.ec-filterbar .form-control:focus,
.ec-filterbar .form-select:focus,
.index-filter-bar .form-control:focus,
.index-filter-bar .form-select:focus {
  background-color: var(--ec-bg);
  border-color: var(--ec-accent-blue);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.7);
  color: var(--ec-text-main);
}

.ec-filterbar .filter-count,
.index-filter-bar .filter-count {
  color: var(--ec-accent-lime);
  font-weight: 600;
}

/* Grid */

.index-grid {
  margin-top: 1.25rem;
}

/* ---------------------------------------------------------
   MODEL / TV PAGE
   --------------------------------------------------------- */

body.page-model,
body.page-tv {
  background:
    radial-gradient(circle at top, var(--ec-primary) 0, #01090a 45%, #000 100%);
}

/* Layout */

.model-layout {
  align-items: flex-start;
}

/* Video wrapper */

.video-wrapper {
  background-color: rgba(3, 30, 18, 0.98);
  border-radius: 0.9rem;
  border: 1px solid rgba(16, 78, 50, 0.9);
  padding: 0.55rem;
}

/* in TV mode, let the wrapper hug the video more tightly */
.tv-wrapper {
  padding: 0.45rem;
}

.model-player {
  width: 100%;
  max-height: calc(100vh - 200px);
  background-color: #000;
  border-radius: 0.8rem;
  outline: none;
}

/* no native controls in TV mode */
body.page-tv .model-player {
}
body.page-tv .model-player::-webkit-media-controls {
  display: none !important;
}

/* Shortcuts pill (model page) */

.model-shortcuts {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--ec-text-main);
  border-radius: 999px;
  border: 1px dashed rgba(22, 163, 74, 0.9);
  padding: 0.35rem 0.9rem;
  background: rgba(3, 30, 18, 0.95);
}

/* Sidebar cards */

.page-model .model-sidebar .card,
.page-model .card {
  background: radial-gradient(
    circle at top left,
    var(--ec-surface-alt) 0,
    var(--ec-surface) 60%
  ) !important;
  border-color: rgba(16, 78, 50, 0.95) !important;
}

.page-model .card-header {
  background: rgba(3, 30, 18, 0.98) !important;
  border-bottom-color: rgba(16, 78, 50, 0.9) !important;
  color: #ffffff !important;
}

.page-model .card-body {
  color: var(--ec-text-main) !important;
}

/* Meta list */

.model-meta-list dt {
  color: var(--ec-accent-blue);
  font-weight: 500;
}

.model-meta-list dd {
  color: var(--ec-text-main);
}

/* Featured models strip (circular avatars above player) */

.featured-strip {
  border-bottom: 1px solid rgba(16, 78, 50, 0.7);
  padding-bottom: 0.5rem;
}

.featured-strip-heading {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--ec-text-muted);
}

.featured-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.featured-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--ec-text-main);
  min-width: 0;
}

/* the circle */
.featured-item .featured-avatar {
  width: 96px;
  height: 96px;
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  overflow: hidden;
  border: 2px solid rgba(163, 230, 53, 0.9);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  margin-bottom: 0.35rem;
  flex: 0 0 auto;
}

.featured-item .featured-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50% !important;
}

.featured-item .featured-name {
  font-size: 0.8rem;
  max-width: 110px;
  text-align: center;
}

.featured-item:hover .featured-name {
  color: var(--ec-accent-lime);
}

.featured-item.active .featured-avatar {
  border-color: var(--ec-accent-green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.8), 0 10px 25px rgba(0, 0, 0, 0.8);
}

/* Badges */

.badge.bg-info-subtle {
  background-color: rgba(34, 197, 94, 0.18) !important;
  color: #bbf7d0 !important;
}

.badge.bg-secondary-subtle {
  background-color: rgba(21, 128, 61, 0.25) !important;
  color: #dcfce7 !important;
}

/* Discover section */

.page-model section h2 {
  color: var(--ec-accent-lime);
}

/* ---------------------------------------------------------
   TOP COUNTRIES BLOCK
   --------------------------------------------------------- */

.top-countries-section {
  margin-top: 2rem;
}

.top-countries-card {
  border-radius: 1rem;
}

.top-countries-total-badge {
  font-size: 0.75rem;
}

.top-countries-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
}

@media (max-width: 1200px) {
  .top-countries-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 992px) {
  .top-countries-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .top-countries-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 576px) {
  .top-countries-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.top-country-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.top-country {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(3, 30, 18, 0.9);
  border: 1px solid rgba(16, 78, 50, 0.7);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: background 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
}

.top-country-link:hover .top-country {
  background: rgba(22, 101, 52, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.top-country-name {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-country-count {
  font-weight: 600;
  color: var(--ec-accent-lime);
}

/* Columns on large screens */

@media (min-width: 992px) {
  .model-layout .col-lg-8 {
    flex: 0 0 auto;
    width: 68%;
  }
  .model-layout .col-lg-4 {
    flex: 0 0 auto;
    width: 32%;
  }
}

/* ---------------------------------------------------------
   RECORDING DOCK – bottom-right, minimized by default
   --------------------------------------------------------- */

.rec-dock {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 320px;
  max-width: 90vw;
  background: radial-gradient(
    circle at top left,
    var(--ec-surface-alt) 0,
    var(--ec-surface) 60%
  );
  border-radius: 0.75rem;
  border: 1px solid rgba(16, 78, 50, 0.95);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
  color: var(--ec-text-main);
  font-size: 0.85rem;
  z-index: 1080;
  overflow: hidden;
}

.rec-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem;
  background: rgba(3, 30, 18, 0.98);
  border-bottom: 1px solid rgba(16, 78, 50, 0.9);
  cursor: pointer;
}

.rec-dock-title {
  font-weight: 600;
}

.rec-dock-count {
  margin-left: 0.25rem;
  color: var(--ec-accent-lime);
}

.rec-dock-toggle {
  border: 0;
  background: transparent;
  color: var(--ec-text-muted);
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 0 0 0.35rem;
  cursor: pointer;
}

.rec-dock-body {
  padding: 0.5rem 0.75rem 0.6rem;
  max-height: 260px;
  overflow-y: auto;
}

/* minimized state: hide body, keep header only */
.rec-dock.rec-dock--minimized .rec-dock-body {
  display: none;
}

.rec-dock-empty {
  font-size: 0.8rem;
}

.rec-dock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  background: rgba(3, 30, 18, 0.96);
  border: 1px solid rgba(16, 78, 50, 0.9);
  margin-bottom: 0.35rem;
}

.rec-dock-item:last-child {
  margin-bottom: 0;
}

.rec-dock-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.rec-dock-name {
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-dock-progress {
  font-size: 0.75rem;
  color: var(--ec-text-muted);
}

.rec-dock-actions {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 0 0 auto;
}

.rec-dock-actions button {
  border: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
}

.rec-dock-actions .rec-dl {
  background: var(--ec-accent-green);
  color: #021310;
}

.rec-dock-actions .rec-del {
  background: transparent;
  color: var(--ec-text-muted);
}

/* Mobile: dock spans most of the width at bottom */
@media (max-width: 576px) {
  .rec-dock {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.75rem;
    width: auto;
  }
}

/* ---------------------------------------------------------
   MODEL OFFLINE HERO
   --------------------------------------------------------- */

.model-offline-hero {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  min-height: 260px;
  padding: 2.2rem 2.6rem;
  margin-bottom: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(22, 101, 52, 0.85), rgba(2, 6, 23, 0.96));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.9);
}

.model-offline-hero .model-offline-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: blur(10px);
  transform: scale(1.1);
}

.model-offline-hero .model-offline-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.model-offline-main {
  flex: 1 1 auto;
  text-align: center;
}

.model-offline-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.model-offline-text {
  font-size: 0.98rem;
  color: var(--ec-text-muted);
  margin-bottom: 1.3rem;
}

.model-offline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.model-offline-nav {
  flex: 0 0 auto;
  min-width: 70px;
  padding-inline: 0.85rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.9);
  color: #e5e7eb;
  font-size: 0.85rem;
}

.model-offline-nav:hover {
  background: rgba(15, 118, 110, 0.95);
  border-color: rgba(56, 189, 248, 0.95);
  color: #f9fafb;
}

@media (max-width: 768px) {
  .model-offline-hero {
    padding: 1.6rem 1.2rem;
  }
  .model-offline-hero .model-offline-overlay {
    flex-direction: column;
  }
  .model-offline-nav {
    align-self: stretch;
    text-align: center;
  }
  .model-offline-title {
    font-size: 1.7rem;
  }
}

/* ---------------------------------------------------------
   FLYING SHARE BAR  – woodland-styled floating buttons
   --------------------------------------------------------- */

.ec-sharebar {
  z-index: 1070;
}

/* Desktop: vertical pill on the right */
.ec-sharebar-vertical {
  position: fixed !important;
  right: 1.25rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;

  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.45rem !important;

  padding: 0.55rem 0.45rem;
  border-radius: 999px;
  background: rgba(3, 30, 18, 0.98);
  border: 1px solid rgba(16, 78, 50, 0.95);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
}

/* Mobile: small pill centered at bottom */
.ec-sharebar-horizontal {
  position: fixed !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  bottom: 0.85rem !important;

  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;

  padding: 0.5rem 0.7rem;
  border-radius: 999px;
  background: rgba(3, 30, 18, 0.98);
  border: 1px solid rgba(16, 78, 50, 0.95);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.85);
}

/* Round icon buttons */
.ec-share-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #f9fafb;
  text-decoration: none;
  border: 1px solid rgba(163, 230, 53, 0.85);
  background: radial-gradient(
    circle at top left,
    var(--ec-surface-alt) 0,
    var(--ec-surface) 60%
  );
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  transition:
    transform 120ms ease-out,
    box-shadow 120ms ease-out,
    filter 120ms ease-out,
    border-color 120ms ease-out;
}

.ec-share-btn span {
  font-weight: 700;
}

/* Network colors – blended with woodland look */
.ec-share-whatsapp {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: rgba(34, 197, 94, 0.95);
}
.ec-share-facebook {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  border-color: rgba(37, 99, 235, 0.95);
}
.ec-share-x {
  background: linear-gradient(135deg, #020617, #111827);
  border-color: rgba(148, 163, 184, 0.9);
}
.ec-share-telegram {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  border-color: rgba(56, 189, 248, 0.95);
}
.ec-share-linkedin {
  background: linear-gradient(135deg, #0a66c2, #075985);
  border-color: rgba(59, 130, 246, 0.95);
}
.ec-share-reddit {
  background: linear-gradient(135deg, #f97316, #c2410c);
  border-color: rgba(249, 115, 22, 0.95);
}
.ec-share-copy {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border-color: rgba(244, 63, 94, 0.95);
}

/* Hover / active states */
.ec-share-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95);
  border-color: var(--ec-accent-lime);
}

/* Responsive visibility */
@media (min-width: 768px) {
  .ec-sharebar-horizontal {
    display: none !important;
  }
}
@media (max-width: 767.98px) {
  .ec-sharebar-vertical {
    display: none !important;
  }
}

/* ---------------------------------------------------------
   TV BOTTOM OVERLAY CONTROLS
   --------------------------------------------------------- */

.tv-controls-overlay {
  position: absolute;
  left: 50%;
  bottom: 1.15rem;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.9);
  z-index: 20;
}

.tv-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  cursor: pointer;
  transition: filter 120ms ease-out, transform 120ms ease-out;
}

.tv-btn-end {
  background: rgba(248, 113, 113, 0.95);
  color: #111827;
}

.tv-btn-next {
  background: linear-gradient(135deg, var(--ec-accent-green), var(--ec-accent-lime));
  color: #041b04;
}

.tv-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* Favorite button in overlay (round) */
.tv-btn-fav {
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: radial-gradient(circle at top, var(--ec-surface-alt), var(--ec-surface));
  border: 2px solid rgba(163, 230, 53, 0.85);
}

.tv-fav-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.tv-fav-icon::before {
  content: "☆";
  position: absolute;
  inset: 0;
  font-size: 1.35rem;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* generic profile-style favorite button (used in tv.php) */
.tv-btn-profile {
  border-radius: 999px;
  padding: 0.35rem 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: radial-gradient(circle at top, var(--ec-surface-alt), var(--ec-surface));
  border: 1px solid rgba(163, 230, 53, 0.85);
}

.tv-btn-profile-icon {
  font-size: 1.1rem;
}

/* active favorite: filled star */
.tv-btn-profile--active,
.tv-btn-profile.tv-btn-fav.is-fav {
  background: linear-gradient(135deg, var(--ec-accent-green), var(--ec-accent-lime));
  color: #02130b;
  box-shadow:
    0 0 0 2px rgba(190, 242, 100, 0.95),
    0 16px 36px rgba(0, 0, 0, 0.95);
}

.tv-btn-profile--active .tv-btn-profile-icon {
  color: #052e16;
}

.tv-btn-profile.tv-btn-fav.is-fav .tv-fav-icon::before {
  content: "★";
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.9);
}

/* ---------------------------------------------------------
   Favorites remove badge (X over thumbnail)
   --------------------------------------------------------- */
.fav-remove-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 5;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1;
  border: 1px solid rgba(248, 113, 113, 0.9);
  background: rgba(15, 23, 42, 0.95);
  color: #fecaca;
  cursor: pointer;
}

.fav-remove-badge:hover {
  background: rgba(127, 29, 29, 0.98);
  color: #fee2e2;
}

/* small helper for screen-readers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------------------------------------------------------
   TV LAYOUT SWITCH
   --------------------------------------------------------- */

.tv-layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(3, 30, 18, 0.96);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
}

/* ---------------------------------------------------------
   TV MULTI-SCREEN GRID (1 / 2 / 4 in same area)
   --------------------------------------------------------- */

body.page-tv .tv-frame {
  position: relative;
  width: 100%;
}

body.page-tv .tv-grid {
  display: grid;
  gap: 0.5rem;
}

/* 1 screen = full width */
body.page-tv .tv-grid-1 {
  grid-template-columns: 1fr;
}

/* 2 screens = 2 columns, same 16:9 height */
body.page-tv .tv-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 4 screens = 2x2 */
body.page-tv .tv-grid-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* each tile keeps 16:9 ratio */
body.page-tv .tv-tile {
  position: relative;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #000;
}

body.page-tv .tv-tile::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}

/* video fills tile */
body.page-tv .tv-tile .tv-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* label */
body.page-tv .tv-tile-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  font-size: 0.75rem;
}

/* active tile highlight */
body.page-tv .tv-tile-active {
  box-shadow:
    0 0 0 2px rgba(190, 242, 100, 0.9),
    0 16px 36px rgba(0, 0, 0, 0.95);
}
/* ---------------------------------------------------------
   TV MULTI-SCREEN GRID (1 / 2 / 4)
   --------------------------------------------------------- */

/* TV wrapper: same overall space for 1, 2 or 4 screens */
body.page-tv .tv-wrapper {
  background-color: rgba(3, 30, 18, 0.98);
  border-radius: 1rem;
  border: 1px solid rgba(16, 78, 50, 0.9);
  padding: 0.4rem;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.9);

  /* keep the whole TV area 16:9, like a single player */
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

/* frame fills the wrapper */
.tv-frame {
  position: relative;
  width: 100%;
  height: 100%;
}

/* grid fills the frame */
.tv-grid {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 0.25rem;
}

/* 1 screen: single tile fills everything */
.tv-grid-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

/* 2 screens: single row, 50% / 50% (like your CB example) */
.tv-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

/* 4 screens: 2 × 2 grid inside same 16:9 area */
.tv-grid-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

/* individual tile */
.tv-tile {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #000;
}

/* highlight active tile (used by JS for keyboard focus) */
.tv-tile-active {
  box-shadow:
    0 0 0 2px rgba(190, 242, 100, 0.95),
    0 12px 30px rgba(0, 0, 0, 0.95);
}

/* video inside tile fills its cell */
.tv-tile .tv-player,
.tv-tile .model-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0.75rem;
}

/* label at bottom-left of each tile */
.tv-tile-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 0.78rem;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* make sure the bottom overlay sits above everything */
.tv-controls-overlay {
  z-index: 30;
}

/* small tweak on very narrow screens: allow TV block to be taller */
@media (max-width: 768px) {
  body.page-tv .tv-wrapper {
    aspect-ratio: auto;
  }

  .tv-grid-2,
  .tv-grid-4 {
    grid-auto-rows: minmax(140px, 1fr);
  }
}

/* ---------------------------------------------------------
   NOTE:
   Model grid cards are in a separate file:
   /assets/css/model-card.css
   --------------------------------------------------------- */
