/* === 1. STATIC DARK THEME === */
:root {
  --theme-color: #00aeff; /* Electric Blue */
}
/* (body, .page-content, h2, .loading-text are unchanged) */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: white;
  background-color: #121212;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-content {
  flex-grow: 1;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 50px;
  box-sizing: border-box;
}
.page-content h2 {
  font-size: 2.2rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 2px solid var(--theme-color);
  padding-bottom: 15px;
  margin-top: 2rem; 
  margin-bottom: 2rem;
}
.loading-text {
  text-align: center;
  font-style: italic;
  opacity: 0.8;
  font-size: 1.2rem;
  grid-column: 1 / -1; 
}

/* === 2. SITE HEADER & FOOTER (Unchanged) === */
/* (header, .header-content, h1, footer are unchanged) */
header.site-header {
  background-color: rgba(24, 24, 24, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 50px;
  width: 100%;
  box-sizing: border-box; 
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}
.site-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 2px 2px 5px #000;
}
.site-header h1 a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-header h1 a:hover {
  color: var(--theme-color);
}
footer {
  width: 100%;
  text-align: center;
  padding: 20px 50px;
  background-color: rgba(0, 0, 0, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  box-sizing: border-box;
  margin-top: auto;
}
footer p { margin: 0; opacity: 0.7; }

/* === 3. Filter/Search Controls (Unchanged) === */
/* (All .filter-controls, .search-bar, .genre-filter styles are unchanged) */
.filter-controls {
  display: flex;
  flex-wrap: wrap; 
  gap: 20px;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}
.search-bar {
  display: flex;
  gap: 10px;
  flex-grow: 1; 
  min-width: 300px; 
}
.search-bar input {
  flex-grow: 1;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  transition: all 0.3s ease;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color);
  background-color: rgba(0, 0, 0, 0.5);
}
.search-bar button {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 10px;
  background-color: var(--theme-color);
  color: #121212;
  cursor: pointer;
  transition: all 0.3s ease;
}
.search-bar button:hover {
  box-shadow: 0 0 15px var(--theme-color);
  transform: scale(1.05);
}
.genre-filter {
  flex-grow: 0.5;
  min-width: 200px;
}
#genre-select {
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
  -webkit-appearance: none; 
  -moz-appearance: none;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  background-size: 0.8em;
}
#genre-select:focus {
  outline: none;
  border-color: var(--theme-color);
  box-shadow: 0 0 10px var(--theme-color);
  background-color: rgba(0, 0, 0, 0.5);
}


/* === 4. ANIME CARD GRID (Unchanged) === */
#anime-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
}
/* ... (all .anime-card styles are unchanged) ... */
.anime-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 2 / 3; 
  background-color: rgba(0,0,0,0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.anime-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.anime-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 10px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}
.anime-card:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--theme-color);
}
.anime-card:hover img {
  transform: scale(1.1);
}

