:root {
  --app-bg: #09090b;
  --surface: #121214;
  --surface-hover: #1f1f22;
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  
  --brand: #f43f5e; /* Rose / sports red */
  --brand-gradient: linear-gradient(135deg, #f43f5e, #fb923c);
  --live-color: #ef4444;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head: 'Outfit', sans-serif;
  
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--app-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: var(--font-sans);
}

/* Glassmorphism Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  letter-spacing: -0.5px;
}

.logo i {
  font-size: 1.8rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-admin {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-admin:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255,255,255,0.2);
}

/* Desktop App Container layout */
.app-container {
  display: flex;
  flex: 1;
  padding: 2rem 5%;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Left: Player Area */
.main-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Important for flex child truncation */
}

.player-box {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  aspect-ratio: 16/9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-box iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.player-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
}
.player-empty i {
  font-size: 4rem;
  opacity: 0.2;
}

.stream-info-card {
  margin-top: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.stream-title-area h1 {
  font-size: 1.5rem;
  font-family: var(--font-head);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--live-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.live-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--live-color);
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.stream-actions {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

/* Right: Sidebar Content */
.sidebar {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tabs-wrapper {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn i { font-size: 1.2rem; }

.tab-btn.active {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.search-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-container i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 1rem 1rem 1rem 2.8rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: 0.2s;
  outline: none;
}

.search-input:focus {
  border-color: var(--brand);
  background: rgba(255,255,255,0.05);
}

.content-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  flex: 1;
  overflow-y: auto;
  max-height: 600px; /* Limits height on desktop */
}

/* Custom scroll */
.content-list::-webkit-scrollbar { width: 6px; }
.content-list::-webkit-scrollbar-track { background: transparent; }
.content-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }


.list-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  transition: 0.2s ease;
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }

.list-item:hover {
  background: rgba(255,255,255,0.03);
}

.list-item.active {
  background: rgba(244, 63, 94, 0.05);
  border-left: 3px solid var(--brand);
}

.item-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.list-item.active .item-icon-wrapper {
  color: var(--brand);
  border-color: rgba(244,63,94,0.3);
}

.item-details {
  flex: 1;
  min-width: 0; /* text truncation */
}

.item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.label {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.label-quality { background: #1f2937; color: #9ca3af; }
.label-live { background: rgba(239, 68, 68, 0.15); color: #ef4444; }


/* PREMIUM MOBILE ADAPTATION */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
    padding: 1rem 3%;
    gap: 1.5rem;
  }
  .sidebar {
    width: 100%;
  }
  .content-list {
    max-height: none; /* Let it flow on tablet */
  }
}

@media (max-width: 768px) {
  body {
    background: #000; /* Richer black for mobile app feel */
  }
  
  .navbar {
    height: 60px;
    padding: 0 1rem;
    background: #000; /* Solid black to merge with player */
    border-bottom: none;
  }

  .logo { font-size: 1.2rem; }
  .logo i { font-size: 1.5rem; }
  .btn-admin span { display: none; } /* Hide text, show icon */
  
  .app-container {
    padding: 0; /* Remove side padding so player touches edges */
    gap: 0;
  }

  /* Player gets sticky or full bleed */
  .player-box {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }

  .stream-info-card {
    margin: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stream-title-area h1 {
    font-size: 1.2rem;
  }

  .stream-actions {
    width: 100%;
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1rem;
  }

  .sidebar {
    padding: 0 1rem 2rem 1rem;
  }

  .tabs-wrapper {
    position: sticky;
    top: 0;
    z-index: 50;
    margin-bottom: 1rem;
  }

  .content-list {
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
  }
  
  .list-item {
    background: var(--surface);
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 0.8rem 1rem;
  }
  .list-item:hover { background: var(--surface-hover); }
  .list-item.active {
    border-left: 1px solid var(--border);
    border: 1px solid var(--brand);
  }
}
