:root {
  --sidebar-bg: #111111;
  --main-bg-start: #040914;
  --main-bg-end: #0a1426;
  --text-main: #ffffff;
  --text-muted: #888888;
  --primary: #ffffff;
  --font-family: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--main-bg-end);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh; width: 100vw;
}

#app {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
}

/* Loading & Splash */
.splash-screen, .loading-screen {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  height: 100%; width: 100%; background: var(--sidebar-bg); position: absolute; z-index: 1000;
}
.splash-screen h1 { font-size: 3rem; }
.spinner {
  width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1);
  border-top: 3px solid #00d5ff; border-radius: 50%;
  animation: spin 1s linear infinite; margin-top: 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Login */
.login-screen {
  display: flex; justify-content: center; align-items: center; height: 100%;
  background: linear-gradient(135deg, var(--main-bg-start), var(--main-bg-end));
}
.login-card {
  width: 400px; padding: 40px; border-radius: 12px;
  background: var(--sidebar-bg); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.login-card h2 { font-size: 1.5rem; margin-bottom: 20px; text-align: center; }
.input-group { margin-bottom: 15px; }
.input-group input, .input-group select {
  width: 100%; padding: 12px 15px; border-radius: 8px; border: 1px solid #333;
  background: #222; color: white; font-family: var(--font-family);
}
.input-group input:focus, .input-group select:focus {
  outline: none; border-color: #555;
}
.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: 8px;
  background: #2563eb; color: white; font-weight: bold; font-size: 1rem;
  cursor: pointer; margin-top: 10px; transition: 0.2s;
}
.btn-primary:hover { background: #1d4ed8; }

/* Dashboard Layout */
.dashboard {
  display: flex; height: 100%; width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px; background: var(--sidebar-bg);
  display: flex; flex-direction: column; padding: 20px 15px;
  border-right: 1px solid #222;
}
.sidebar-logo {
  text-align: center; margin-bottom: 25px;
}
.sidebar-logo img { max-height: 80px; max-width: 100%; object-fit: contain; }
.sidebar-logo h2 { font-size: 1.8rem; color: #00d5ff; }

/* Search Bar */
.search-box {
  display: flex; align-items: center; background: #111;
  border: 2px solid #fff; border-radius: 20px; padding: 8px 15px;
  margin-bottom: 25px;
}
.search-box input {
  background: transparent; border: none; color: white;
  width: 100%; outline: none; margin-left: 10px; font-size: 1.1rem;
  font-family: var(--font-family);
}

/* Nav Menu */
.nav-menu {
  display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.nav-btn {
  display: flex; align-items: center; gap: 15px;
  background: transparent; border: none; color: var(--text-muted);
  padding: 12px 15px; font-size: 1.2rem; cursor: pointer;
  border-radius: 8px; font-family: var(--font-family); transition: 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); }
.nav-btn.active { color: white; font-weight: bold; }
.nav-btn i { font-style: normal; font-size: 1.4rem; opacity: 0.8; }

/* Sidebar Footer */
.sidebar-footer {
  text-align: center; font-size: 0.8rem; color: #666; margin-top: 20px;
}
.sidebar-footer p { margin-bottom: 5px; }

/* Main Content Area */
.content-area {
  flex: 1; display: flex; overflow: hidden;
  background: linear-gradient(135deg, var(--main-bg-start), var(--main-bg-end));
  position: relative;
}
/* Subtle Watermark */
.content-area::before {
  content: "🎬";
  position: fixed; right: -5%; bottom: -10%;
  font-size: 50vh; opacity: 0.03; z-index: 0; pointer-events: none;
}

/* 2-Column Layout */
.categories-pane {
  width: 250px; border-right: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.2); overflow-y: auto;
  padding: 20px 0; z-index: 1;
}
.categories-pane::-webkit-scrollbar { width: 6px; }
.categories-pane::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.cat-item {
  padding: 15px 20px; font-size: 1.1rem; color: #ccc;
  cursor: pointer; transition: 0.2s; border-left: 4px solid transparent;
}
.cat-item:hover { background: rgba(255,255,255,0.05); color: white; }
.cat-item.active {
  background: rgba(255,255,255,0.1); color: white; font-weight: bold;
  border-left: 4px solid #00d5ff;
}

.content-pane {
  flex: 1; overflow-y: auto; padding: 30px; z-index: 1;
}
.content-pane::-webkit-scrollbar { width: 10px; }
.content-pane::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; }

.content-pane-title {
  font-size: 1.8rem; font-weight: 400; margin-bottom: 25px; color: white;
}

/* Content Grid */
.grid-posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}
.poster-card {
  background: rgba(0,0,0,0.4); border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column;
}
.poster-card:hover { background: rgba(0,0,0,0.6); transform: translateY(-3px); }
.poster-img-container {
  width: 100%; aspect-ratio: 2/3; background: #111;
}
/* If Live TV (landscape cards), we'll add a class .is-live */
.grid-posters.is-live {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.grid-posters.is-live .poster-img-container { aspect-ratio: 16/9; }

.poster-img-container img {
  width: 100%; height: 100%; object-fit: cover;
}
.poster-info {
  padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.poster-title {
  font-size: 1rem; font-weight: bold; color: white; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Details Modal */
.details-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  z-index: 5000; display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: 0.3s;
}
.details-modal-overlay.active { opacity: 1; pointer-events: auto; }

.details-modal {
  width: 900px; max-width: 90%; background: #111; border-radius: 15px;
  display: flex; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.1); position: relative;
}

.stream-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0,213,255,0.2);
  border-color: rgba(0, 213, 255, 0.3);
}

