/* ============ RESET & BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  color: #fff;
  line-height: 1.6;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ============ LAYOUT ============ */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ============ HEADER ============ */
.header {
  text-align: center;
  padding: 25px 0 15px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 8px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 0 auto;
}

.header-logo h1 {
  font-size: 2.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header-logo img {
  filter: brightness(1.2);
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.header-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.header-btn.accent {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  border-color: transparent;
}

.header-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  font-weight: 300;
}

/* ============ SEARCH ============ */
.search-section {
  display: flex;
  justify-content: center;
  margin: 25px 0 30px;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.search-input {
  width: 100%;
  padding: 14px 24px;
  font-size: 1rem;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  background: rgba(20,20,40,0.6);
  color: #fff;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  background: rgba(30,30,50,0.8);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.search-input::placeholder { color: rgba(255,255,255,0.5); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: rgba(10,10,25,0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  border: 1px solid rgba(255,255,255,0.1);
}

.search-item {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

.search-item:hover { background: rgba(255,255,255,0.08); }
.search-item:last-child { border-bottom: none; }

/* ============ SECTIONS ============ */
.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: center;
}

/* ============ EVENTS ============ */
.events-section {
  background: rgba(20,20,40,0.8);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 30px;
  border: 1px solid rgba(255,255,255,0.08);
}

.events-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.events-scroll::-webkit-scrollbar { height: 5px; }
.events-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}

.ev-item {
  min-width: 270px;
  max-width: 310px;
  flex-shrink: 0;
  background: rgba(30,30,50,0.6);
  border-radius: 12px;
  padding: 14px;
  border-left: 3px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.ev-item:hover {
  background: rgba(40,40,60,0.8);
  border-left-color: #ff6b6b;
}

.ev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.ev-time { color: #ff6b6b; font-weight: 600; }
.ev-channel { color: #95a5a6; font-style: italic; }
.ev-title { font-weight: 500; margin-bottom: 10px; font-size: 0.9rem; }

.ev-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ev-link {
  padding: 4px 12px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  color: #fff;
}

.ev-live {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  animation: pulse 2s infinite;
}

.ev-sport {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  color: #2c3e50;
}

.ev-link:hover { transform: translateY(-1px); filter: brightness(1.1); }

.events-legend {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.legend-item {
  font-size: 0.78rem;
  color: #95a5a6;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
  100% { box-shadow: 0 0 0 0 rgba(231,76,60,0); }
}

/* ============ CHANNELS GRID ============ */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

/* ============ CHANNEL CARD ============ */
.channel-card {
  background: rgba(20,20,40,0.8);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out;
}

.channel-card:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px 8px;
  cursor: pointer;
  user-select: none;
}

.card-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-toggle {
  font-size: 0.8rem;
  transition: transform 0.3s;
  opacity: 0.5;
}

.channel-card.collapsed .card-toggle { transform: rotate(-90deg); }
.channel-card.collapsed .card-body { display: none; }

.card-subtitle {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  padding: 0 22px 12px;
}

.card-body {
  padding: 0 22px 22px;
}

/* ============ BUTTON GRID ============ */
.btn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.ch-btn {
  padding: 10px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  position: relative;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  border-color: rgba(255,255,255,0.25);
}

.ch-btn:active { transform: translateY(0); }

.badge-shaka {
  background: rgba(78,205,196,0.12);
  border-color: rgba(78,205,196,0.25);
}

.badge-shaka:hover {
  background: rgba(78,205,196,0.2);
  border-color: rgba(78,205,196,0.4);
}

.badge-iframe {
  background: rgba(255,255,255,0.06);
}

.ch-badge {
  font-size: 0.65rem;
  margin-left: 4px;
  opacity: 0.6;
}

/* ============ SKY STREAMING ============ */
.sky-results {
  margin-top: 16px;
  min-height: 50px;
}

.sky-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.sky-link {
  background: rgba(30,30,50,0.6);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.2s;
}

.sky-link:hover {
  background: rgba(40,40,60,0.8);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ============ INFO BANNERS ============ */
.info-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-radius: 14px;
  margin-bottom: 14px;
  text-decoration: none;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.info-banner:hover { transform: translateY(-2px); }

.banner-blue {
  background: linear-gradient(135deg, #2196F3, #1976D2);
}

.banner-green {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.banner-orange {
  background: linear-gradient(135deg, #FF9800, #F57C00);
}

/* ============ ALT STREAMING ============ */
.alt-section {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.alt-section h3 { margin-bottom: 14px; }

.alt-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.alt-links a {
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.alt-links a:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ============ EMPTY / LOADING STATES ============ */
.loading, .empty-state {
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-style: italic;
  padding: 20px;
}

/* ============ PLAYER MODAL ============ */
.player-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #000;
}

.player-bar {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.player-controls {
  display: flex;
  gap: 8px;
}

.player-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

.close-btn:hover { background: rgba(231,76,60,0.6); }

.player-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#shakaContainer {
  width: 100%;
  height: 100%;
}

#shakaVideo {
  width: 100%;
  height: 100%;
  background: #000;
}

#channelIframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #1a1a2e;
}

/* ============ NOTIFICATIONS ============ */
.notification {
  position: fixed;
  top: 20px; right: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 99999;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s;
  color: #fff;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notif-error { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.notif-success { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.notif-warning { background: linear-gradient(135deg, #f39c12, #e67e22); }
.notif-info { background: linear-gradient(135deg, #3498db, #2980b9); }

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .main-container { padding: 12px; }

  .header-top { flex-direction: column; }
  .header-logo h1 { font-size: 2.2rem; }
  .header-links { justify-content: center; }

  .channels-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .btn-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  .ch-btn {
    font-size: 0.75rem;
    padding: 8px 10px;
  }

  .ev-item {
    min-width: 240px;
    max-width: 270px;
  }

  .alt-links {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .search-input {
    font-size: 0.9rem;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .header-logo h1 { font-size: 1.8rem; }
  .btn-grid { grid-template-columns: repeat(2, 1fr); }
}
