@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');


:root {
  --ambient_size: 70px;
}



body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: Montserrat, sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
}

a {
  all: unset;
  cursor: pointer;
}

.header-right .search-bar input {
  width: 200px !important;
  box-sizing: border-box !important;
  transition: width 0.3s ease;
}

.header-right .search-bar input:focus,
.header-right .search-bar input:not(:placeholder-shown),
.header-right .search-bar.has-results input {
  width: 300px !important;
  box-sizing: border-box !important;
}

/* Prevent search expansion on mobile */
@media (max-width: 768px) {
  .header-right .search-bar input {
    width: 200px !important;
  }
  
  .header-right .search-bar input:focus,
  .header-right .search-bar input:not(:placeholder-shown),
  .header-right .search-bar.has-results input {
    width: 200px !important;
  }
}

/* .dropdown-content.show {
  display: block;
} */


/* login stuff */

.login-modal.show {
  display: flex !important;
}

/* skeleton */

.footer {
  margin-bottom: -2rem !important;
  margin-left: -2rem !important;
  margin-right: -2rem !important;
}


.episode .episode-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;
}



.loader {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  /* Adjust color as needed */
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
  opacity: 0.8;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.info-box-right {
  order: 2;
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  height: fit-content;
  overflow: hidden;
  min-height: 83.5px;
}

@media (max-width: 1224px) {
  .container {
    grid-template-columns: 1fr;
    /* Single column on mobile */
    grid-template-rows: auto auto auto auto auto auto auto;
    /* Seven rows for each section */
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
    height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-top: 7rem;
  }

  /* Desktop: make the side content independent so it doesn't affect grid row heights
   - Position the side panel absolutely inside the grid container
   - Reserve space on the anime-info column so it doesn't overlap
   - Keep the side panel scrollable and responsive to viewport height
   Tweak --side-width and top/bottom buffers as needed. */
  @media screen and (min-width: 1225px) {
    .container {
      position: relative;
    }

    /* Width of the side panel (adjust to taste) */
    :root {
      --side-width: 320px;
      --side-top-buffer: 120px;
      /* space for header */
      --side-bottom-buffer: 40px;
      /* space from bottom */
    }

    .side-content {

      position: absolute;
      top: var(--side-top-buffer);
      right: 24px;
      /* keep a small gutter from the right edge */
      width: var(--side-width);
      max-height: calc(100vh - var(--side-top-buffer) - var(--side-bottom-buffer));
      overflow-y: auto;
      box-sizing: border-box;
      /* Make sure it looks the same visually */
      margin: 0;
      padding-right: 0.6rem;
    }

    .episode-list-container {
      margin-right: calc(var(--side-width) + 48px);
    }

    /* Also add margin to the episode list itself */
    .episode-list {
      margin-right: 4px;
      /* Keep the existing small margin */
    }

    /* Reserve horizontal space on the main column so it doesn't expand into the side panel */
    .anime-info {
      margin-right: calc(var(--side-width) + 48px);
    }

    .episode-list.small-squares {
      overflow-x: auto;
    }
  }

  .wrapper {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 1 / 2;
    /* First row - video player */
  }

  .controls {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 2 / 3;
    /* Second row - server selections */
    display: flex;
    overflow: visible;
  }

  .episode-list-container {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 3 / 4;
    /* Third row - episode list */
    height: auto;
    min-height: 350px;
    /* Increased from 300px to allow more expansion */
    padding-right: 0.5rem !important;
    padding-left: 0.5rem !important;
    /* Ensure container doesn't restrict scrolling on mobile */
    overflow: visible !important;
  }

  .episode-list {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 3 / 4;
    /* Third row */
    height: auto;
    min-height: 350px;
    /* Increased from 300px to match container */
    /* Allow expansion */
  }

  .info-container {
    grid-column: 1 / -1 !important;
    /* Span full width */
    grid-row: 4 / 5;
    /* Moved to fourth row, below episode list */
  }

  .bottom-section {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 5 / 6;
    /* Fifth row - description etc */
    flex-direction: column;
  }

  .comments-section {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 6 / 7;
    /* Sixth row - comments */
  }

  .side-content {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: 7 / 8;
    /* Seventh row - top trending */
    height: auto;
    width: 100%;
    margin: 0 auto 1rem auto;
    box-sizing: border-box;
    padding-right: 0.6rem;
  }

  .controls-sub-dub {
    grid-column: 1 / -1;
    /* Span full width */
    grid-row: auto;
    /* Let it flow naturally after other elements */
    width: 100%;
    margin-top: 1rem;
  }

  /* Other mobile-specific styles remain unchanged */
}

.control-info-container {
  display: none;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
}

@media (max-width: 1224px) {

  .info-box-right {
    display: none;
  }

  .animerating {
    display: none !important;
  }

  .info-stats {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }

  .info-stats {
    padding-top: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }

  .stats-container {
    margin-left: 0;
    /* Remove auto margin */
    width: 100%;
    /* Take full width */
    display: flex;
    justify-content: center;
    gap: 1.5rem;
  }

  .control-info-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
  }

  .stats-item {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center items horizontally */
    gap: 0.5rem;
  }
}

/*AAAAAAAAAAAAAAA*/

.episode-toggle-container {
  padding-top: 1rem;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.description-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--button-color);
  border: none;
  border-radius: 6px;
  color: var(--text-primary);
  font-family: Montserrat, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.description-toggle-btn:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.description-toggle-btn svg {
  width: 14px;
  height: 14px;
}

.episode-info-content {
  position: relative;
}

.info-content {
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease;
  position: absolute;
  width: 100%;
}

.info-content.active {
  opacity: 1;
  visibility: visible;
  height: auto;
  position: relative;
}

@media (max-width: 768px) {
  .description-toggle-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .description-toggle-btn svg {
    width: 12px;
    height: 12px;
  }
}

.sidebar-info-stats {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  width: 100%;
}

.sidebar-info-stats .stats-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.sidebar-info-stats .stats-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-info-stats .stats-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-info-stats .stats-value {
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 1224px) {
  .sidebar-info-stats {
    margin-top: 0.5rem;
    padding: 0.4rem;
  }

  .sidebar-info-stats .stats-container {
    gap: 1rem;
  }

  .sidebar-info-stats .stats-item svg {
    width: 16px;
    height: 16px;
  }

  .sidebar-info-stats .stats-value {
    font-size: 0.8rem;
  }
}

.info-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  height: 100%;
}

.info-box-right .control-button svg {
  width: 20px;
  height: 20px;
}

.info-box-right .control-button:hover {
  background: var(--button-color);
  transform: translateY(-2px);
}

@media (min-width: 1225px) {
  .control-button:hover {
    transform: translateY(-2px);
  }

  .controls button:hover {
    transform: translateY(-1px);
  }
}

.stats-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.stats-item svg {
  width: 20px;
  height: 20px;
}

.stats-item .rating-icon {
  color: #FFD700;
}

.stats-item .members-icon {
  color: var(--text-secondary);
}

.stats-item .rank-icon {
  color: #9146FF;
}

.stats-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stats-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
}

@media screen and (max-width: 768px) {
  .info-box-right {
    display: none;
  }

}

.loader-container {
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.skeleton {
  border-radius: 8px !important;
  animation: skeleton-loading 1s linear infinite alternate;
  padding-bottom: 1.95rem;
  padding-top: 1.95rem;
}

.wrapper.skeleton {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  height: 42.7vw !important;
}

@media (max-width: 1224px) {
  .wrapper.skeleton {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 52vw !important;
  }
}

.wrapper.skeleton .loader-container {
  height: auto;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes skeleton-loading {
  0% {
    background-color: var(--bg-secondary);
  }

  100% {
    background-color: var(--bg-primary);
  }
}

.control-button.skeleton {
  min-width: 120px;
  height: 28px;
  /* Match your control button height */
  padding: 0;
  /* Remove default skeleton padding */
  margin: 0;
  border-radius: 8px;
  background-color: var(--bg-secondary);
}

.dropdown-btn-sub,
.dropdown-btn-dub {
  opacity: 0.7;
}

.dropdown-btn-sub:not(:empty),
.dropdown-btn-dub:not(:empty) {
  opacity: 1;
}

.dropdown-content-sub a,
.dropdown-content-dub a {
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.skeleton-text-description {
  width: 100%;
  height: 1rem;
  margin-bottom: .25rem;
  border-radius: .25rem;
}

.skeleton-text-controls {
  width: 100%;
  border-radius: .25rem;
}

.skeleton-text-titlesmall {
  width: 100%;
  height: 3.5rem;
  margin-bottom: .25rem;
  border-radius: .25rem;
}

.skeleton-text-title {
  width: 100%;
  height: 5rem;
  margin-bottom: .25rem;
  border-radius: .25rem;
}

.skeleton-text-container {
  width: 100%;
  height: 6rem;
  margin-bottom: .25rem;
  border-radius: .25rem;
}

.container {
  overflow-y: hidden;
  width: 100%;
  max-width: 100vw;
  /* Ensure container doesn't exceed viewport width */
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: minmax(0, 3.5fr) minmax(0, 1fr);
  /* Prevent columns from growing beyond their space */
  grid-template-rows: auto auto auto auto;
  gap: 1rem;
  padding: 1rem;
  box-sizing: border-box;
  padding-top: 7rem;
  position: relative;
  margin: 0 auto;
  /* Center the container */
}

/* Fix potential overflow issues in grid items */


.controls input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--bg-secondary);
  border-radius: 4px;
  font-size: 14px;

}

.controls button,
.controls input {
  max-width: 100%;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}


/* Hide mobile navigation by default */


/* @media (max-width: 768px) {

  .episode-list.small-squares {
    gap: 4px;
}
.episode-list.small-squares .episode {
    flex: 0 0 calc(5.555% - 3.778px); 
    font-size: 8px;
}
  .nav-buttons {
    display: none;
  }

  .mobile-nav {
    padding: 15px 20px;
  margin: 15px;
  border-radius: 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #333;
    padding: 10px;
    z-index: 1000;
  }

  .mobile-nav button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
  }
} */


/* new sub dub */

.server-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0;
  pointer-events: none;
}

