/* === Global Styles === */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #fff; /* Light mode background */
  color: #333;
  text-align: center;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: #000; /* Dark mode background */
  color: #eee;
}

img {
  max-width: 100%;
  height: auto;
}

/* === Navbar & Hamburger Menu === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #c51e25; /* Accent */
  text-align: center;
  width: 100%;
  position: absolute;
  left: 0;
  right: 0;
}

.hamburger {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #c51e25; /* Accent */
  display: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  text-decoration: none;
  color: #444;
  font-weight: bold;
  font-size: 16px;
}

.nav-links li a:hover {
  color: #f1c7d1; /* Accent */
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background-color: #f8f8f8;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    position: fixed;
    top: 50px;
    left: 1rem;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .nav-links.show {
    display: flex;
  }
}

/* === Search Bar === */
#searchBar {
  width: 90%;
  max-width: 400px;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #c51e25; /* Accent */
  border-radius: 8px;
  margin: 20px 0;
}

/* === Drama Grid === */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.drama-card {
  background-color: #fff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s, background-color 0.3s;
}

body.dark .drama-card {
  background-color: #1f1f1f;
}

.drama-card:hover {
  transform: scale(1.02);
}

.drama-card img {
  border-radius: 8px;
}

.drama-card h3 {
  margin: 10px 0;
  font-size: 18px;
}

.drama-card .btn {
  display: block;
  margin: 8px auto;
}

/* === Buttons (Unified) === */
.btn {
  display: inline-block;
  padding: 10px 16px;
  background-color: #c51e25; /* Accent */
  color: white;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none;
}

.btn:hover {
  background-color: #a8181e; /* Darker red */
}

/* === Support Button === */
.support-button {
  margin: 20px auto;
}

/* === Episode Buttons === */
.episode-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 0;
  padding-left: 0;
}

.episode-buttons a {
  display: block;
  width: 200px;
  padding: 14px 20px;
  margin: 8px 0;
  background-color: #c51e25; /* Accent */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 18px;
  text-align: left;
  transition: background-color 0.3s ease;
}

.episode-buttons a:hover {
  background-color: #a8181e;
}

/* === Dark Mode Variables === */
:root {
  --bg: #fff;
  --text: #333;
  --card-bg: #fff;
}

body.dark {
  --bg: #000;
  --text: white;
  --card-bg: #1f1f1f;
}

body {
  background-color: var(--bg);
  color: var(--text);
}

/* === Support Message === */
#support-msg {
  background-color: #f1c7d1; /* Accent soft pink */
  border: 1px solid #c51e25; /* Accent red */
  padding: 10px;
  margin: 25px 0 20px;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
}

body.dark #support-msg {
  background-color: #1f1f1f;
  border-color: #c51e25;
  color: #eee;
}

/* === Dark Mode Toggle Button === */
#toggleBtn {
  position: absolute;
  right: 20px;
  top: 20px;
  cursor: pointer;
  padding: 6px 12px;
  background: #c51e25; /* Accent */
  color: white;
  border: none;
  border-radius: 6px;
  z-index: 10;
}

/* === Navigation Links === */
.nav {
  margin-bottom: 20px;
}

.nav a {
  margin: 0 10px;
  text-decoration: none;
  color: #c51e25; /* Accent */
  font-weight: bold;
}

/* === Request Form === */
#request-form-section {
  max-width: 480px;
  margin: 50px auto 80px;
  background-color: #ffffff;
  padding: 30px 25px;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(197, 30, 37, 0.15); /* Accent shadow */
  text-align: left;
}

body.dark #request-form-section {
  background-color: #1f1f1f;
}

#request-form-section h2 {
  font-size: 28px;
  color: #c51e25; /* Accent */
  margin-bottom: 10px;
  text-align: center;
  font-weight: 700;
}

#request-form-section p {
  font-size: 16px;
  margin-bottom: 25px;
  text-align: center;
  color: #555;
}

body.dark #request-form-section p {
  color: #ccc;
}

#kdrama-request-form input,
#kdrama-request-form textarea {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 20px;
  border: 2px solid #ccc;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
}

#kdrama-request-form input:focus,
#kdrama-request-form textarea:focus {
  outline: none;
  border-color: #c51e25; /* Accent */
  box-shadow: 0 0 6px rgba(197, 30, 37, 0.4);
}

#kdrama-request-form button.btn {
  width: 100%;
  font-size: 18px;
  padding: 14px;
  border-radius: 12px;
}

@media (max-width: 520px) {
  #request-form-section {
    margin: 30px 15px 60px;
    padding: 20px 15px;
  }

  #request-form-section h2 {
    font-size: 24px;
  }

  #kdrama-request-form input,
  #kdrama-request-form textarea {
    padding: 12px 14px;
    font-size: 15px;
  }

  #kdrama-request-form button.btn {
    font-size: 16px;
    padding: 12px;
  }
}

/* === Toggle Switch === */
.toggle-container {
  display: flex;
  align-items: center;
}

.toggle-label {
  cursor: pointer;
  width: 40px;
  height: 20px;
  background: #ccc;
  border-radius: 10px;
  position: relative;
}

.toggle-label::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: 0.3s;
}

#dark-mode-toggle:checked + .toggle-label::before {
  transform: translateX(20px);
}

#dark-mode-toggle {
  display: none;
}

/* === Iframe Container === */
.iframe-container {
  margin: 20px auto;
  max-width: 600px;
  width: 100%;
}

.iframe-container iframe {
  width: 100%;
  height: 340px;
  border: none;
  border-radius: 8px;
  display: block;
}

.back-link {
  display: block;
  margin-top: 30px;
  color: #555;
  text-decoration: underline;
}

body.dark .back-link {
  color: #ccc;
}

/* === Drama List === */
.drama-list {
  max-width: 900px;
  margin: 20px auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.drama-info {
  padding: 10px;
}

.drama-info h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.drama-info p {
  margin: 0;
  font-size: 14px;
  color: #666;
}

body.dark .drama-info p {
  color: #ccc;
}

/* === Status Tags === */
.status {
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 4px;
  color: white;
  font-size: 12px;
}

.status.ongoing {
  background-color: #f1c7d1; /* Accent soft pink */
  color: #000;
}

.status.completed {
  background-color: #c51e25; /* Accent red */
}

/* === Cast Grid Styles === */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
  margin: 30px auto;
  max-width: 900px;
}

.cast-member {
  text-align: center;
  transition: transform 0.2s;
}

.cast-member img {
  border-radius: 50%;
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  transition: transform 0.2s;
}

.cast-member p {
  margin-top: 8px;
  font-weight: bold;
  font-size: 14px;
}

.cast-member a {
  text-decoration: none;
  color: inherit;
}

.cast-member a:hover p {
  color: #c51e25; /* Accent on hover */
}

.cast-member a:hover img {
  transform: scale(1.05);
}