/* Root Theme Variables */
:root {
  --bg-light: #f0f0f0;
  --bg-dark: #121212;
  --text-light: #1a1a1a;
  --text-dark: #e0e0e0;
  --sidebar-width: 300px;
  --transition: 0.3s ease;
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --text: var(--text-light);
  --border: var(--gray-border);
}

[data-theme="dark"] {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --border: #333;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

/* Container Layout */
.container {
  display: flex;
  flex: 1;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}

/* Video Area */
.video-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 1rem;
}

#player {
  width: 100%;
  max-height: 80vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

#fallbackMessage {
  text-align: center;
  margin-top: 1rem;
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Clock */
#clock {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  font-weight: bold;
  opacity: 0.7;
}

/* Sidebar Menu */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background-color var(--transition);
  overflow-y: auto;
}

.top-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.channel-text span {
  font-size: 1.4rem;
  font-weight: bold;
  display: block;
}

#channelCount {
  font-size: 0.9rem;
  opacity: 0.7;
}

#categoryFilter {
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  width: 100%;
}

.search-input {
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 0.5rem;
}

/* Channel List */
.channel-list {
  list-style: none;
  margin-top: 0.5rem;
  padding: 0;
  overflow-y: auto;
  max-height: 60vh;
}

.channel-list li {
  padding: 0.6rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: background var(--transition);
  border-radius: 6px;
}

.channel-list li:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.channel-list li.active {
  background-color: rgba(0, 0, 0, 0.15);
  font-weight: bold;
}

/* Theme Toggle */
#themeToggle {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  transition: color var(--transition);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
  }

  #clock {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.85rem;
  }

  .video-container {
    padding: 0.5rem;
  }

  #themeToggle {
    top: 0.5rem;
    left: 0.5rem;
  }
}