.video-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  width: 100%;
  justify-content: center;
}

.left-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

/* Second row: control buttons */
.right-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.source-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  /* Prevent source controls from shrinking */
}

.info-container {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.control-buttons-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* For very small screens */
@media (max-width: 480px) {

  .source-button,
  .server-button,
  .control-button {
    padding: 0.4rem;
    font-size: 0.75rem;
  }

  /* Hide button text on small screens, show only icons */
  .control-button span {
    display: none;
  }
}

.source-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.server-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
  background: var(--bg-secondary) !important;
}

.server-button[disabled]:hover {
  transform: none !important;
  box-shadow: none !important;
  background: var(--bg-secondary) !important;
}

.source-button,
.server-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--button-color);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 36px;
  justify-content: center;
  text-align: center;
}

.source-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.server-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.server-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--button-color);
  border: 1px solid transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.server-button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.server-button.active {
  background: var(--accent-color);
  border: 2px solid var(--episode-container);
  box-shadow: 0 0 8px rgba(255, 140, 0, 0.2);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.server-button:hover:not(.active) {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .video-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    width: 100%;
  }

  .left-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  /* Source and server controls in one row */
  .source-server-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
  }

  .source-buttons {
    display: flex;
    gap: 0.5rem;
  }

  .server-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 100%;
    max-width: 500px;
  }

  /* Make buttons smaller on mobile */
  .source-button,
  .server-button {
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem;
    height: 32px;
    width: auto;
  }

  .server-text {
    text-align: center;
    margin: 0.5rem 0;
    font-size: 0.75rem;
  }

  .control-buttons-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }
}

/* mobile nav */





/* mobile nav end */


.nav-buttons {
  gap: 10px;
  margin-left: 10px;
}

.nav-buttons button {
  padding: 5px 10px;
  font-size: 16px;
  border: none;
  border-radius: 3px;
  background-color: var(--button-color);
  color: var(--text-primary);
  cursor: pointer;
}

.nav-buttons button:hover {
  background-color: var(--accent-color);
}

.control-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: var(--button-color);
  border: none;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 36px;
}

.control-button:hover {
  background-color: var(--accent-color);
  /*transform: translateY(-2px);*/
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.control-button:active {
  transform: translateY(0);
}

.control-button svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.control-button:hover svg {
  transform: scale(1.1);
}

.sub-button.active {
  background: rgba(255, 140, 0, 0.2);
  border: 1px solid rgba(255, 140, 0, 0.8);
  color: var(--text-primary);
}

.dub-button.active {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.8);
  color: var(--text-primary);
}

.control-buttons-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#toggleViewButton svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

#toggleViewButton {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Add this to your existing CSS */

/* Base tooltip styles */
/* Replace your existing tooltip CSS with this */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1001;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--accent-color);
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
}

[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  z-index: 1001;
  border-color: transparent transparent var(--bg-secondary) transparent;
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
}

/* Remove any title attribute styling */
[title]::before,
[title]::after {
  display: none !important;
}

.control-buttons-group [data-tooltip] {
  overflow: visible;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px) translateX(-50%);
  }

  to {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
}

@media (max-width: 1224px) {

  /* Reset hover-based tooltips on mobile */
  [data-tooltip]:hover::before,
  [data-tooltip]:hover::after {
    display: none;
  }

  /* Create a new mobile tooltip */
  .mobile-tooltip {
    position: absolute;
    top: 100%;
    /* Place below the button */
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    /* Spacing from the button */
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: normal;
    max-width: 200px;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--accent-color);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .mobile-tooltip.show {
    opacity: 1;
    visibility: visible;
  }

  .mobile-tooltip.show {
    opacity: 1;
    visibility: visible;
    animation: mobileTooltipFadeIn 0.2s ease forwards;
  }

  @keyframes mobileTooltipFadeIn {
    from {
      opacity: 0;
      transform: translate(-50%, 10px);
    }

    to {
      opacity: 1;
      transform: translate(-50%, 0);
    }
  }
}

/* JW PLAYER STYLING */

/* JW Player icon hover effects */
/* JW Player icon hover effects - except volume */
.jwplayer .jw-icon:not(.jw-icon-volume):hover {
  transform: scale(1.1) !important;
  transition: transform 0.2s ease !important;
}

/* Keep volume icon without transform */
.jwplayer .jw-icon-volume:hover {
  transform: none !important;
}

.jwplayer .jw-settings-menu {
  font-family: 'Montserrat', sans-serif !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  /* Add this to ensure everything inside respects border radius */
}

.jwplayer .jw-settings-topbar {
  border-radius: 8px 8px 0 0 !important;
}


/* Remove any color transitions */
.jwplayer .jw-icon-volume svg,
.jwplayer .jw-icon-settings svg,
.jwplayer .jw-icon-cc svg,
.jwplayer .jw-icon-playback svg,
.jwplayer .jw-icon-fullscreen svg,
.jwplayer .jw-icon-rewind svg,
.jwplayer .jw-icon-forward svg {
  transition: none !important;
}

[button="fast-forward"] .jw-icon,
[button="rewind-5"] .jw-icon {
  width: 24px !important;
  height: 24px !important;
}

/* Volume icon size adjustments for mobile */
@media (max-width: 768px) {

  [button="fast-forward"] .jw-icon,
  [button="rewind-5"] .jw-icon,
  [button="fast-forward-90-sec"] .jw-icon,
  .jwplayer .jw-svg-icon-volume-0,
  .jwplayer .jw-svg-icon-volume-50,
  .jwplayer .jw-svg-icon-volume-100,
  .jwplayer .jw-svg-icon-settings,
  .jwplayer .jw-svg-icon-cc-on,
  .jwplayer .jw-svg-icon-cc-off {
    background-size: 18px !important;
    /* Smaller icons on mobile */
    width: 18px !important;
    height: 18px !important;
  }

  .jwplayer .jw-icon-volume,
  .jwplayer .jw-icon-settings,
  .jwplayer .jw-icon-cc {
    width: 32px !important;
    /* Smaller button containers */
    height: 32px !important;
  }

  /* Make skip button slightly larger on mobile */
  [button="fast-forward-90-sec"] .jw-icon {
    background-size: 23px !important;
    width: 23px !important;
    height: 23px !important;
  }
}

/* Even smaller for very small screens */
@media (max-width: 480px) {

  [button="fast-forward"] .jw-icon,
  [button="rewind-5"] .jw-icon,
  [button="fast-forward-90-sec"] .jw-icon,
  .jwplayer .jw-svg-icon-volume-0,
  .jwplayer .jw-svg-icon-volume-50,
  .jwplayer .jw-svg-icon-volume-100,
  .jwplayer .jw-svg-icon-settings,
  .jwplayer .jw-svg-icon-cc-on,
  .jwplayer .jw-svg-icon-cc-off {
    background-size: 16px !important;
    width: 16px !important;
    height: 16px !important;
  }

  .jwplayer .jw-icon-volume,
  .jwplayer .jw-icon-settings,
  .jwplayer .jw-icon-cc {
    width: 28px !important;
    height: 28px !important;
  }

  /* Make skip button slightly larger on very small screens */
  [button="fast-forward-90-sec"] .jw-icon {
    background-size: 23px !important;
    width: 23px !important;
    height: 23px !important;
  }
}

/* Make skip button icon bigger on desktop */
@media (min-width: 769px) {
  [button="fast-forward-90-sec"] .jw-icon {
    width: 30px !important;
    height: 30px !important;
    background-size: 30px !important;
  }
}

.jwplayer .jw-slider-time {
  margin-bottom: 12px !important;
  height: 4px !important;
  border-radius: 8px !important;
  /* Round the main bar */
}

.jwplayer .jw-slider-time .jw-slider-container {
  height: 4px !important;
  transition: height 0.2s ease !important;
  border-radius: 8px !important;
  /* Round the container */
}

.jwplayer .jw-progress {
  background: var(--episode-container) !important;
  border-radius: 8px !important;
  /* Round the progress */
}

.jwplayer .jw-rail {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 8px !important;
  /* Round the rail */
}

.jwplayer .jw-buffer {
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 8px !important;
  /* Round the buffer */
}

/* Hover state */
.jwplayer .jw-slider-time:hover .jw-slider-container {
  height: 6px !important;
  border-radius: 9px !important;
  /* Adjust radius for hover state */
}

.jwplayer .jw-slider-time .jw-knob {
  display: none !important;
}

/* Control bar */
.jwplayer .jw-controlbar {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
  font-family: 'Montserrat', sans-serif !important;
}

/* Progress bar */
.jwplayer .jw-slider-time {
  height: 4px !important;
}

.jwplayer .jw-slider-time .jw-slider-container {
  height: 4px !important;
  transition: height 0.2s ease !important;
}

.jwplayer .jw-slider-time:hover .jw-slider-container {
  height: 6px !important;
}

.jwplayer .jw-progress {
  background: var(--episode-container) !important;
}


/* Settings menu */
.jwplayer .jw-settings-menu {
  font-family: 'Montserrat', sans-serif !important;
  background: rgba(28, 28, 28, 0.95) !important;
  border-radius: 8px !important;
}

/* Custom JW Player Icons */
.jw-svg-icon-play path {
  display: none;
}

