:root {
  --bg-color: #0f0f0f;
  --sidebar-bg: #0f0f0f;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --hover-color: #272727;
  --accent-color: #3ea6ff;
  --error-bg: #cc0000;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
}

/* Main Layout Grid */
.main-container {
  display: grid;
  grid-template-columns: 1fr 400px; /* Player area | Sidebar */
  gap: 24px;
  padding: 24px;
  max-width: 1800px;
  margin: 0 auto;
  height: 100vh;
  box-sizing: border-box;
}

/* Video Section */
.video-section {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.video-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.video-info {
  margin-top: 16px;
}

.video-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.video-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Sidebar Playlist */
.playlist-section {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-right: 8px;
}

.playlist-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.playlist-item {
  display: flex;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s;
  margin-bottom: 8px;
}

.playlist-item:hover {
  background-color: var(--hover-color);
}

.playlist-item.active {
  background-color: #263850; /* Subtle highlight for active */
  border: 1px solid rgba(62, 166, 255, 0.3);
}

.thumb {
  width: 160px;
  height: 90px;
  background-color: #333;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  position: relative;
}

/* Fake timestamp on thumbnail */
.thumb::after {
  content: "VOD";
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 4px;
  font-size: 10px;
  border-radius: 4px;
}

.item-info {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Custom Error Toast */
#error-toast {
  visibility: hidden;
  min-width: 300px;
  background-color: #1e1e1e;
  border-left: 4px solid var(--error-bg);
  color: #fff;
  text-align: left;
  border-radius: 4px;
  padding: 16px;
  position: fixed;
  z-index: 1000;
  right: 30px;
  bottom: 30px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s, bottom 0.3s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#error-toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

.toast-close {
  cursor: pointer;
  padding: 0 5px;
  font-size: 18px;
  color: var(--text-secondary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Mobile Responsive */
@media (max-width: 1000px) {
  .main-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .playlist-section {
    padding-right: 0;
  }
}
