/* aitio.live — premium dark sports streaming */

:root {
  /* Brand palette */
  --bg:          #0A0A0A;
  --bg-card:     #141020;
  --bg-hover:    #1c1630;
  --bg-input:    #110e1a;
  --text:        #F0F0F0;
  --text-muted:  #9A93A8;
  --text-dim:    #5C5670;
  --purple:      #5B2D8E;
  --purple-light:#7B3FA8;
  --purple-glow: rgba(91, 45, 142, 0.4);
  --gold:        #D4A84B;
  --gold-hover:  #E0BA60;
  --gold-dim:    rgba(212, 168, 75, 0.15);
  --red:         #C0392B;
  --red-soft:    #4a1a1a;
  --green:       #22c55e;
  --border:      #2A2040;
  --border-light:#3D3355;
  --radius:      10px;
  --radius-sm:   6px;
  --max-w:       1200px;
  --max-w-narrow:800px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }

/* --- Header --- */
header {
  background: linear-gradient(180deg, #110e1a 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.logo img {
  height: 36px;
  width: auto;
}
.logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.lang-switch {
  font-size: 0.8rem;
  display: flex;
  gap: 0.4em;
}
.lang-current {
  color: var(--gold);
  font-weight: 700;
  padding: 0.2em 0.5em;
  background: var(--gold-dim);
  border-radius: var(--radius-sm);
}
.lang-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2em 0.5em;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}
.lang-link:hover { color: var(--text); }

/* --- Main --- */
main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* --- Section headings --- */
.stream-section { margin-bottom: 2.5rem; }
.stream-section h2 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* --- Category filter chips --- */
.category-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}
.category-filters::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font);
}
.filter-chip:hover { border-color: var(--purple-light); color: var(--text); }
.filter-chip.active {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}

/* --- Stream Grid --- */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.stream-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
  display: block;
}
.stream-card:hover {
  border-color: var(--purple-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.stream-card.is-live {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(192, 57, 43, 0.2);
}

.stream-thumb {
  aspect-ratio: 16/9;
  background: #0e0a16;
  position: relative;
  overflow: hidden;
}
.stream-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #110e1a 0%, #1a1430 100%);
}

/* Badges */
.live-badge, .vod-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.live-badge {
  background: var(--red);
  color: white;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
  50% { box-shadow: 0 0 12px 3px rgba(192, 57, 43, 0.3); }
}
.vod-badge {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.stream-info { padding: 0.9rem 1rem; }
.stream-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.stream-info time {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
}
.stream-info .price {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
}

/* --- Stream Detail page --- */
.stream-detail { max-width: var(--max-w-narrow); }
.stream-header { margin-bottom: 1.5rem; }
.stream-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.stream-meta {
  display: flex;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.category-tag {
  background: var(--purple);
  color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stream-description {
  margin-bottom: 2rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Purchase box */
.purchase-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.price-display { margin-bottom: 1.2rem; }
.price-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
}

.access-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.access-section p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.access-granted {
  margin: 2rem 0;
  text-align: center;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--red);
  font-weight: 700;
  margin-top: 1rem;
  font-size: 0.9rem;
}
.live-dot {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1;
}
.btn-pay, .btn-primary {
  background: var(--gold);
  color: #0A0A0A;
}
.btn-pay:hover, .btn-primary:hover {
  background: var(--gold-hover);
  color: #0A0A0A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}
.btn-play {
  background: var(--gold);
  color: #0A0A0A;
  font-size: 1.1rem;
  padding: 0.9rem 2.5rem;
}
.btn-play:hover {
  background: var(--gold-hover);
  color: #0A0A0A;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 168, 75, 0.35);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--purple-light);
  background: var(--bg-hover);
  color: var(--text);
}
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #a93226; }
.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
}
.btn-small.btn-primary { background: var(--gold); color: #0A0A0A; }
.btn-small.btn-danger { background: var(--red); color: white; }

/* --- Inputs --- */
.input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--purple-light);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.input::placeholder { color: var(--text-dim); }

.input-row {
  display: flex;
  gap: 0.5rem;
}
.input-row .input { flex: 1; }

.form-label {
  display: block;
  margin-bottom: 0.8rem;
}
.form-label span {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* --- Error box --- */
.error-box {
  background: var(--red-soft);
  border: 1px solid rgba(192, 57, 43, 0.4);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  color: #ff8a80;
  font-size: 0.9rem;
}

/* --- Player page --- */
.player-page { max-width: 1100px; margin: 0 auto; }
.player-container {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.8rem;
  position: relative;
}
.player-container video {
  width: 100%;
  height: 100%;
  display: block;
}
.player-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 0.5rem;
  text-align: center;
  padding: 2rem;
}
.player-waiting h2 { color: var(--text); font-size: 1.2rem; }

.stream-info-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.4rem 0;
}
.stream-info-bar h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* 3-button launch */
.launch-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.launch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 2rem;
  min-width: 140px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.launch-btn:hover {
  border-color: var(--gold);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.launch-btn.primary {
  border-color: var(--gold);
  background: var(--gold-dim);
}
.launch-btn svg {
  width: 32px;
  height: 32px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.launch-btn:hover svg { stroke: var(--gold-hover); }

/* --- Payment providers --- */
.payment-page { max-width: 600px; margin: 0 auto; text-align: center; }
.payment-page h1 {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}
.payment-summary {
  margin-bottom: 2rem;
  color: var(--text-muted);
}
.payment-summary .price-display {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 0.5rem;
}
.payment-providers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2rem;
}
.provider-form { display: contents; }
.provider-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  transition: all 0.2s;
}
.provider-btn:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.provider-btn img { max-height: 32px; max-width: 100%; }
.payment-back { margin-top: 1rem; }
.payment-back a { color: var(--text-muted); font-size: 0.9rem; }

/* --- Login pages (admin + manager) --- */
.login-page {
  max-width: 340px;
  margin: 4rem auto;
  text-align: center;
}
.login-page h1 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.login-page form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.login-page .btn {
  margin-top: 0.3rem;
  width: 100%;
}
/* back compat: admin-login class */
.admin-login { max-width: 340px; margin: 4rem auto; text-align: center; }
.admin-login input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}
.admin-login input:focus {
  outline: none;
  border-color: var(--purple-light);
}
.admin-login .btn { width: 100%; }

/* --- Admin pages --- */
.admin-page { max-width: 1000px; }
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-card h2 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.stream-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stream-form input, .stream-form textarea, .stream-form select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.7rem;
  margin-top: 0.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}