.jw-svg-icon-play {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='5 3 19 12 5 21 5 3'%3E%3C/polygon%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-pause path {
  display: none;
}

.jw-svg-icon-pause {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='6' y1='4' x2='6' y2='20'%3E%3C/line%3E%3Cline x1='18' y1='4' x2='18' y2='20'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-volume-0 path {
  display: none;
}

.jw-svg-icon-volume-0 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'%3E%3C/polygon%3E%3Cline x1='23' y1='9' x2='17' y2='15'%3E%3C/line%3E%3Cline x1='17' y1='9' x2='23' y2='15'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-volume-100 path {
  display: none;
}

.jw-svg-icon-volume-100 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'%3E%3C/polygon%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-fullscreen-on path,
.jw-svg-icon-fullscreen-off path {
  display: none;
}

.jw-svg-icon-fullscreen-on,
.jw-svg-icon-fullscreen-off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-settings path {
  display: none;
}

.jw-svg-icon-settings {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'%3E%3C/circle%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* CC icon */
.jw-svg-icon-cc-on path,
.jw-svg-icon-cc-off path {
  display: none;
}

.jw-svg-icon-cc-on,
.jw-svg-icon-cc-off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3Cpath d='M7 10h2m4 0h2'%3E%3C/path%3E%3Cpath d='M7 14h2m4 0h2'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Volume icons positioning fix */
.jw-icon-volume {
  display: flex;
  align-items: center;
}

.jw-slider-volume {
  transition: all 0.2s ease !important;
}

/* Volume icons */
.jw-svg-icon-volume-0,
.jw-svg-icon-volume-50,
.jw-svg-icon-volume-100 {
  background-size: contain;
  background-repeat: no-repeat;
}

.jw-svg-icon-volume-0 path,
.jw-svg-icon-volume-50 path,
.jw-svg-icon-volume-100 path {
  display: none;
}

/* Muted volume icon */
.jw-svg-icon-volume-0 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'%3E%3C/polygon%3E%3Cline x1='23' y1='9' x2='17' y2='15'%3E%3C/line%3E%3Cline x1='17' y1='9' x2='23' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

/* Half volume icon */
.jw-svg-icon-volume-50 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'%3E%3C/polygon%3E%3Cpath d='M15.54 8.46a5 5 0 0 1 0 7.07'%3E%3C/path%3E%3C/svg%3E");
}

/* Full volume icon */
.jw-svg-icon-volume-100 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='11 5 6 9 2 9 2 15 6 15 11 19 11 5'%3E%3C/polygon%3E%3Cpath d='M19.07 4.93a10 10 0 0 1 0 14.14M15.54 8.46a5 5 0 0 1 0 7.07'%3E%3C/path%3E%3C/svg%3E");
}



/* end of jw cooking */

/* Responsive adjustments */
@media (max-width: 768px) {
  [title]:hover::before {
    font-size: 0.7rem;
    padding: 4px 8px;
    bottom: -30px;
  }

  [title]:hover::after {
    bottom: -12px;
  }
}

.list-icon,
.grid-icon {
  position: relative;
}

@media (min-width: 1225px) {
  body #searchButton {
    display: none;
  }
}

@media (max-width: 1750px) {
  .control-button span {
    display: none;
  }

}


@media (max-width: 1224px) {

  .right-controls {
    margin-left: 0 !important;
  }

  .scroll-top-button {
    width: 35px !important;
    height: 35px !important;
    bottom: 90px !important;
    right: 15px !important;
  }

  .scroll-top-button svg {
    width: 16px !important;
    height: 16px !important;
  }

  .video-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Keep vertical stacking for main container */
    align-items: center;
    gap: 1rem;
  }


  .control-buttons-group {
    width: 100%;
    display: flex;
    flex-direction: row;
    /* Make buttons horizontal */
    flex-wrap: wrap;
    /* Allow wrapping if needed */
    justify-content: center;
    gap: 0.5rem;
  }

  .control-button {
    flex: 0 0 auto;
    min-width: 32px;
    /* Even smaller size */
    width: 32px;
    height: 32px;
    padding: 0.5rem;
    /* Reduced padding */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .control-button svg {
    width: 16px;
    /* Slightly smaller icons */
    height: 16px;
  }

}


/* anime detaislk cooking */

.anime-details-wrapper {
  display: block;
}

/* MODAL */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.control-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--bg-secondary);
}

.control-button.disabled:hover {
  transform: none;
  box-shadow: none;
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  margin: 5% auto;
  padding: 1.5rem;
  width: 90%;
  max-width: 500px;
  border: 1px solid var(--text-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.close-div {
  position: absolute;
  right: 1rem;
  top: 1rem;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-div:hover {
  color: var(--accent-color);
}

.modal h2 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal label {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.modal textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--button-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
}

.modal textarea::placeholder {
  font-family: 'Montserrat', sans-serif;
  /* Match placeholder font */
  color: var(--text-secondary);
}

.modal textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal [type="submit"] {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  background-color: var(--button-color);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.modal [type="submit"]:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


.checkbox-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}


.modal-content h2 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.modal-content h3 {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: normal;
}


.checkbox-container input[type="checkbox"] {
  margin-right: 8px;
}


.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* Two equal columns */
  grid-template-rows: repeat(3, auto);
  /* Three rows */
  gap: 15px;
}

.checkbox-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkbox-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

#fix-options {
  display: none;
  /* Hidden by default */
  grid-column: span 2;
  /* Make it span both columns */
}

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--bg-secondary);
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loading-text {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.refresh-button {
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  display: none;
}

.close-report-modal {
  padding: 10px 20px;
  background-color: var(--accent-color);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  display: none;
}

/* MODAL END */

.close-button {
  color: var(--accent-color);
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-button:hover,
.close-button:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

.video,
.canvas {
  display: block;
}


.video,
.canvas {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.wrapper {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  position: relative;
  box-shadow: inset 0 0 4rem 4.5rem var(--color-background);
  padding-top: 56.25%;
  /* 16:9 Aspect Ratio */
  overflow: visible;
}

.canvas {
  border-radius: 8px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 70%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 40%, rgba(0, 0, 0, 0) 70%);
  transform: scale(1.7);
  background: #121212;
  transform-origin: center center;
}

/* gpu warning */

#ambient-warning-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

#ambient-warning-modal .modal-content {
  background: var(--bg-primary);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ambient-warning-modal .modal-content h2 {
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 1.5rem;
}

#ambient-warning-modal .modal-content p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1rem;
}

#ambient-warning-modal .modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#ambient-warning-modal .modal-buttons .button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#ambient-warning-modal .modal-buttons .button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ambient-warning-modal .modal-buttons .button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#ambient-warning-modal .modal-buttons .button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

#ambient-warning-modal .modal-buttons .button:hover::after {
  width: 80%;
}

/* Hide the modal by default */
#ambient-warning-modal {
  display: none;
}

/* Show the modal when active */
#ambient-warning-modal.active {
  display: flex;
}

.no-scroll {
  overflow: hidden;
}



/* When canvas is hidden, fully remove it from rendering */
.canvas.hidden {
  display: none !important;
}


.hidden {
  display: none;

}

.video {
  border-radius: 8px;
  padding: 0rem;
}

@media (prefers-reduced-motion: reduce) {
  .canvas {
    display: none !important;
  }
}

/* cooking airing and shi */

.side-content {
  min-height: 500px;
  position: relative;

  display: flex;
  flex-direction: column;
  height: auto;
  /* min-height: 580px; */
  /* Remove fixed min-height */
  /* Add maximum height */
  overflow-y: auto;
  /* Add scrolling */
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 0;
  /* Remove default padding */
  margin-bottom: 1rem;
  /* Add space between side-content and comments */
}

/* Navigation Header */
.side-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
  color: var(--text-primary);
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.nav-arrow {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sections Container */
.sections-container {
  position: relative;
  height: calc(100% - 60px);
  /* Subtract navigation height */
  overflow: hidden;
}

.section {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.section.active {
  opacity: 1;
  visibility: visible;
}

@-moz-document url-prefix() {
  @media (min-width: 1225px) {
    .trending-list {
      padding-right: 0.9rem;
      margin-right: 0px;
      margin-left: 4px;
      margin-top: 4px;
    }
  }
}

.episode-link:visited .episode-title {
  color: var(--visited);
  opacity: 0.4;
}

.episode-number-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
}

.episode-link:visited .episode-number-overlay {
  color: var(--text-secondary);
  opacity: 0.4;
}



/* For grid/small squares view */
.episode-list.small-squares .episode-link:visited .episode-number-overlay {
  color: var(--text-secondary);
  opacity: 0.4;
}

/* Optional: add visual indicator for the episode container */
.episode-link:visited+.episode {
  border: 1px solid var(--text-secondary);
  opacity: 0.4;
}

#current-episode .episode-title,
#current-episode .episode-description {
  color: var(--text-primary) !important;
}

#current-episode .episode-number-overlay {
  color: white !important;
}

/* Trending/Upcoming Premium Grid Styles */
.premium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  padding: 0.5rem;
  height: calc(100% - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) rgba(0, 0, 0, 0.2);
}

.premium-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
  cursor: pointer;
  height: 145px;
}

.premium-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.premium-card-image {
  width: 100%;
  height: 90px;
  object-fit: cover;
  transition: all 0.3s ease;
  filter: brightness(0.85);
}

.premium-card:hover .premium-card-image {
  filter: brightness(1);
}

.premium-card-content {
  padding: 0.6rem;
  position: relative;
}

.premium-card-rank {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a52);
  color: white;
  padding: 3px 7px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.7rem;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
  z-index: 3;
}

.premium-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.premium-card-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.premium-card-episodes {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.premium-card-episodes svg {
  width: 11px;
  height: 11px;
}

/* OLD Trending List Styles (kept for backward compatibility) */
.trending-list {
  padding-left: 0.6rem;
  padding-bottom: 0.6rem;
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  height: calc(100% - 20px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent var(--bg-secondary);
  /* Initially transparent */
  transition: scrollbar-color 0.3s ease;
  margin-bottom: 0;
  /* Add this */
}

.trending-item {
  display: flex;
  gap: 1rem;
  background-color: var(--button-color);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 0;
}

.trending-image-container {
  position: relative;
  width: 100px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  /* Add these lines */
  align-items: center;
  /* to center vertically */
  justify-content: center;
  /* to center horizontally */
}

.trending-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
  /* Darkens the image to 70% brightness */
  transition: filter 0.3s ease;
  display: block;
  /* Add this to remove any extra space */
}

.trending-item:hover .trending-image {
  filter: brightness(0.9);
}

.trending-number-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.trending-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  /* Add this to allow text truncation */
  overflow: hidden;
  /* Add this to contain content */
}

.trending-title {
  color: var(--text-primary);
  font-size: 0.9rem;
  /* Reduce font size */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-height: 2.4em;
  margin-bottom: 4px;
  width: 100%;
  /* Ensure title takes full width */
}

.trending-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.trending-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.15);
}

/* Scrollbar Styling for Premium Grid */
.premium-grid::-webkit-scrollbar {
  width: 6px;
  transition: opacity 0.3s ease;
}