/* Favorite Icon on Cards */
.fav-icon-card {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  color: rgba(255,255,255,0.4);
  font-size: 1.1rem;
}
.fav-icon-card:hover {
  transform: scale(1.1);
  background: rgba(0,0,0,0.8);
}
.fav-icon-card.active {
  color: #ffc107;
}

/* Video Player Overlay */
.details-close {
  position: absolute; top: 15px; right: 20px; font-size: 2rem; color: #fff;
  background: none; border: none; cursor: pointer; opacity: 0.6; transition: 0.2s;
}
.details-close:hover { opacity: 1; }

.details-poster {
  width: 350px; background: #050505; flex-shrink: 0;
}
.details-poster img { width: 100%; height: 100%; object-fit: cover; }

.details-info {
  padding: 40px; flex: 1; display: flex; flex-direction: column;
}
.details-title { font-size: 2.2rem; font-weight: bold; margin-bottom: 10px; }
.details-category { font-size: 1rem; color: #00d5ff; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.details-desc { font-size: 1.1rem; color: #ccc; line-height: 1.6; flex: 1; overflow-y: auto; margin-bottom: 30px; }

.btn-play-modal {
  padding: 15px 30px; background: #00d5ff; color: #000; font-size: 1.2rem; font-weight: bold;
  border: none;  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 20px; border: none; cursor: pointer; transition: 0.2s; box-shadow: 0 5px 15px rgba(0,213,255,0.3);
}
.btn-play-modal:hover { background: #00bce6; transform: scale(1.05); }

.btn-fav-modal {
  display: inline-block; padding: 12px 20px; font-size: 1rem; font-family: inherit; font-weight: bold;
  color: white; background: rgba(255,255,255,0.1); border-radius: 30px;
  margin-top: 20px; margin-left: 10px; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; transition: 0.2s;
}
.btn-fav-modal:hover { background: rgba(255,255,255,0.2); }
.btn-fav-modal.active { color: #ffc107; border-color: #ffc107; background: rgba(255, 193, 7, 0.1); }

/* Series Selectors */
.season-select {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 15px;
  outline: none;
  cursor: pointer;
  width: 100%;
}
.season-select option {
  background: #050505;
  color: white;
}
.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}
.episodes-list::-webkit-scrollbar { width: 6px; }
.episodes-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.episodes-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.episode-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  gap: 12px;
}
.episode-item:hover {
  background: rgba(255, 255, 255, 0.15);
}
.episode-img {
  width: 90px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}
.episode-info {
  flex: 1;
  font-size: 0.9rem;
}
.episode-title {
  font-weight: 500;
  color: #fff;
  margin-bottom: 3px;
}
.episode-desc {
  font-size: 0.75rem;
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.episode-play-icon {
  color: var(--primary);
  font-size: 1.2rem;
  opacity: 0.7;
}
.episode-item:hover .episode-play-icon { opacity: 1; }

/* Settings Screen */
.settings-container {
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.settings-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
}
.settings-card h3 {
  margin-bottom: 15px;
  color: #00d5ff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-weight: 600; font-size: 1rem; }
.settings-desc { font-size: 0.85rem; color: #888; margin-top: 5px; }
.settings-value { font-weight: bold; color: #fff; }

.switch {
  position: relative; display: inline-block; width: 50px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #333; transition: .4s; border-radius: 34px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px;
  background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #00d5ff; }
input:checked + .slider:before { transform: translateX(24px); }

.pin-input {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2);
  color: white; padding: 8px 12px; border-radius: 6px; width: 100px;
  text-align: center; font-size: 1.1rem; letter-spacing: 5px;
}
.pin-input:focus { outline: none; border-color: #00d5ff; }

.pin-input:focus { outline: none; border-color: #00d5ff; }

/* Home / Matches Styles */
.home-container {
  padding: 30px;
  overflow-y: auto;
  height: 100%;
}
.home-section-title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.match-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.match-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #00d5ff, #00f0ff);
}
.match-header {
  font-size: 0.8rem;
  color: #00d5ff;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
}
.match-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}
.team-logo {
  width: 50px; height: 50px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  margin-bottom: 10px;
  display: flex; justify-content: center; align-items: center; font-size: 1.2rem;
}
.team-name { font-size: 0.9rem; font-weight: 600; }
.match-vs {
  font-size: 1.2rem; font-weight: bold; color: #555;
}
.match-time {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  color: #fff;
  background: rgba(0, 213, 255, 0.1);
  padding: 5px;
  border-radius: 5px;
}

.home-carousel {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.home-carousel::-webkit-scrollbar { height: 8px; }
.home-carousel::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.home-carousel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.home-carousel .poster-card {
  width: 150px;
  flex-shrink: 0;
  margin-bottom: 0;
}
.home-carousel .poster-img-container {
  height: 220px;
}

/* Video Player Overlay */
.player-container {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: black; z-index: 9999; display: none;
}
.player-container.active { display: flex; flex-direction: column; }
.close-player {
  position: absolute; top: 20px; right: 30px; background: transparent; border: none;
  color: white; font-size: 2rem; cursor: pointer; z-index: 10000;
}
.close-player:hover { color: #f44336; }
video { width: 100%; height: 100%; object-fit: contain; background: black; }
