/* public/assets/css/tv.css - Ultra High-Contrast & 100% Responsive TV LED Display */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@600;700;800&family=Be+Vietnam+Pro:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --tv-bg: #030712;
  --tv-card-bg: #0f172a;
  --tv-card-border: #1e293b;
  --tv-card-border-glow: #38bdf8;
  --tv-neon-cyan: #38bdf8;
  --tv-neon-green: #22c55e;
  --tv-neon-yellow: #fbbf24;
  --tv-neon-red: #ef4444;
  --tv-text: #f8fafc;
  --tv-text-muted: #94a3b8;
  --font-score: 'Chakra Petch', monospace, sans-serif;
  --font-tv: 'Be Vietnam Pro', 'Plus Jakarta Sans', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.tv-body {
  background-color: var(--tv-bg);
  color: var(--tv-text);
  font-family: var(--font-tv);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar for TV Panel */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* TV Header */
.tv-header {
  min-height: 68px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 3vw, 32px);
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.tv-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tv-logo-icon {
  font-size: clamp(22px, 2.5vw, 34px);
  color: var(--tv-neon-cyan);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
  flex-shrink: 0;
}

.tv-logo-text {
  min-width: 0;
}

.tv-logo-text h1 {
  font-size: clamp(15px, 1.8vw, 24px);
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-logo-text p {
  font-size: clamp(9px, 1vw, 12px);
  color: var(--tv-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tv-clock {
  font-family: var(--font-score);
  font-size: clamp(15px, 1.8vw, 24px);
  font-weight: 700;
  color: var(--tv-neon-yellow);
  background: #020617;
  padding: 5px 12px;
  border-radius: 10px;
  border: 1px solid #334155;
  box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.15);
  white-space: nowrap;
}

.btn-tv-action {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-tv-action:hover {
  background: #334155;
  color: #fff;
  border-color: #38bdf8;
}

/* TV Main Content Grid */
.tv-main {
  flex-grow: 1;
  padding: clamp(14px, 2vw, 24px) clamp(12px, 2.5vw, 32px);
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* Courts Container */
.tv-courts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
  align-content: start;
}

/* Court Card */
.tv-court-card {
  background: var(--tv-card-bg);
  border: 2px solid var(--tv-card-border);
  border-radius: 18px;
  padding: clamp(14px, 1.8vw, 20px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tv-court-card.active {
  border-color: #0284c7;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.3);
}

.tv-court-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  gap: 8px;
}

.tv-court-badge {
  background: #0284c7;
  color: #fff;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tv-court-category {
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 700;
  color: var(--tv-neon-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  text-align: center;
}

.tv-court-match-code {
  font-family: var(--font-score);
  font-size: 11px;
  color: var(--tv-text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Team Rows & Big Scores */
.tv-match-teams {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  justify-content: center;
}

.tv-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(8px, 1.2vw, 14px);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.tv-team-row.serving {
  border-color: var(--tv-neon-green);
  background: rgba(34, 197, 94, 0.08);
}

.tv-team-info {
  min-width: 0;
  overflow: hidden;
}

.tv-team-info h3 {
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-team-info p {
  font-size: clamp(10px, 1vw, 12px);
  color: var(--tv-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-set-scores {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tv-set-pill {
  font-family: var(--font-score);
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 700;
  color: var(--tv-text-muted);
  background: #020617;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #1e293b;
  min-width: 26px;
  text-align: center;
}

.tv-set-pill.won {
  color: var(--tv-neon-green);
  border-color: var(--tv-neon-green);
}

.tv-big-score {
  font-family: var(--font-score);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 800;
  color: #fff;
  min-width: clamp(36px, 4.5vw, 54px);
  text-align: right;
  line-height: 1;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.tv-team-row.serving .tv-big-score {
  color: var(--tv-neon-yellow);
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

/* Side Panel (Upcoming & Standings) */
.tv-side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-self: start;
}

.tv-side-card {
  background: var(--tv-card-bg);
  border: 1px solid var(--tv-card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tv-side-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--tv-neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.tv-upcoming-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  transition: background 0.15s ease;
}
.tv-upcoming-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tv-upcoming-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--tv-neon-yellow);
  font-weight: 700;
  margin-bottom: 4px;
  gap: 6px;
}

.tv-upcoming-meta span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-upcoming-meta span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.tv-upcoming-match {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TV Footer Ticker */
.tv-footer {
  min-height: 40px;
  background: #020617;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  padding: 6px 24px;
  font-size: 12px;
  color: var(--tv-text-muted);
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

/* ===================================================
   RESPONSIVE BREAKPOINTS (4K, DESKTOP, TABLET, MOBILE)
   =================================================== */

/* 4K Displays (>= 1800px) */
@media (min-width: 1800px) {
  .tv-main {
    grid-template-columns: 1fr 400px;
    gap: 28px;
    padding: 28px 40px;
  }
  .tv-courts-container {
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 24px;
  }
  .tv-big-score {
    font-size: 64px;
  }
}

/* Standard Laptops (992px to 1200px) */
@media (max-width: 1200px) {
  .tv-main {
    grid-template-columns: 1fr 290px;
    gap: 16px;
    padding: 16px 18px;
  }
  .tv-courts-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
  }
}

/* Tablets (768px to 991px) */
@media (max-width: 991px) {
  .tv-main {
    grid-template-columns: 1fr;
  }
  .tv-side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
  }
}

/* Small Screens & Mobile Devices (< 768px) */
@media (max-width: 767px) {
  .tv-header {
    padding: 10px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .tv-header-right {
    justify-content: space-between;
    width: 100%;
  }

  .tv-main {
    padding: 10px 10px;
    gap: 14px;
  }

  .tv-courts-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tv-court-card {
    padding: 12px;
    border-radius: 14px;
  }

  .tv-side-panel {
    grid-template-columns: 1fr;
  }

  /* Compact 2-row layout inside each team row on mobile */
  .tv-team-row {
    padding: 8px 10px;
    gap: 4px 8px;
  }

  .tv-team-info h3 {
    font-size: 13px;
  }

  .tv-set-pill {
    font-size: 11px;
    padding: 2px 5px;
    min-width: 22px;
  }

  .tv-big-score {
    font-size: 32px;
    min-width: 32px;
  }

  .tv-footer {
    padding: 8px 12px;
    font-size: 11px;
    text-align: center;
    justify-content: center;
  }
}

/* Extra small mobile (< 400px) */
@media (max-width: 400px) {
  .tv-team-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name score"
      "sets score";
    align-items: center;
  }
  .tv-team-info {
    grid-area: name;
  }
  .tv-set-scores {
    grid-area: sets;
    margin-top: 2px;
  }
  .tv-big-score {
    grid-area: score;
    font-size: 32px;
  }
  .tv-court-category {
    max-width: 130px;
  }
}