.premium-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
}

.premium-grid::-webkit-scrollbar-thumb {
  transition: opacity 0.3s ease;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}



.premium-grid:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.6);
}

/* Scrollbar Styling for Old Trending List */
.trending-list::-webkit-scrollbar {
  width: 6px;
  transition: opacity 0.3s ease;
}

.trending-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  transition: opacity 0.3s ease;
}

.trending-list::-webkit-scrollbar-thumb {
  transition: opacity 0.3s ease;
  background: var(--text-primary);
  border-radius: 4px;
}

/* Show scrollbar on hover */
.trending-list:hover {
  scrollbar-color: var(--text-primary) var(--bg-secondary);
}

.trending-list:hover::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
}

.top-airing {
  overflow: hidden;
  grid-column: 2 / 3;
  /* Second column */
  grid-row: 3 / 4;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
  height: 600px;
}

.top-airing-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.top-airing-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.next-episode {
  font-size: 1.5rem;
  font-weight: bold;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/*.video-player-wrapper {
  position: relative;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  width: 100%;
  height: 0;
  padding-bottom: 57%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}*/

.ambient-mode {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
  z-index: 1;
  pointer-events: none;
  display: none;
}

.ambient-mode.active {
  display: block;
}

/**.video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: hidden;
}

.video-player iframe,
.video-player video {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
  overflow: hidden;
}*/
/* Add this to your CSS */
.scroll-top-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--accent-color);
  color: var(--text-primary);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.scroll-top-button.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.scroll-top-button svg {
  width: 24px;
  height: 24px;
}

#video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  background: #000;
}

.glow-off {
  box-shadow: none;
}

@-moz-document url-prefix() {
  @media (min-width: 1225px) {
    .episode-list {
      padding-right: 1rem;
      margin-right: 0px;
      margin-left: 4px;
      margin-top: 4px;
    }
  }
}

.related-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--accent-color);
}

.related-section-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.related-heading {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

.related-section-toggle {
  background: var(--button-color);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.related-section-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.related-section-toggle:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

/* Collapsed state */
.related-section-content {
  overflow: visible;
  height: auto;
  opacity: 1;
  transform: translateY(0);
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: height;
}

.related-anime-container-grid.collapsed .related-section-content {
  height: 0;
  opacity: 0;
  transform: translateY(-12px);
}

.related-anime-container-grid.collapsing .related-section-content {
  pointer-events: none;
}

.related-anime-container-grid.collapsed .related-section-toggle svg {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {

  .bottom-section-content,
  .related-section-content {
    transition: none !important;
  }
}

/* Adjust existing related grid styles */
.related-section-content {
  display: block;
}

.related-grid-compact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: none;
}

/* Mobile responsive adjustments */
@media (max-width: 1224px) {
  .related-section-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* For desktop layout */
@media (min-width: 1225px) {
  .container {
    grid-template-columns: minmax(0, 3.5fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
  }

  .wrapper {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .episode-list-container {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  .controls {
    max-height: 150px;
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }


  .bottom-section {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
  }

  .related-anime-container-grid {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    overflow: visible;
    box-sizing: border-box;
  }

  .comments-section {
    grid-column: 1 / 2;
    grid-row: 4 / 5;
  }

  .side-content {
    grid-column: 2 / 3;
    grid-row: 4 / 5;
  }
}

/* Add responsive styling for the relocated related anime section */
.related-anime-container-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: visible;
}

.related-anime-container-grid .related-heading {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.related-anime-container-grid .related-grid-compact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.no-related-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

.no-related-message p {
  margin: 0;
  font-size: 0.9rem;
}

/* Mobile responsive adjustments */
@media (max-width: 1224px) {
  .related-anime-container-grid {
    grid-column: 1 / -1;
    grid-row: 5 / 6;
    order: 4;
  }

  .related-anime-container-grid .related-grid-compact {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
}

.next-airing-row {
  padding-bottom: 1.5rem;
  display: flex;
  align-items: center;
}


.next-episode-icon {
  width: 16px;
  height: 16px;
  color: var(--text-primary);
  flex-shrink: 0;
  /* Prevent the icon from shrinking */
}

#next_episode_countdown {
  vertical-align: middle;
  margin-left: 4px;
}

.episode-list {
  align-items: start;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  margin-right: 4px;
  padding-left: 1rem;
  height: 100%;
  /* Match parent height */
  max-height: calc(56.25vw * 0.659);
  /* Match video height (56.25% of viewport width) */
  overflow-y: scroll;
  scrollbar-gutter: stable;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: transparent var(--bg-secondary);
  transition: scrollbar-color 0.3s ease;
  position: relative;
}

/* Override viewport-width calculation on narrow screens where it becomes too restrictive */
@media screen and (max-width: 1224px) {
  .episode-list {
    max-height: calc(100vh - 500px) !important;
    /* Much taller for regular list view */
    min-height: 200px !important;
    overflow-y: auto !important;
    /* Ensure scrolling always works */
  }
}

.episode-list-container {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  position: relative;
  overflow: hidden;
  /* Clip hovered items at container edge */
}

/* Allow scrolling on mobile for episode containers */
@media screen and (max-width: 1224px) {
  .episode-list-container {
    overflow: visible !important;
    /* Allow scrolling on mobile */
  }
}

.episode-list-container .controls {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(var(--text-primary-rgb, 255, 255, 255), 0.08);
  margin-bottom: 0.5rem;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  flex-wrap: nowrap;
}

.episode-list-container .controls .control-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(var(--text-primary-rgb, 255, 255, 255), 0.15);
  background-color: var(--button-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  height: 36px;
}

.episode-list-container .controls #searchBar {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(var(--text-primary-rgb, 255, 255, 255), 0.15);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.2s ease;
  height: 36px;
  box-sizing: border-box;
}

.episode-list-container .controls #searchBar:focus {
  outline: none;
  border-color: var(--accent-color, #007bff);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.episode-list-container .controls #searchBar::placeholder {
  color: var(--text-secondary);
}

.episode-list-container .controls .control-button:hover {
  background-color: var(--button-hover-color);
  border-color: rgba(var(--text-primary-rgb, 255, 255, 255), 0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.episode-list-container .controls .control-button svg {
  width: 16px;
  height: 16px;
}

.episode-list::-webkit-scrollbar {
  width: 8px;
  /* Set a fixed width */
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.episode-list::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.episode-list::-webkit-scrollbar-thumb {
  background: var(--text-primary);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}


.episode-list:hover::-webkit-scrollbar,
.episode-list:hover::-webkit-scrollbar-track,
.episode-list:hover::-webkit-scrollbar-thumb {
  opacity: 1;
}

.episode-list:hover {
  scrollbar-color: var(--text-primary) var(--bg-secondary);
}

.episode {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 90px;
  background-color: var(--button-color);
  color: var(--text-primary);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
  display: flex;
  text-decoration: none;
  align-items: stretch;
}

.loader-container {
  border-radius: 8px;
  overflow: hidden;
  /* Ensures content doesn't overflow rounded corners */
}

.video {
  border-radius: 8px;
  overflow: hidden;
  /* Ensures video doesn't overflow rounded corners */
}

/* If you have a player wrapper, you might also want to add */
.player-wrapper,
#player-container,
.jwplayer {
  border-radius: 8px !important;
  overflow: hidden;
}

.episode-image-container {
  position: relative;
  width: 120px;
  height: 100px;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.episode-image {
  width: 120px;
  height: auto;
  aspect-ratio: 120 / 100;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: block;
  z-index: 1;
}

.episode-image-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, var(--button-color) 100%);
  pointer-events: none;
  z-index: 2;
  transition: transform 0.3s ease;
}

.episode-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  z-index: 3;
  pointer-events: none;
}


.episode:hover {
  filter: brightness(1.1);
}

.episode:hover .episode-image {
  opacity: 1;
  transform: scale(1.08);
}

.episode:hover .episode-image-fade {
  background: linear-gradient(to right, transparent 0%, var(--accent-color) 100%);
  transform: scale(1.08);
}



.episode-list.small-squares .episode-number-overlay {
  font-size: 1.2rem;
  /* Adjust the font size as needed */
  color: var(--text-primary);
  /* Change the color as needed */
}

/* SAVING FOR MYSELF, JUST ADD PADDING TO THE CONTAINER */

.episode-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.4rem 0.4rem 0.4rem 0.3rem;
  min-width: 0;
  gap: 0.15rem;
}

.episode-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  flex-shrink: 0;
}

.current-episode-description {
  font-size: 0.8rem;
  max-height: 3rem;
  overflow: hidden;
}

.current-episode-description.expanded {
  max-height: 500px;
  /* Large enough to show full content */
}

.expand-description-btn {
  display: inline-block;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 4px;
  font-weight: bold;
  font-size: 0.65rem;
  user-select: none;
}

.expand-description-btn:hover {
  text-decoration: underline;
}

.episode-description {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  margin: 0;
  flex-shrink: 0;

  /* Changed from 2 to 10 to show up to 10 rows */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  /* Slightly reduced from 1.4 */
  margin: 0;
}

.episode:hover {
  background-color: var(--accent-color);
}


/* Compact related anime items - image on left fading to right with content */
.related-grid-compact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: visible;
}

.related-item {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 90px;
  background-color: var(--button-color);
  color: var(--text-primary);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
  display: flex;
  text-decoration: none;
  align-items: stretch;
}

.related-item:hover {
  filter: brightness(1.1);
}

.related-item-type-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 8px 0 6px 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 3;
}

.related-item-image-wrapper {
  position: relative;
  width: 110px;
  height: 100%;
  flex-shrink: 0;
  overflow: hidden;
}

.related-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 0 0 8px;
  opacity: 0.8;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.related-item:hover .related-item-image {
  opacity: 1;
  transform: scale(1.08);
}

.related-item-image-fade {
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, var(--button-color) 100%);
  pointer-events: none;
}

.related-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4rem 0.4rem 0.4rem 0.5rem;
  min-width: 0;
  gap: 0.15rem;
}

.related-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  flex-shrink: 0;
}