/* === 5. ANIME DETAIL MODAL (Mostly Unchanged, minor updates) === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  display: none; 
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  position: relative;
  background: rgba(30, 30, 30, 0.9);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 30px var(--theme-color);
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
}
.modal-close:hover {
  opacity: 1;
  color: var(--theme-color);
  transform: scale(1.1);
}
#modal-content-inner {
  display: grid;
  grid-template-columns: 225px 1fr; 
  gap: 25px;
}
#modal-image-container {
  width: 100%;
}
#modal-image {
  width: 100%;
  border-radius: 10px;
}
.add-to-list-btn {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #121212;
  background-color: var(--theme-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.add-to-list-btn:hover {
  box-shadow: 0 0 15px var(--theme-color);
  transform: scale(1.03);
}
#modal-title {
  margin-top: 0;
  font-size: 2rem;
  font-weight: 700;
}
.modal-info-bar {
  display: flex;
  flex-wrap: wrap; 
  gap: 10px; 
  font-size: 0.9rem;
  font-weight: 600;
  margin: 10px 0;
}
.modal-info-bar span {
  padding: 5px 10px;
  border-radius: 5px;
}
.modal-score {
  background-color: var(--theme-color);
  color: #121212; 
}
.modal-rating {
  background-color: #555;
  color: white;
}
.modal-stats-bar {
  display: flex;
  justify-content: space-around;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}
.stats-item h4 {
  margin: 0 0 5px 0;
  font-size: 1.4rem;
  color: var(--theme-color);
  font-weight: 600;
}
.stats-item p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}
#modal-genres {
  font-size: 0.9rem;
  font-style: italic;
  opacity: 0.8;
  margin: 15px 0;
}
#modal-synopsis {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 20px; 
}
.modal-info-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-info-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 400;
}
.modal-info-list li span {
  font-weight: 600;
  text-align: right;
  max-width: 60%;
  color: var(--theme-color);
}
.modal-info-list li:last-child span {
  color: white;
  opacity: 0.9;
}
.trailer-thumbnail {
  display: block;
  position: relative;
  margin-top: 20px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  max-width: 100%; 
}
.trailer-thumbnail img {
  width: 100%;
  display: block;
  border-radius: 10px;
}
.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-shadow: 0 0 10px black;
  transition: all 0.3s ease;
  border: 2px solid white;
}
.trailer-thumbnail:hover .play-icon {
  background-color: var(--theme-color);
  color: #121212;
  border-color: var(--theme-color);
  transform: translate(-50%, -50%) scale(1.1);
}
.trailer-thumbnail:hover {
  box-shadow: 0 0 20px var(--theme-color);
}
.no-trailer {
  font-style: italic;
  opacity: 0.7;
  text-align: center;
  margin-top: 20px;
}
@media (max-width: 600px) {
  #modal-content-inner {
    grid-template-columns: 1fr; 
    text-align: center;
  }
  #modal-image-container {
    max-width: 250px; 
    margin: 0 auto;
  }
  .modal-info-bar {
    justify-content: center;
    flex-wrap: wrap;
  }
  .modal-info-list li {
    flex-direction: column;
    align-items: center;
    gap: 5px;
  }
  .modal-info-list li span {
    text-align: center;
    max-width: 100%;
  }
}

/* === 6. MODAL SECTIONS (Related & Recs) === */

/* NEW: This class is for the sections that span the full modal width */
.modal-section,
.modal-section-full-width {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    /* This makes it span both columns */
    grid-column: 1 / -1;
}
.modal-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: var(--theme-color);
}

/* Grid for "Collection" */
.mini-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* Scrollable container for "More Like This" */
.recommendations-grid-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px; 
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}
.recommendations-grid-scroll::-webkit-scrollbar {
    display: none; 
}


/* Individual Mini Card Style */
.mini-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgba(0,0,0,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    aspect-ratio: 2 / 3; 
    flex-shrink: 0; 
    
    /* * === THIS IS THE FIX for the "More Like This" layout ===
     * We specify a width *only* for cards in the scroll container
    */
    .recommendations-grid-scroll & {
        width: 150px; 
    }
}

/* Placeholder for missing images */
.mini-card-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.05);
}

.mini-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.mini-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 15px 10px 10px;
    text-align: center;
    color: white;
}
.mini-card-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-card-type-info {
    position: absolute;
    top: 5px;
    left: 5px;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.mini-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.5), 0 0 15px var(--theme-color);
}
.mini-card:hover img {
    transform: scale(1.08); 
}


/* Responsive adjustments */
@media (max-width: 600px) {
  #modal-image-container {
    max-width: 200px; /* Adjust size for mobile image */
  }
  .modal-section {
      padding-top: 15px;
  }
  .modal-section h3 {
      font-size: 1.2rem;
      text-align: center; /* Center titles on small screens */
  }
  .mini-card {
      flex: 0 0 120px; /* Adjust fixed width for smaller screens */
  }

  .mini-card-grid {
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
      justify-content: center; 
  }
  .recommendations-grid-scroll {
      padding-left: 10px; 
      padding-right: 10px;
  }
  .recommendations-grid-scroll .mini-card {
      width: 120px;
  }
}