.stream-form input:focus, .stream-form textarea:focus, .stream-form select:focus {
  outline: none;
  border-color: var(--purple-light);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.admin-table th, .admin-table td {
  padding: 0.55rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td { color: var(--text); }

/* Worker / status indicators */
.worker-status { padding: 0.8rem; border-radius: var(--radius-sm); }
.worker-running { border-left: 3px solid var(--green); }
.worker-starting { border-left: 3px solid var(--gold); }
.worker-off { color: var(--text-muted); }

.status-live { color: var(--red); font-weight: 700; }
.status-upcoming { color: var(--gold); }
.status-ended { color: var(--text-muted); }
.status-paid { color: var(--green); }
.status-pending { color: var(--text-muted); }

/* Demigod banner */
.demigod-banner {
  background: linear-gradient(90deg, var(--gold-dim) 0%, transparent 100%);
  border: 1px solid rgba(212, 168, 75, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Port warning */
.port-warning {
  background: var(--red-soft);
  border: 1px solid rgba(192, 57, 43, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  color: #ff8a80;
  font-size: 0.85rem;
}

code {
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
}

/* --- Error page --- */
.error-page { text-align: center; padding: 4rem 0; }
.error-page h1 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-dim);
}
.empty-state h2 {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Phone: < 600px */
@media (max-width: 599px) {
  header { padding: 0.6rem 1rem; }
  .logo-text { font-size: 1rem; }
  .logo img { height: 28px; }
  main { padding: 1.2rem 1rem; }
  .stream-grid { grid-template-columns: 1fr; gap: 1rem; }
  .stream-header h1 { font-size: 1.4rem; }
  .purchase-box { padding: 1.5rem 1rem; }
  .price-amount { font-size: 1.8rem; }
  .launch-buttons { flex-direction: column; }
  .launch-btn { flex-direction: row; min-width: 0; width: 100%; padding: 1rem 1.5rem; }
  .launch-btn svg { width: 24px; height: 24px; }
  .player-container { border-radius: 0; margin-left: -1rem; margin-right: -1rem; width: calc(100% + 2rem); }
  .payment-providers { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet: 600px - 1023px */
@media (min-width: 600px) and (max-width: 1023px) {
  .stream-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop: 1024px+ — defaults, no overrides needed */

/* TV / large screen: 1400px+ */
@media (min-width: 1400px) {
  :root { --max-w: 1600px; }
  .stream-grid { grid-template-columns: repeat(4, 1fr); }
  .stream-info h3 { font-size: 1.05rem; }
  .player-page { max-width: 1400px; }
  .launch-btn { padding: 1.5rem 2.5rem; min-width: 180px; }
  .launch-btn svg { width: 40px; height: 40px; }
}

/* Utility: hide on mobile */
@media (max-width: 599px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 600px) {
  .hide-desktop { display: none !important; }
}
