/* General reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Body styling */
body {
  background-color: #f9f9f9;
  color: #333;
  padding: 20px;
}

/* Top navigation */
#topNav {
  margin-bottom: 10px;
}

#topNav a {
  font-size: 0.9rem;
  color: #0077cc;
  text-decoration: none;
}

#topNav a:hover {
  text-decoration: underline;
}

/* Controls for shows & episodes */
#controls,
#showControls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  background-color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

#controls h2 {
  margin-right: 8px;
  font-size: 1rem;
}

#controls label,
#showControls label {
  font-size: 0.9rem;
  color: #555;
}

#controls input[type="text"],
#controls select,
#showControls input[type="text"],
#showControls select {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.9rem;
  min-width: 180px;
  background-color: #fafafa;
}

#controls input[type="text"]:focus,
#controls select:focus,
#showControls input[type="text"]:focus,
#showControls select:focus {
  outline: none;
  border-color: #0077cc;
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.15);
}

#searchCount,
#showCount {
  margin-left: auto;
  font-size: 0.9rem;
  color: #666;
}

/* Grids for shows and episodes */
#root,
#showsRoot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Shared card styling */
.episode-card,
.show-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.episode-card:hover,
.show-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Episode title */
.episode-card h2 {
  font-size: 1.1rem;
  margin: 12px 16px 8px 16px;
  color: #222;
}

/* Episode image */
.episode-card img {
  width: 100%;
  display: block;
}

/* Episode summary */
.episode-card section {
  padding: 8px 16px 16px 16px;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

/* Link to TVMaze inside episode card */
.episode-card a {
  margin: 0 16px 16px 16px;
  font-size: 0.9rem;
  color: #0077cc;
  text-decoration: none;
}

.episode-card a:hover {
  text-decoration: underline;
}

/* Show cards */
.show-card {
  cursor: pointer;
}

.show-card h2 {
  font-size: 1.1rem;
  margin: 12px 16px 8px 16px;
  color: #222;
}

.show-card img {
  width: 100%;
  display: block;
}

.show-card .show-summary {
  padding: 4px 16px;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.4;
}

.show-card .show-meta {
  padding: 8px 16px 16px 16px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
}

.show-card .show-meta p {
  margin-bottom: 4px;
}

/* Status / error messages */
.status-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  font-size: 1rem;
  color: #555;
}

.status-message.error {
  color: #b00020;
}

/* Responsive adjustments for small screens */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  #controls,
  #showControls {
    flex-direction: column;
    align-items: flex-start;
  }

  #searchCount,
  #showCount {
    margin-left: 0;
  }

  #root,
  #showsRoot {
    grid-template-columns: 1fr;
  }

  .episode-card h2,
  .show-card h2 {
    font-size: 1rem;
  }
}


