/* Carousel container */
.carousel {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping */
  gap: 20px; /* Space between items */
  max-height: 500px; /* Limit height to enable scrolling */
  overflow-x: auto; /* Prevent horizontal scrolling */
  padding: 10px;
}

/* Hide the scrollbar but keep the scroll functionality */
.carousel {
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none; /* For Internet Explorer and Edge */
}

.carousel::-webkit-scrollbar {
  display: none; /* For Chrome, Safari, and Edge */
}

/* Tile container */
.tile-container {
  width: 200px;
  height: 350px;
  cursor: pointer;
  transition: transform 0.3s ease-in-out;
  flex-shrink: 0; /* Prevent tiles from shrinking */
}

/* Tile styles */
.tile {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  text-align: center;
  background-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease-in-out;
  backdrop-filter: blur(6px);
}

/* Poster image */
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  transition: filter 0.3s;
}

.tile:hover img {
  filter: blur(4px);
}

/* Play button */
.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.tile-container:hover .play-button {
  opacity: 1;
}

/* Rating and Episode number (top-left and top-right) */
.rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
}

.ep-no {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* Tile name under the image */
.tile-name {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  width: 100%;
  white-space: wrap;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 5px;
  border-radius: 5px;
}

/* Details dialog */
.details {
  position: absolute;
  top: 0;
  left: 220px;
  width: 400px;
  height: 350px;
  background-color: rgba(0, 0, 0, 0.8); 
  color: #fff;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(8px); 
}

.details.visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Details aligned to the left */
.details.left {
  left: auto;
  right: 220px;
}

/* Title */
.details .title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: -20px;
}

.japtitle {
  margin-top: 15px;
}
/* Synopsis limited to 3 lines */
.details .description {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

/* Meta badges */
.meta-badge {
  display: inline-block;
  background-color: #ffffff30;
  color: white;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 20px rgba(184, 184, 184, 0.6);
  padding: 3px 6px;
  border-radius: 15px;
  margin-right: 5px;
  margin-bottom: 10px;
}

/* Genres and action button */
.genres {
  margin-bottom: 0px;
}

.genre-badge {
  background-color: #ff0000;
  color: white;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 3px; /* Slight rounding for the edges */
  transform: skew(-20deg); /* This will skew the badge to create a parallelogram */
  display: inline-block;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.763);
  margin-right: 10px;
}


.action-button {
  background-color: #ff000080;
  padding: 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
  margin-top: 20px;
  display: none;
}

.action-button:hover {
  background-color: #ff0000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 0, 0, 0.6);
}

/* Tile scale on right-click/long-press */
.tile.scale {
  transform: scale(1.1);
  filter: brightness(0.7);
}

/* Ambient light effect on hover */
.tile-container:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 0, 0, 0.6);
}
