/* --- CSS Variables --- */
:root {
  /* Light Theme (Default) */
  --bg-color: #f4f4f9;
  --header-bg: #333;
  --text-color: #333;
  --text-light: #fff;
  --link-color: #fff;
  --link-hover-bg: #555;
  --border-color: #ccc;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.dark-theme {
  /* Dark Theme */
  --bg-color: #2c3e50;
  --header-bg: #1a1a1a;
  --text-color: #f0f0f0;
  --text-light: #f0f0f0;
  --link-color: #f0f0f0;
  --link-hover-bg: #007bff;
  --border-color: #444;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}


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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: var(--link-color);
  transition: background-color 0.3s, color 0.3s;
}


/* --- Header & Navigation --- */
.site-header {
  background-color: var(--header-bg);
  color: var(--text-light);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.site-header h1 {
  font-size: 1.8rem;
}

.site-header nav a {
  padding: 8px 12px;
  border-radius: 5px;
}

.site-header nav a:hover {
  background-color: var(--link-hover-bg);
}

.site-header nav a.active {
  background-color: var(--link-hover-bg);
  font-weight: bold;
}


/* --- Main Content & Sections --- */
main {
  padding: 20px;
}

.section-title {
  margin-bottom: 20px;
  font-size: 2rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}


/* --- Item Grid Layout --- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.grid-item {
  text-align: center;
  background-color: rgba(255, 255, 255, 0.05); /* For dark theme visibility */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: scale(1.05);
  box-shadow: var(--card-hover-shadow);
}

.grid-item img {
  width: 100%;
  aspect-ratio: 2 / 3; /* Common poster aspect ratio */
  object-fit: cover;
}

.grid-item h3 {
  margin: 15px 10px;
  font-size: 1.2rem;
  color: var(--text-color);
}


/* --- Episode Page Specifics --- */
.dark-theme .episode-header {
  text-align: center;
  padding: 20px;
  background-color: var(--header-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.dark-theme .episode-header h1 {
  font-size: 2.5rem;
}

.sub-nav {
  padding: 15px 20px;
  background-color: rgba(0,0,0,0.2);
}

.sub-nav a {
  font-size: 1.1rem;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 5px;
}
.sub-nav a:hover {
  background-color: var(--link-hover-bg);
}

.video-item {
  position: relative;
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.video-item iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Allows clicks to go through to the iframe */
}

.grid-item:hover .video-overlay {
  opacity: 1;
}


/* --- Placeholder Styles --- */
.placeholder-item {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #e9ecef;
  border: 2px dashed var(--border-color);
  min-height: 200px;
  color: #6c757d;
}

.dark-theme .placeholder-item {
  background-color: #3a4d61;
  color: #bdc3c7;
}

/* --- Player Styles for index.html --- */
.video-player-container {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-player-container:hover {
  transform: scale(1.03);
  box-shadow: var(--card-hover-shadow);
}


/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background-color: var(--header-bg);
  color: var(--text-light);
}