.related-item-description {
  font-size: 0.73rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 1224px) {
  .related-item {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .related-item {
    height: 80px;
  }
  
  .related-item-image-wrapper {
    width: 100px;
    overflow: hidden;
  }
  
  .related-item-image-fade {
    width: 100px;
  }
  
  .related-item-type-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
  }
  
  .related-item-content {
    padding: 0.35rem 0.35rem 0.35rem 0.5rem;
    gap: 0.12rem;
  }
  
  .related-item-title {
    font-size: 0.82rem;
    line-height: 1.05;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .related-item-description {
    font-size: 0.68rem;
    line-height: 1.05;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

@media (max-width: 480px) {
  .related-item {
    height: 75px;
  }
  
  .related-item-image-wrapper {
    width: 80px;
    overflow: hidden;
  }
  
  .related-item-image-fade {
    width: 80px;
  }
  
  .related-item-type-badge {
    padding: 0.15rem 0.4rem;
    font-size: 0.6rem;
  }
  
  .related-item-content {
    padding: 0.3rem 0.3rem 0.3rem 0.4rem;
    gap: 0.1rem;
  }
  
  .related-item-title {
    font-size: 0.8rem;
    line-height: 1;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .related-item-description {
    font-size: 0.66rem;
    line-height: 1;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

/* Bottom Section Styling (matching comments section) */
.bottom-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.bottom-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--accent-color);
}

.bottom-section-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bottom-section-title {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

.bottom-section-toggle {
  background: var(--button-color);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.bottom-section-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.bottom-section-toggle:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}


.bottom-section-content {
  overflow: hidden;
  height: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: top center;
  transition: 
    height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: height, opacity, transform;
}

.bottom-section.collapsed .bottom-section-content {
  height: 0;
  opacity: 0;
  transform: translateY(-20px) scale(0.98);
  pointer-events: none;
}

.bottom-section.collapsing .bottom-section-content {
  pointer-events: none;
}

.bottom-section.collapsed .bottom-section-toggle svg {
  transform: rotate(-90deg);
}

/* Bottom Section Preview (shown when collapsed) */
.bottom-section-preview {
  position: relative;
  height: 0;
  max-height: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transform-origin: top center;
  transition: 
    height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.05s,
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.25s ease;
  will-change: height, max-height, opacity, transform;
  pointer-events: none;
}

.bottom-section-preview:hover {
  transform: translateY(-2px) scale(1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.bottom-section.collapsed .bottom-section-preview {
  height: 120px;
  max-height: 120px;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.bottom-section-header {
  opacity: 1;
  max-height: 100px;
  transform: translateY(0);
  transition: 
    opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    max-height 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    margin 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    padding 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

.bottom-section.collapsed .bottom-section-header {
  opacity: 0;
  max-height: 0;
  transform: translateY(-10px);
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  pointer-events: none;
}

.preview-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  filter: blur(2px);
  transform: scale(1.1);
  transition: transform 0.4s ease, filter 0.3s ease;
}

.bottom-section-preview:hover .preview-banner {
  transform: scale(1.08);
  filter: blur(2.5px);
}

.preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.4) 100%);
}

.preview-content {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 1rem 1.5rem;
  gap: 1rem;
}

.preview-cover {
  height: 90px;
  width: auto;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bottom-section-preview:hover .preview-cover {
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.preview-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.preview-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-expand-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.preview-expand-hint svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-section-preview:hover .preview-expand-hint {
  background: var(--accent-color);
  color: #fff;
  transform: scale(1.05);
}

.bottom-section-preview:hover .preview-expand-hint svg {
  transform: translateY(2px);
}

/* Mobile adjustments for preview */
@media (max-width: 768px) {
  .bottom-section.collapsed .bottom-section-preview {
    height: 100px;
    max-height: 100px;
  }

  .preview-content {
    padding: 0.75rem 1rem;
  }

  .preview-cover {
    height: 70px;
  }

  .preview-title {
    font-size: 1rem;
  }

  .preview-meta {
    font-size: 0.75rem;
  }

  .preview-expand-hint span {
    display: none;
  }

  .preview-expand-hint {
    padding: 0.5rem;
    border-radius: 50%;
  }
}

/* Related Anime Section */
.related-anime-section {
  width: 100%;
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
}

.related-heading {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.related-anime-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
}

/* Deprecated - replaced by related-item-* classes below. Keeping for reference only. */
/* These old grid-based styles are no longer used */



.episodeinfo-container {
  order: 1;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bottom-section {
  grid-column: 1 / 2;
  /* First column */
  grid-row: 3 / 4;
  display: grid;
  flex-wrap: nowrap;

  align-items: flex-start;
  z-index: 1;
}

/*.controls-sub-dub {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}*/

.content-with-fade {
  position: relative;
  /* Needed for the fade to stick properly */
  overflow: hidden;
}

.season-list-fade {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: linear-gradient(transparent, var(--bg-secondary));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* .controls-sub-dub.expanded .season-list-fade {
  opacity: 0;
}

.controls-sub-dub.expanded {
  transition: 0.3s ease;
  max-height: none;
  height: auto;
  overflow: visible;
  padding-bottom: 5rem;
} */

.controls-sub-dub.scrollable .season-list-fade {
  opacity: 0;
}

@media screen and (min-width: 1225px) {

  .expand-button,
  .expand-button-eps {
    font-size: 0.6rem !important;
  }

}

.expand-button,
.expand-button-eps {
  width: 50%;
  position: sticky;
  bottom: 0;
  transform: translateX(50%);
  background-color: var(--button-color);
  color: var(--text-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s ease;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  /* Center the content inside the button */
}

/* Add SVG specific styles */
.expand-button svg,
.expand-button-eps svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.expand-button:hover,
.expand-button-eps:hover {
  background-color: var(--accent-color);
  transform: translateX(50%) translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.anime-details.scrollable {
  max-height: 350px;
  /* or whatever you want */
  overflow-y: auto;
}

@media screen and (min-width: 1225px) {
  .controls-sub-dub.scrollable {
    padding-right: 0.3rem;
    max-height: 554px;
    overflow-y: auto;
  }
}

.controls-sub-dub.scrollable {
  max-height: 554px;
  overflow-y: auto;
}

.expand-button:active,
.expand-button-eps:active {
  transform: translateX(50%) translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.controls-sub-dub {
  grid-column: 2 / 3;
  /* Second column in bottom section */
  transition: max-height 0.3s ease;
  border-radius: 8px;
  mask-image: linear-gradient(to bottom,
      black calc(100% - 50px),
      transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom,
      black calc(100% - 50px),
      transparent 100%);
  position: relative;
  overflow-y: auto;
  max-height: 504px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-top: 1rem;
  padding-right: 1rem;
  scrollbar-width: thin;
  background-color: var(--bg-secondary);
  /* Add background color */
  scrollbar-color: var(--text-primary) var(--bg-secondary);
  transition: scrollbar-color 0.3s ease;
  width: 100%;
  /* Take full width of its column */
  overflow: hidden;
}


@media screen and (min-width: 1225px) {
  .controls-sub-dub::-webkit-scrollbar {
    width: 6px;
    transition: opacity 0.3s ease;
  }

  .controls-sub-dub::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    transition: opacity 0.3s ease;
  }

  .controls-sub-dub::-webkit-scrollbar-thumb {
    transition: opacity 0.3s ease;
    background: var(--text-secondary);
    border-radius: 4px;
  }

  .bottom-section:-webkit-scrollbar {
    display: none;
    opacity: 0;
  }

  .bottom-section::-webkit-scrollbar-track {
    display: none;
    opacity: 0;
  }

  .bottom-section::-webkit-scrollbar-thumb {
    display: none;
    opacity: 0;
  }
}



.season-list-fade-container {
  position: relative;
  height: 100px;
  /* Adjust the height as needed */
}

.episodecontrols {
  display: none !important;
}

.episodecontrols button {
  display: none !important;
}

.episodecontrols input {
  display: none !important;
}

.controls {
  position: relative;
  z-index: 10;
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  width: 100%;
  justify-content: center;
}

.controls button {
  background-color: var(--button-color);
  color: var(--text-primary);
  flex: 0 1 auto;
  min-width: 60px;
  padding: 8px;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

.sub-dub .skeleton {
  min-width: 110px;
  height: 28px;
  /* Match the height of your sub-dub buttons */
  padding: 0;
  /* Remove padding that was causing extra height */
  margin-bottom: 0;
  border-radius: 4px;
}


.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.grid div {
  background-color: var(--bg-secondary);
  height: 40px;
  border-radius: 4px;
}



/*.anime-info {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}*/

.anime-info::-webkit-scrollbar {
  display: none !important;
  /* Chrome, Safari and Opera */
}

/* Also add to the details wrapper if it's scrollable */
.anime-details-wrapper {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.anime-details-wrapper::-webkit-scrollbar {
  display: none !important;
}

.rating-container {
  top: 0;
  right: 0;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--episode-container-rgb), 0.2);
}

.rating-label {
  font-weight: 500;
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rating-average {
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
}

.rating input:checked~label svg,
.rating input[data-was-checked="true"]~label svg {
  fill: var(--episode-container);
  stroke: var(--episode-container);
}

.rating label:hover svg,
.rating input:hover~label svg {
  fill: var(--episode-container);
  stroke: var(--episode-container);
}


/* Minimalist rating stars */
.rating {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.25rem;
}

.rating input {
  appearance: unset;
  display: none;
}

.rating label {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rating label:hover {
  transform: scale(1.1);
}

.rating svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: transparent;
  stroke: var(--text-secondary);
  stroke-width: 1.5;
  transition: fill 0.2s ease, stroke 0.2s ease, transform 0.15s ease;
}

.rating label:hover svg {
  stroke: var(--episode-container);
}

@media (max-width: 1224px) {
  .rating-container {
    position: relative;
    right: auto;
    width: 100%;
    background: var(--bg-secondary);
    padding: 0.75rem;
    flex-direction: column;
    align-items: center;
    border: none;
    border-radius: 8px;
  }

  .rating {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.35rem;
  }

  .rating svg {
    width: 1.75rem;
    height: 1.75rem;
  }

  .rating-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .rating-average {
    font-size: 0.7rem;
    margin-top: 0.25rem;
  }

  .anime-details h2 {
    width: 100% !important;
  }

  .next-airing-row {
    padding: 0;
  }

  .rating-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .rating-container {
    padding: 0.5rem;
  }

  .rating svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  .rating {
    gap: 0.2rem;
  }
}

/* Clean rating checked animation */
.rating input:checked~label svg {
  fill: var(--episode-container);
  stroke: var(--episode-container);
  animation: starPop 0.3s ease;
}

@keyframes starPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}


.anime-info {
  grid-column: 1 / 2;
  /* First column in bottom section */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  width: 100%;
  /* Take full width of its column */
  scrollbar-color: var(--text-primary) var(--bg-secondary);
  scrollbar-width: thin;
  transition: scrollbar-color 0.3s ease;
}

.anime-info-content {
  display: block;
  /* Change from flex to block */
  position: relative;
}

.comments-section.collapsed {
  max-height: 60px;
  /* Adjust this value as needed */
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.comments-section {
  grid-column: 1 / 2;
  /* Keep in first column */
  grid-row: 4 / 5;
  /* Keep in fourth row */
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  height: auto;
  /* Let it determine its own height */
  min-height: 100px;
  /* Set a minimum height */
}



.comments-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--accent-color);
  padding-bottom: 1rem;
}


#yaply_anime,
#yaply_episode {
  background: var(--button-color);
  color: var(--text-primary);
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: Montserrat, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  height: 36px;
}

#yaply_anime:hover,
#yaply_episode:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

#yaply_anime.active,
#yaply_episode.active {
  background: var(--episode-container);
  color: var(--text-primary);
  font-weight: 500;
}

#yaply_anime[selected],
#yaply_episode[selected] {
  background: var(--episode-container);
  color: var(--text-primary);
}

.comments-box {
  background: var(--bg-primary);
  border-radius: 8px;
  /* padding: 1rem; */
  min-height: 300px;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--accent-color);
}

.comments-title {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0;
  /* Remove default margins */
  line-height: 1.2;
  /* Add proper line height */
  vertical-align: middle;
  /* Align text vertically */
}

.comments-type {
  background: var(--bg-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
}

.comments-label {
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-secondary);
}



.comments-info {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.comments-label {
  background: var(--button-color);
  color: var(--text-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: center;
}

/* Desktop: Title takes more space, episode takes less */
#yaply_anime {
  flex: 3;
  max-width: none;
}

#yaply_episode {
  flex: 1;
  min-width: 120px;
}

.comments-label:hover {
  background: var(--accent-color);
  transform: translateY(-1px);
}

.comments-label.active {
  background: var(--accent-color);
  font-weight: 600;
}

.comments-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comments-toggle {
  background: var(--button-color);
  border: none;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.comments-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.comments-toggle:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

.comments-section.collapsed .comments-box {
  display: none;
}

.comments-section.collapsed .comments-toggle svg {
  transform: rotate(-90deg);
}

#yaply {
  transition: color 0.3s ease;
  color: var(--text-primary) !important;
}

#yaply {
  height: 500px;
  min-height: 1000px !important;
}

.yaply-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: calc(100vh - 200px);
}

.yaply-content {
  margin-top: 8rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.yaply-content h1 {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.yaply-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.yaply-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 30px 0;
}

#yaply {
  background: var(--bg-secondary);
  border-radius: 12px;
  /* padding: 20px; */
  border: 1px solid var(--border-color);
}

/* Improved mobile layout for comments section */
@media (max-width: 768px) {
  .comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .comments-left {
    width: 100%;
    justify-content: space-between;
  }

  .comments-info {
    padding-top: 0.5rem;
    width: 100%;
    display: flex;
    justify-content: stretch;
    gap: 0.5rem;
    flex-direction: column;
  }

  .comments-label {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-wrap: break-word;
    hyphens: auto;
  }

  /* Reset desktop flex ratios on mobile */
  #yaply_anime,
  #yaply_episode {
    flex: 1;
    min-width: auto;
  }

  .comments-section {
    padding: 1rem;
    min-height: 150px !important;
  }

  .comments-toggle {
    margin-left: auto;
  }

  #disqus_anime,
  #disqus_episode {
    height: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* For even smaller screens, adjust button sizes */
@media (max-width: 480px) {
  .comments-info {
    padding-right: 0.25rem;
    gap: 0.4rem;
  }

  .comments-label {
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
    min-height: 40px;
    line-height: 1.2;
  }
}

@media (max-width: 1224px) {
  .comments-section {
    grid-column: 1 / -1;
    /* Full width on mobile */
    padding: 1rem;
  }

  .comments-label {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    min-height: 44px;
  }
}

.anime-image-and-buttons {
  float: left;
  /* Add float to allow text wrapping */
  width: 220px;
  margin-right: 2rem;
}

.anime-cover {
  width: 220px;
  height: 350px;
  object-fit: cover;
  border-radius: 8px;
}

.top-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.external-links {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

@media (max-width: 1224px) {
  .anime-image-and-buttons {
    position: relative;
    width: 100%;
    border-radius: 8px;

  }

  .anime-cover-background {
    display: block !important;
    /* Show on mobile */
    position: absolute;
    z-index: 1;
    object-position: center 20%;
    max-height: 12rem;
    width: 100%;
    height: 12rem;
    border-radius: 8px;
    filter: brightness(0.2);
    opacity: 0.6;
  }

  .anime-cover {
    position: relative;
    z-index: 1;
    object-position: center 20%;
    max-height: 12rem;
    width: 100%;
    height: 12rem;
    object-fit: contain !important;
  }
}

.anime-cover-background {
  display: none;
  /* Hidden by default */
}

/* .external-links a {
  flex: 1; 
  height: 32px; 
  padding: 0.25rem; 
  border: none;
  border-radius: 4px;
  background: var(--button-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
} */

.main-buttons button:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

.main-buttons button svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
}

/* MAL and AL buttons specific sizing within main-buttons */
.main-buttons .mal-button svg {
  width: 32px;
  height: 32px;
}

.main-buttons .al-button svg {
  width: 24px;
  height: 24px;
}

.main-buttons button {
  position: relative;
}

.anime-buttons {
  width: 220px;
  /* Match anime cover width */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: visible;
}

/* Top row buttons (List, MAL, AL) */
.main-buttons {
  padding-top: 1rem;
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  width: 100%;
  position: relative;
  overflow: visible;
}

.main-buttons button {
  flex: 1;
  height: 40px;
  padding: 8px;
  background-color: var(--button-color);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}


.anime-buttons button {
  background-color: var(--button-color);
  color: var(--text-primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}


.anime-buttons button:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

@media (max-width: 1224px) {


  .anime-info-content {
    position: relative;
  }

  .anime-info {
    flex: 1 !important;
  }

  .anime-details-wrapper {
    overflow: hidden;
    overflow-y: auto;
    position: relative;
    /* Add this */
  }

  .anime-image-and-buttons {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .anime-details {
    mask-image: linear-gradient(to bottom,
        black calc(100% - 50px),
        transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom,
        black calc(100% - 50px),
        transparent 100%);
    position: relative;
    max-height: 300px;
    /* Changed from fixed height to max-height */
    overflow: hidden;
    transition: max-height 0.3s ease;
    /* Add smooth transition */
  }

  .anime-details.expanded {
    max-height: none;
    height: auto;
    overflow: visible;
    margin-bottom: 3rem;
  }

  .expand-button {
    bottom: 10px;
    z-index: 10;
    display: flex;
  }

  /* Hide fade when expanded */
  .anime-details-fade {
    opacity: 0;
  }

  /* Adjust button position when expanded */
  .anime-details.expanded .expand-button {
    bottom: -1rem;
  }
}




.anime-details.expanded .expand-button {
  bottom: -30px;
  /* position the button within the reserved space */
}

.anime-details-fade {

  display: none;
}




.episode-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  width: 100%;
  min-height: 90px;
  padding: 0;
  /* Remove padding from link */
  gap: 16px;
  align-items: center;
}


/* .anime-details {
  overflow: visible;
  margin: 0;
} */


.anime-details h2 {
  width: 75%;
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.anime-details h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.anime-details p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.anime-details p strong {
  color: var(--text-primary);
}

.anime-details .genre-tag {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline !important;
}

.anime-details .genre-tag:hover {
  color: var(--text-primary) !important;
}


/* Episode controls buttons */
.episodecontrols button:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* General buttons */
.controls button:hover {
  background-color: var(--accent-color);
  /*transform: translateY(-1px);*/
  transition: all 0.2s ease;
}

/* Episode items */
.episode:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Mobile nav buttons */
.mobile-nav button:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Sub/Dub buttons */
.sub-text:hover,
.dub-text:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.dropdown-btn-sub:hover,
.dropdown-btn-dub:hover {
  background-color: var(--accent-color);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.related:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}


.sub-text,
.dub-text,
.dropdown-btn-sub,
.dropdown-btn-dub {
  box-shadow: none;
}

/* SUB */

.dropdown-container-sub,
.dropdown-container-dub {
  position: relative;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));
  /* Replace box-shadow with filter */
  z-index: 1000;
  /* Add z-index to container */
}

.sub-text {
  font-weight: bold;
  padding: 10px 15px;
  background-color: var(--button-color);
  color: var(--text-primary);
  margin-right: 5px;
  border-radius: 5px 0 0 5px;
  height: 40px;
  width: 80px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


.sub-text svg {
  margin-right: 4px;
}

.sub-text:hover {
  background-color: var(--accent-color);
}

.dropdown-btn-sub {
  background-color: var(--button-color);
  color: var(--text-primary);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  border-radius: 0 5px 5px 0;
  height: 40px;
}

.dropdown-btn-sub:hover {
  background-color: var(--accent-color);
}

.dropdown-content-sub {
  z-index: 100;
  display: none;
  position: absolute;
  margin-top: 5%;
  top: 100%;
  left: 42.5%;
  background-color: var(--bg-secondary);
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.dropdown-content-sub a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content-sub a:hover {
  background-color: var(--accent-color)
}

.dropdown-content-sub a:hover {
  border-radius: 5px;
}

/*DUB*/


.dub-text {
  font-weight: bold;
  padding: 10px 15px;
  background-color: var(--button-color);
  color: var(--text-primary);
  margin-right: 5px;
  border-radius: 5px 0 0 5px;
  height: 40px;
  width: 80px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dub-text svg {
  margin-right: 4px;
}


.dub-text:hover {
  background-color: var(--accent-color);
}

.dropdown-btn-dub {
  background-color: var(--button-color);
  color: var(--text-primary);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  border-radius: 0 5px 5px 0;
  height: 40px;
}

.dropdown-btn-dub:hover {
  background-color: var(--accent-color);
}

.dropdown-content-dub {
  z-index: 100;
  display: none;
  position: absolute;
  margin-top: 5%;
  top: 100%;
  left: 42.5%;
  background-color: var(--bg-secondary);
  min-width: 160px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  border-radius: 5px;
}

.dropdown-content-dub a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content-dub a:hover {
  background-color: var(--accent-color);
}

.dropdown-content-dub a:hover {
  border-radius: 5px;
}

.sub-text.active {
  background: rgba(255, 140, 0, 0.2);
  /* Orange background with 20% opacity */
  border: 1px solid rgba(255, 140, 0, 0.8);
  /* Orange border with 80% opacity */
  color: var(--text-primary);
  /* Solid orange text */
}

.dub-text.active {
  background: rgba(40, 167, 69, 0.2);
  /* Green background with 20% opacity */
  border: 1px solid rgba(40, 167, 69, 0.8);
  /* Green border with 80% opacity */
  color: var(--text-primary);
  /* Solid green text */
}

/* Update the dropdown buttons to match when active */
.dropdown-btn-sub.active {
  background: rgba(255, 140, 0, 0.2);
  border: 1px solid rgba(255, 140, 0, 0.8);
  color: var(--text-primary);
}

.dropdown-btn-dub.active {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid rgba(40, 167, 69, 0.8);
  color: var(--text-primary);
}

/* Update SVG colors when active */
.sub-text.active svg {
  color: rgb(255, 140, 0);
}

.dub-text.active svg {
  color: rgb(40, 167, 69);
}

.episode-list.small-squares {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
  gap: 10px;
  padding: 10px 10px 12px 10px;
  justify-content: center;
  align-content: flex-start;
  justify-items: center;
  height: auto;
  overflow-y: auto !important;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

/* Special class for forced squares mode when there are many episodes */
.episode-list.small-squares.forced-squares {
  gap: 15px 15px !important;
}

@media screen and (max-width: 1224px) {
  .episode-list.small-squares.forced-squares {
    gap: 20px 10px !important;
    max-height: calc(100vh - 720px) !important;
    /* 5% taller */
    overflow-y: auto !important;
    /* Ensure scrolling works */
  }
  
  /* Ensure episode list container doesn't restrict height on mobile */
  .episode-list-container {
    overflow: visible !important;
    /* Allow content to expand */
    height: auto !important;
  }
  
  .episode-list {
    /* max-height: calc(100vh - 630px) !important; */
    /* 5% taller - override viewport-width calculation */
    min-height: 115px !important;
    overflow-y: auto !important;
  }
}

@media screen and (max-width: 768px) {
  .episode-list.small-squares.forced-squares {
    max-height: none !important;
    /* Remove height limit for forced squares to show all rows */
  }
}

.episode-list.small-squares .episode-link {
  min-height: unset;
  /* Remove minimum height for grid view */
  padding: 0;
}

.episode-list.small-squares .episode {
  min-height: unset;
  position: relative;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--button-color);
  border: 1px solid #ddd;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0.2s ease;
  overflow: visible;
  z-index: 1;
}


.episode-list.small-squares .episode:hover {
  transform: scale(1.1);
  transform-origin: center center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.episode-list.small-squares .episode-image-container,
.episode-list.small-squares .episode-content {
  display: none;
}

@media screen and (max-width: 768px) {
  .episode-list.small-squares {
    gap: 8px;
    padding: 8px;
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    justify-content: center;
    justify-items: center;
    scrollbar-gutter: stable;
  }

  .episode-list.small-squares .episode {
    font-size: 11px;
  }

  .episode-list.small-squares {
    max-height: calc(100vh - 720px);
    /* 5% taller */
    min-height: 115px;
    /* Slightly larger minimum */
    overflow-y: auto !important;
    /* Ensure scrolling always works */
  }

  /* For forced squares (many episodes), allow slightly more height */
  .episode-list.small-squares.forced-squares {
    max-height: calc(100vh - 630px) !important;
    /* 5% taller */
    min-height: 135px;
    overflow-y: auto !important;
  }

  .episode-list {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    max-height: calc(100vh - 500px);
    /* Much taller for regular list view to prevent cutoff */
    min-height: 200px;
    overflow-y: auto;
  }



  .side-content {
    grid-column: 2 / 3;
    /* Second column */
    grid-row: 3 / 4;
    height: auto;
    width: 100%;
    margin: 0 auto 1rem auto;
    box-sizing: border-box;
    padding-right: 0.6rem;
  }


  .anime-image-and-buttons {
    align-items: flex-start;
  }

  .anime-cover {
    object-position: center 20%;
    max-height: 12rem;
    width: 100%;
    height: 12rem;
    object-fit: cover;
  }

  .anime-buttons {
    width: 100%;
  }

  .video-player-wrapper {
    padding-bottom: 56.25%;
  }

  .episode {
    min-height: 90px;
  }

  .episode-image-container {
    width: 110px;
    height: 90px;
  }

  .episode-image-fade {
    width: 110px;
  }

  .episode-image-fade {
    width: 110px;
  }

  .episode-image {
    display: block;
    width: 110px;
    height: auto;
    aspect-ratio: 110 / 90;
    object-fit: cover;
  }

  .episode-content {
    padding: 0;
    justify-content: center;
  }

  .sub-text {
    font-weight: bold;
    padding: 8px 12px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 32px;
    /* Reduced height 20% */
    width: 64px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    /* Added smaller font */
  }

  .dropdown-btn-sub {
    padding: 6px 12px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 32px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .sub-text svg {
    margin-right: 4px;
    width: 14px;
    /* Reduced from 16px */
    height: 14px;
    /* Reduced from 16px */
    min-width: 14px;
    /* Match new size */
  }

  .dub-text {
    font-weight: bold;
    padding: 8px 12px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 32px;
    /* Reduced height 20% */
    width: 64px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    /* Added smaller font */
  }

  .dropdown-btn-dub {
    padding: 6px 12px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 32px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .dub-text svg {
    margin-right: 4px;
    width: 14px;
    /* Reduced from 16px */
    height: 14px;
    /* Reduced from 16px */
    min-width: 14px;
    /* Match new size */
  }


}

@media (min-width: 769px) and (max-width: 1224px) {
  .episode-list.small-squares {
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(35px, 1fr));
    padding: 10px;
    justify-content: center;
    justify-items: center;
    scrollbar-gutter: stable;
  }

  .episode-list.small-squares .episode {
    font-size: 11px;
  }

  .episode-list.small-squares {
    height: 500px;
  }




  .anime-image-and-buttons {
    align-items: flex-start;
  }

  .anime-cover {

    width: 100%;
    height: 20rem;
  }

  .anime-buttons {
    width: 100%;
  }

  .video-player-wrapper {
    padding-bottom: 56.25%;
  }

  .episode {
    padding: 0.75rem;
  }

  .episode-image-container {
    position: relative;
    width: 100px;
    height: 76px;
    left: 0.5rem;
    margin: 0;
  }

  .episode-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 100 / 76;
    object-fit: cover;
  }

  .episode-content {
    padding: 0;
    justify-content: center;
  }




  .sub-text {
    font-weight: bold;
    padding: 8px 12px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 32px;
    /* Reduced height 20% */
    width: 64px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    /* Added smaller font */
  }

  .dropdown-btn-sub {
    padding: 6px 12px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 32px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .sub-text svg {
    margin-right: 4px;
    width: 14px;
    /* Reduced from 16px */
    height: 14px;
    /* Reduced from 16px */
    min-width: 14px;
    /* Match new size */
  }

  .dub-text {
    font-weight: bold;
    padding: 8px 12px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 32px;
    /* Reduced height 20% */
    width: 64px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    /* Added smaller font */
  }

  .dropdown-btn-dub {
    padding: 6px 12px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 32px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .dub-text svg {
    margin-right: 4px;
    width: 14px;
    /* Reduced from 16px */
    height: 14px;
    /* Reduced from 16px */
    min-width: 14px;
    /* Match new size */
  }

}

@media (max-width: 450px) {
  .controls {
    gap: 4px;
    /* Reduce gap on mobile */
  }

  .controls button {
    padding: 4px 8px;
    /* Smaller padding */
    font-size: 12px;
    /* Smaller text */
    white-space: nowrap;
  }


  .anime-image-and-buttons {
    align-items: flex-start;
  }

  .anime-cover-background {
    height: 12rem;
    max-height: 12rem;
  }

  .anime-cover {
    width: 100%;
    height: 12rem;
  }

  .anime-buttons {
    width: 100%;
  }

  .video-player-wrapper {
    padding-bottom: 56.25%;
  }

  .episode {
    padding: 0.75rem;
  }

  .episode-image-container {
    position: relative;
    width: 100px;
    height: 76px;
    left: 0.5rem;
    margin: 0;
  }

  .episode-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 100 / 76;
    object-fit: cover;
  }

  .episode-content {
    padding: 0;
    justify-content: center;
  }


  .sub-text {
    font-weight: bold;
    padding: 6px 9px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 28px;
    /* Reduced height 20% */
    width: 56px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    /* Added smaller font */
  }

  .dropdown-btn-sub {
    padding: 5px 9px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 28px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .sub-text svg {
    margin-right: 4px;
    width: 12px;
    /* Reduced from 16px */
    height: 12px;
    /* Reduced from 16px */
    min-width: 12px;
    /* Match new size */
  }

  .dub-text {
    font-weight: bold;
    padding: 6px 9px;
    /* Reduced padding */
    margin-right: 4px;
    /* Reduced margin */
    border-radius: 4px 0 0 4px;
    height: 28px;
    /* Reduced height 20% */
    width: 56px;
    /* Reduced width 20% */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    /* Added smaller font */
  }

  .dropdown-btn-dub {
    padding: 5px 9px;
    /* Reduced padding */
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    height: 28px;
    /* Match sub-text height */
    font-size: 14px;
    /* Match sub-text font */
  }

  .dub-text svg {
    margin-right: 4px;
    width: 12px;
    /* Reduced from 16px */
    height: 12px;
    /* Reduced from 16px */
    min-width: 12px;
    /* Match new size */
  }

}

@media (min-width: 1225px) and (max-width: 1500px) {

  .anime-cover {
    width: 220px;
    height: 18rem;
  }

  .episode-list.small-squares .episode-number-overlay {
    font-size: 1.2rem;
  }

}

@media (max-width: 480px) {
  .controls {
    gap: 4px;
  }

  .controls button {
    min-width: 50px;
    padding: 4px;
    font-size: 11px;
  }

  .related-number-overlay {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 1224px) {
  .nav-buttons {
    display: none;
    /* Hide the nav buttons on mobile */
  }

  .skeleton {
    padding-bottom: 0;
    padding-top: 0;
  }

  @media (max-width: 1224px) {
    .container {
      grid-template-columns: 1fr;
      /* Single column on mobile */
      grid-template-rows: auto auto auto auto auto auto auto auto;
      /* Eight rows for each section including related anime */
      gap: 1rem;
      padding: 1rem;
      overflow: hidden;
      height: auto;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      padding-top: 7rem;
    }

    .wrapper {
      grid-column: 1 / -1;
      grid-row: 1 / 2;
      /* First row - video player */
    }

    .controls {
      grid-column: 1 / -1;
      grid-row: 2 / 3;
      /* Second row */
      display: flex;
      overflow: visible;
    }

    .episode-list-container {
      grid-column: 1 / -1;
      grid-row: 3 / 4;
      /* Third row */
      height: 300px;
      padding-right: 0.5rem !important;
      padding-left: 0.5rem !important;
    }

    .episode-list {
      grid-column: 1 / -1;
      grid-row: 3 / 4;
      /* Third row */
      max-height: 280px !important;
    }

    .info-container {
      grid-column: 1 / -1;
      grid-row: 4 / 5;
      /* Fourth row - episodeinfo-container */
    }

    .related-anime-container-grid {
      grid-column: 1 / -1;
      grid-row: 5 / 6;
      /* Fifth row - add related anime section */
      background: var(--bg-secondary);
      border-radius: 8px;
      padding: 1.5rem;
      margin-bottom: 1rem;
      display: flex;
      /* Make sure it's displayed */
      flex-direction: column;

    }

    .bottom-section {
      grid-column: 1 / -1;
      grid-row: 6 / 7;
      /* Sixth row - moved down */
      flex-direction: column;
    }

    .comments-section {
      grid-column: 1 / -1;
      grid-row: 7 / 8;
      /* Seventh row - moved down */
    }

    .side-content {
      grid-column: 1 / -1;
      grid-row: 8 / 9;
      /* Eighth row - moved down */
      height: auto;
      width: 100%;
      margin: 0 auto 1rem auto;
      box-sizing: border-box;
      padding-right: 0.6rem;
    }

    /* Ensure related anime grid works on mobile */
    .related-anime-container-grid .related-grid-compact {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }
  }

  .comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .comments-left {
    width: 100%;
    justify-content: space-between;
  }

  .comments-info {
    padding-top: 0.5rem;
    padding-left: 0.25rem;
  }

  .comments-section {
    padding: 1rem;
    min-height: 150px !important;
  }

  .comments-toggle {
    margin-left: auto;
  }

  #disqus_anime,
  #disqus_episode {
    height: 45px;
  }



  .related-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
  }

  .related-title {
    margin: 0;
  }

  .related-description {
    display: none;
  }

  .episode-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
  }

  .al-button svg {
    width: 38px;
    /* Even larger for MAL specifically */
    height: 38px;
  }

  .mal-button svg {
    width: 19px;
    /* Even larger for MAL specifically */
    height: 19px;
  }

}




/* ********************************** //
// This handles the quick search.    //
// *********************************/

.search-container {
  position: relative;
  width: 400px;
  margin: auto;
}

.search-results {
  margin-top: 8px;
  position: absolute;
  width: 100%;
  top: 100%;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.23s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1224px) {
  .search-results {
    right: 0;
  }
}

.search-result {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.23s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.23s ease-out forwards;
  position: relative;
  border-radius: 8px;
  margin: 2px 6px;
}

.search-results.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Custom scrollbar for search results */
.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.search-result:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.search-result:last-child {
  border-bottom: none;
}

.search-result img {
  width: 50px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  margin-right: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.23s ease;
}

.search-result:hover img {
  transform: scale(1.05);
}

.search-result-info {
  flex: 1;
  overflow: hidden;
}

.search-result-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 2.6em;
}

.search-result-desc {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.view-more {
  display: block;
  text-decoration: none;
  color: var(--text-primary);
  text-align: center;
  padding: 14px 20px;
  margin: 8px;
  background: linear-gradient(135deg, var(--button-color) 0%, rgba(var(--button-color), 0.8) 100%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.23s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-more:hover {
  background: linear-gradient(135deg, var(--accent-color) 0%, rgba(var(--accent-color), 0.9) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-result:nth-child(1) {
  animation-delay: 0.07s;
}

.search-result:nth-child(2) {
  animation-delay: 0.14s;
}

.search-result:nth-child(3) {
  animation-delay: 0.21s;
}

.search-result:nth-child(4) {
  animation-delay: 0.28s;
}

.search-result:nth-child(5) {
  animation-delay: 0.35s;
}

.search-result:nth-child(4) {
  animation-delay: 0.25s;
}

.search-result:nth-child(5) {
  animation-delay: 0.3s;
}

/* Responsive adjustments */
@media (max-width: 1224px) {
  .search-container {
    width: 100%;
    max-width: 300px;
  }

  .search-result img {
    width: 40px;
    height: 60px;
  }

  .search-result-desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .view-more {
    font-size: 0.9rem;
    /* Smaller font size */
  }

  .episode {
    padding: 0.75rem;
  }

  .episode-link {
    gap: 16px;
    min-height: 76px;
  }

  .episode-image-container {
    position: relative;
    width: 100px;
    height: 76px;
    left: 0.5rem;
    margin: 0;
  }

  .episode-content {
    padding: 0;
    justify-content: center;
  }
}






/* Player container */
#player-container {
  position: relative;
  width: 512px;
  height: 288px;
  margin: 0 auto;
  /* Center the player */
}

#skipButton {
  position: absolute;
  bottom: 120px;
  right: 20px;
  padding: 6px 16px;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
  pointer-events: all;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1000px) {
  #skipButton {
    bottom: 100px;
  }
}

@media (max-width: 400px) {
  #skipButton {
    bottom: 60px;
  }
}

#skipButton:hover {
  background: rgba(40, 40, 40, 0.8);
  transform: scale(1.02);
  color: #ffffff;
}

.jw-flag-fullscreen #skipButton {
  bottom: 110px;
  padding: 8px 20px;
  font-size: 14px;
}


/* THIS IS FOR THE ADD-TO-LIST BUTTON DROPDOWN */
.status-dropdown {
  position: absolute;
  bottom: 40px;
  left: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  min-width: 140px;
  max-width: 160px;
  min-height: 200px;
  max-height: 300px;
  z-index: 9999;
  display: none;
  transform-origin: bottom left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  overflow-x: hidden;
}

.status-dropdown.show {
  display: block;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(5px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Custom scrollbar for dropdown */
.status-dropdown::-webkit-scrollbar {
  width: 6px;
}

.status-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.status-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.status-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive positioning for dropdown */
@media (max-width: 768px) {
  .status-dropdown {
    right: 4px;
    top: 35px;
    min-width: 120px;
    max-width: 140px;
    min-height: 180px;
    max-height: 280px;
    transform-origin: top right;
  }
}

/* Mobile status dropdown adjustments - smaller and scrollable */
@media (max-width: 768px) {
  .status-dropdown {
    min-width: 120px;
    max-width: 140px;
    max-height: 160px;
    overflow-y: auto;
    font-size: 0.6rem;
    right: 4px;
  }

  .status-option {
    padding: 4px 6px;
    font-size: 0.55rem;
    gap: 4px;
  }

  .status-option-dot {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {

  /* Even smaller status dropdown for smallest screens */
  .status-dropdown {
    min-width: 130px;
    max-width: 150px;
    max-height: 140px;
    overflow-y: auto;
    font-size: 0.55rem;
    right: 2px;
  }

  .status-option {
    padding: 3px 4px;
    font-size: 0.5rem;
    gap: 3px;
  }

  .status-option-dot {
    width: 5px;
    height: 5px;
  }
}

.status-dropdown.show {
  display: block;
}

.status-option {
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--accent-color);
}

.status-option:last-child {
  border-bottom: none;
}

.status-option:hover {
  background: var(--accent-color);
}

.status-option-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Premium Grid Mobile Responsive Styles */
@media (max-width: 768px) {
  .premium-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    padding: 0.4rem;
  }

  .premium-card {
    height: 125px;
    border-radius: 8px;
  }

  .premium-card-image {
    height: 75px;
  }

  .premium-card-content {
    padding: 0.45rem;
  }

  .premium-card-title {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    margin-bottom: 0.25rem;
  }

  .premium-card-rank {
    padding: 2px 5px;
    font-size: 0.65rem;
    top: 5px;
    left: 5px;
  }

  .premium-card-meta {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .premium-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.35rem;
  }

  .premium-card {
    height: 115px;
    border-radius: 6px;
  }

  .premium-card-image {
    height: 70px;
  }

  .premium-card-content {
    padding: 0.4rem;
  }

  .premium-card-title {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .premium-card-meta {
    font-size: 0.65rem;
    gap: 0.2rem;
  }

  .premium-card-rank {
    padding: 2px 4px;
    font-size: 0.6rem;
    border-radius: 8px;
  }

  .premium-card-episodes svg {
    width: 10px;
    height: 10px;
  }
}