:root {
  --primary-color: #FF1493;
  --primary-variant: #FF69B4;
  --secondary-color: #FF69B4;
  --accent-color: #FF1493;
  --watched-label-bg: rgba(255, 20, 147, 0.85);
  --surface-color: #000000;
  --surface-variant: #0A0A0A;
  --on-surface-color: #FFFFFF;
  --background-color: #000000;
  --error-color: #FF1493;
  --shadow-color: rgba(255, 20, 147, 0.12);
  --scrim-color: rgba(0, 0, 0, 0.7);
  --transition-speed: 0.2s;
  --card-hover-scale: 1.02;
  --border-radius-small: 6px;
  --border-radius-medium: 12px;
  --border-radius-large: 18px;
  --elevation-1: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --elevation-2: 0 2px 4px 0 rgba(0, 0, 0, 0.3);
  --elevation-3: 0 4px 8px 0 rgba(0, 0, 0, 0.3);
  --font-size-title: 1.6rem;
  --font-size-subtitle: 1.3rem;
  --font-size-card-title: 1rem;
  --font-size-card-text: 0.85rem;
  --font-size-button: 0.85rem;
  --spacing-xs: 4px;
  --spacing-s: 8px;
  --spacing-m: 14px;
  --spacing-l: 20px;
  --spacing-xl: 28px;
  --spacing-xxl: 40px;
  --header-height-desktop: 64px;
  --header-height-mobile-medium: 120px;
  --header-height-mobile-small: 130px;
}

.light-mode {
  --primary-color: #E91E63;
  --primary-variant: #C2185B;
  --watched-label-bg: rgba(233, 30, 99, 0.85);
  --secondary-color: #FF4081;
  --accent-color: #FF80AB;
  --surface-color: #FFFFFF;
  --surface-variant: #F6F6F6;
  --on-surface-color: #1C1C1E;
  --background-color: #F5F5F5;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --error-color: #B00020;
  --scrim-color: rgba(255, 255, 255, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--on-surface-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

.header-carousel-wrapper {
  background: var(--background-color);
}

header {
  height: var(--header-height-desktop);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-s) 0;
  background-color: var(--surface-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--elevation-2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  padding: 0 var(--spacing-m);
  gap: var(--spacing-m);
}

#app-title {
  text-align: center;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: var(--font-size-title);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  background: linear-gradient(45deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  animation: titleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from {
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
  }
  to {
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  }
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  flex-wrap: wrap;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--on-surface-color);
  white-space: nowrap;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface-variant);
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

@media (max-width: 768px) {
  .toggle-label {
    display: none;
  }
}

.carousel-heading {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  margin-top: var(--header-height-desktop);
  padding: var(--spacing-m) var(--spacing-m) var(--spacing-s);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  z-index: 5;
  font-family: 'Poppins', sans-serif;
  text-shadow: 0 0 10px rgba(233, 30, 99, 0.3);
}

.carousel-heading .material-icons-round {
  color: var(--primary-color);
  font-size: 24px;
  font-family: 'Material Icons Round';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

#carousel-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--spacing-l);
  height: 240px;
  overflow: hidden;
  background-color: var(--background-color);
  perspective: 1500px;
  transform: translateZ(0);
  will-change: transform;
}

#carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.carousel-container {
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-item {
  position: absolute;
  width: 360px;
  height: 200px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), opacity 0.6s ease;
  will-change: transform, opacity;
}

.carousel-item-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.5s ease;
  transform-origin: center center;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.carousel-item:hover .carousel-item-inner {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.carousel-item:hover img {
  transform: scale(1.05);
}

.carousel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-medium);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.carousel-item:hover::before {
  opacity: 0.1;
}

.carousel-item-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0) 100%);
  padding: var(--spacing-m);
  color: white;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.carousel-item-content h3 {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-xs);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  font-family: 'Poppins', sans-serif;
}

.carousel-item-content p {
  font-size: 0.9rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  max-width: 90%;
  line-height: 1.4;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.carousel-nav:hover {
  background-color: var(--primary-color);
}

#carousel-prev { left: 10px; }
#carousel-next { right: 10px; }

#carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  position: relative;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-variant);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
}

.carousel-dot.active {
  background: var(--primary-color);
  width: 20px;
  border-radius: 4px;
}

.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  color: var(--on-surface-color);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  transition: background-color var(--transition-speed) ease;
}

.icon-button:hover {
  background-color: rgba(233, 30, 99, 0.1);
}

.primary-button, .secondary-button, .action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  padding: var(--spacing-s) var(--spacing-m);
  border: none;
  border-radius: 24px;
  font-weight: 500;
  font-size: var(--font-size-button);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.primary-button {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--elevation-1);
}

.primary-button:hover {
  background-color: var(--primary-variant);
  box-shadow: var(--elevation-2);
}

.secondary-button {
  background-color: var(--secondary-color);
  color: white;
  box-shadow: var(--elevation-1);
}

.secondary-button:hover {
  background-color: var(--primary-color);
  box-shadow: var(--elevation-2);
}

.action-button {
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
}

.action-button:hover {
  background-color: var(--primary-color);
  color: white;
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  padding: var(--spacing-s) var(--spacing-m);
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  border: none;
  border-radius: 24px;
  cursor: pointer;
  margin-bottom: var(--spacing-m);
  margin-left: var(--spacing-m);
  transition: all var(--transition-speed) ease;
}

.back-button:hover {
  background-color: var(--primary-color);
  color: white;
}

#back-to-home {
  margin-left: var(--spacing-m);
  margin-right: var(--spacing-m);
  margin-bottom: 0;
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--elevation-1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  z-index: 10;
  height: 30px;
  width: auto;
  font-size: 0.8rem;
  position: absolute;
  top: 4px;
  right: var(--spacing-m);
}

#back-to-home:hover {
  background-color: var(--primary-variant);
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.dropdown-select {
  padding: var(--spacing-s) 40px var(--spacing-s) var(--spacing-m);
  height: 40px;
  border: 1px solid var(--surface-variant);
  border-radius: 20px;
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  outline: none;
  box-shadow: var(--elevation-1);
  cursor: pointer;
  font-size: var(--font-size-button);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="%23E1E1E1" d="M7 10l5 5 5-5z"/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
  vertical-align: middle;
  line-height: 1.5;
}

.light-mode .dropdown-select {
     background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"%3E%3Cpath fill="%231C1C1E" d="M7 10l5 5 5-5z"/%3E%3C/svg%3E');
     border-color: #E0E0E0;
}

.dropdown-select:hover, .dropdown-select:focus {
  background-color: var(--surface-color);
  border-color: var(--primary-color);
}

.dropdown-select option {
    background-color: var(--surface-color);
    color: var(--on-surface-color);
}

.search-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--scrim-color);
  display: none;
  z-index: 1001;
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.search-backdrop.show {
  display: flex;
  opacity: 1;
}

.floating-search {
  background: var(--surface-color);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-large);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--elevation-3);
  position: relative;
}

.close-search {
  position: absolute;
  top: var(--spacing-s);
  right: var(--spacing-s);
}

.floating-search input[type="text"] {
  width: 100%;
  padding: var(--spacing-m);
  margin-bottom: var(--spacing-m);
  border: none;
  border-radius: var(--border-radius-medium);
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  font-size: 16px;
  outline: none;
}

.floating-search .search-type-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-m);
}

.content-wrapper {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

.trending-section {
  width: 100%;
  margin: 0 auto var(--spacing-xl);
  padding: 0 var(--spacing-m);
  text-align: left;
  position: relative;
}

.trending-section h2 {
  font-size: var(--font-size-subtitle);
  margin-bottom: var(--spacing-m);
  color: var(--on-surface-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  padding: var(--spacing-s) 0;
}

#popular-manga-section,
#latest-updates-manga-section {
  width: 100%;
  margin: 0 auto var(--spacing-xl);
  padding: 0 var(--spacing-m);
  text-align: left;
  position: relative;
}

#popular-manga-section h2,
#latest-updates-manga-section h2 {
  font-size: var(--font-size-subtitle);
  margin-bottom: var(--spacing-m);
  color: var(--on-surface-color);
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  padding: var(--spacing-s) 0;
}

.filter-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: var(--spacing-m);
  flex-wrap: wrap;
  gap: var(--spacing-m);
  width: 100%;
}

.sort-by, .genre-filter {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-s);
  width: 100%;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.card, .manga-card {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-medium);
  overflow: hidden;
  box-shadow: var(--elevation-1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease,
              box-shadow 0.2s ease,
              background-color 0.2s ease;
  position: relative;
  width: 100%;
  transform-origin: center bottom;
}

.card:hover, .manga-card:hover {
  transform: translateY(-5px);
  background-color: var(--surface-variant);
  box-shadow: var(--elevation-2);
}

.card img, .manga-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.card:hover img, .manga-card:hover img {
  transform: scale(1.03);
}

.card-content {
  padding: var(--spacing-m) var(--spacing-m) var(--spacing-s);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  text-align: left;
  min-height: 60px;
}

.card-content h3 {
  margin: 0 0 var(--spacing-s) 0;
  font-size: var(--font-size-card-title);
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: left;
}

.card-content p {
  margin: 0;
  font-size: var(--font-size-card-text);
  color: var(--on-surface-color);
  opacity: 0.7;
  text-align: center;
  margin-top: var(--spacing-xs);
}

.light-mode .card-content p {
    opacity: 0.7;
    color: var(--on-surface-color);
}

.watchlist-btn, .remove-item-btn {
  position: absolute;
  z-index: 10;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border: none;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed) ease, transform 0.2s ease, background-color var(--transition-speed) ease;
  overflow: hidden;
}

.watchlist-btn > .material-icons-round,
.remove-item-btn > .material-icons-round {
    font-family: 'Material Icons Round', 'Material Icons', sans-serif !important;
    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: normal !important;
    font-style: normal !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-wrap: normal !important;
    white-space: nowrap !important;
    direction: ltr !important;
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    font-feature-settings: 'liga' !important;
    -webkit-font-feature-settings: 'liga' !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -moz-osx-font-smoothing: grayscale;
}

.watchlist-btn {
  bottom: 6px;
  left: 6px;
}

.remove-item-btn {
  top: var(--spacing-s);
  left: var(--spacing-s);
}

.watchlist-btn:hover {
  color: var(--primary-color);
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.8);
}

.remove-item-btn:hover {
  color: var(--error-color);
  transform: scale(1.1);
  background-color: rgba(0, 0, 0, 0.8);
}

.card-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: var(--spacing-m);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  pointer-events: none;
  border-radius: var(--border-radius-large);
}

.card:hover .card-tooltip {
  opacity: 1;
}

.manga-card .card-tooltip {
    display: none;
}

.card-tooltip p {
  margin: var(--spacing-xs) 0;
}

.card-tooltip .rating {
  font-size: 1.2em;
  color: var(--primary-color);
  font-weight: bold;
}

.see-more-container {
  text-align: center;
  margin-top: var(--spacing-l);
}

#embed-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--scrim-color);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

#embed-modal.show { display: flex; }

#embed-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  background-color: var(--surface-color);
  padding: var(--spacing-l);
  padding-top: calc(var(--spacing-l) + 100px);
  border-radius: var(--border-radius-large);
  box-shadow: var(--elevation-3);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#embed-content .close-button {
    position: absolute;
    top: var(--spacing-s);
    right: var(--spacing-s);
    z-index: 1;
}

.watching-area-title {
  position: absolute;
  top: calc(var(--spacing-m) + 25px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--primary-color);
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 8px 0;
  margin: 0 auto;
  width: 100%;
}

.embed-top-controls {
  margin-top: 80px;
  margin-bottom: var(--spacing-m);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-m);
  flex-wrap: wrap;  position: relative;
  z-index: 5;
}

#content-rating-display {
  background-color: hotpink;
  color: black;
  padding: var(--spacing-s) var(--spacing-m);
  border-radius: var(--border-radius-medium);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  flex-shrink: 0;
}

.rating-description-box {
  margin: 0 0 var(--spacing-m) 0;
  padding: var(--spacing-s) var(--spacing-m);
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  font-size: 0.9rem;
  width100%;
  box-sizing: border-box;
}

.rating-description-box p {
  margin: 0;
  color: var(--on-surface-variant);
  font-style: italic;
}

.api-selector {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.api-selector label {
  margin-right: var(--spacing-s);
  font-weight: 500;
}

.selectors {
  display: flex;
  gap: var(--spacing-m);
  margin-bottom: var(--spacing-m);
  flex-wrap: wrap;
}

#embed-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 60vh;
  border: none;
  border-radius: var(--border-radius-medium);
  margin-bottom: var(--spacing-m);
  background-color: #000;
}

.embed-buttons {
  display: flex;
  gap: var(--spacing-m);
  margin-bottom: var(--spacing-m);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 600px) {
  .embed-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-s);
  }

  .embed-buttons .action-button {
    padding: var(--spacing-s);
    border-radius: var(--border-radius-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    gap: var(--spacing-xs);
    height: auto;
    min-height: 64px;
  }

  .embed-buttons .action-button .material-icons-round {
    font-size: 24px;
  }

  #back-button {
    position: absolute;
    top: var(--spacing-m);
    left: var(--spacing-m);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    z-index: 10;
    padding: var(--spacing-s);
    min-height: auto;
    width: auto;
    font-size: 0;
    flex-direction: row;
  }

  #back-button .material-icons-round {
    font-size: 20px;
  }
}

#embed-details {
  padding: var(--spacing-m);
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  margin-top: var(--spacing-m);
  text-align: left;
}
#embed-details h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-s);
    color: var(--primary-color);
}
#embed-details p {
    margin-bottom: var(--spacing-s);
    line-height: 1.5;
}
#embed-details p strong {
    font-weight: 500;
    color: var(--on-surface-color);
    margin-right: var(--spacing-xs);
}
#embed-details hr {
    border: 0;
    height: 1px;
    background-color: var(--surface-color);
    margin: var(--spacing-m) 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--surface-variant);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  top: 50%;
  left: 50%;
  margin-top: -25px;
  margin-left: -25px;
  z-index: 3000;
  animation: spin 1s linear infinite;
}

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

.whats-new-backdrop,
.tutorial-backdrop,
.ai-chat-backdrop {
  position: fixed;
  z-index: 2100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--scrim-color);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
  pointer-events: none;
}

.whats-new-backdrop.show,
.tutorial-backdrop.show,
.ai-chat-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.whats-new-content,
.tutorial-content,
.ai-chat-modal {
  position: relative;
  background-color: var(--surface-color);
  padding: var(--spacing-l);
  border-radius: var(--border-radius-large);
  box-shadow: var(--elevation-3);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  color: var(--on-surface-color);
  text-align: left;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.whats-new-backdrop.show .whats-new-content,
.tutorial-backdrop.show .tutorial-content,
.ai-chat-backdrop.show .ai-chat-modal {
  transform: scale(1);
  opacity: 1;
}

.whats-new-content h2,
.tutorial-content h2,
.ai-chat-modal h2 {
  text-align: center;
  margin-top: 0;
  margin-bottom: var(--spacing-m);
  color: var(--primary-color);
  font-family: 'Poppins', sans-serif;
}

.whats-new-content .close-button,
.tutorial-content .close-button,
.ai-chat-modal .close-button {
  position: absolute;
  top: var(--spacing-s);
  right: var(--spacing-s);
  z-index: 1;
}

#changelog-content ul,
#tutorial-text ul {
  list-style: none;
  padding-left: 0;
}#changelog-content li,
#tutorial-text li {
  margin-bottom: var(--spacing-m);
  padding-left: var(--spacing-l);
  position: relative;
  line-height: 1.5;
}

#changelog-content li::before,
#tutorial-text ul li::before {
  content: '✓';
  color: var(--primary-variant);
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 2px;
}

#changelog-content h3,
.tutorial-content h3 {
    margin-top: var(--spacing-l);
    margin-bottom: var(--spacing-s);
    color: var(--secondary-color);
    border-bottom: 1px solid var(--surface-variant);
    padding-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}
#changelog-content h3:first-of-type,
.tutorial-content h3:first-of-type {
    margin-top: 0;
}

.tutorial-content p {
    line-height: 1.6;
    margin-bottom: var(--spacing-m);
}

.tutorial-content strong {
    color: var(--primary-color);
    font-weight: 500;
}

.tutorial-content hr {
    border: 0;
    height: 1px;
    background-color: var(--surface-variant);
    margin: var(--spacing-l) 0;
}

.tutorial-content .final-link {
    text-align: center;
    margin-top: var(--spacing-l);
    font-style: italic;
}
.tutorial-content .final-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}
.tutorial-content .final-link a:hover {
    text-decoration: underline;
}

.ai-chat-modal {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  max-height: 80vh;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--surface-variant);
  padding-bottom: var(--spacing-m);
  margin-bottom: var(--spacing-m);
}

.ai-chat-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  color: var(--primary-color);
  font-size: 1.3rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

.ai-chat-title .material-icons-round {
  font-size: 24px;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: var(--spacing-m);
  padding: var(--spacing-s) var(--spacing-s);
  border-radius: var(--border-radius-medium);
  background-color: rgba(0, 0, 0, 0.2);
  max-height: 50vh;
  min-height: 200px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) var(--surface-variant);
}

.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: var(--surface-variant);
  border-radius: 10px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.ai-message, .user-message {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-l);
  animation: messageSlideIn 0.3s ease forwards;
  position: relative;
  width: 100%;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  justify-content: flex-end;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  margin-top: 2px;
}

.message-content {
  flex: 0 1 auto;
  line-height: 1.5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  max-width: 80%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  margin: 0;
  min-width: 60px;
}

.ai-message .message-content {
  background-color: var(--surface-color);
  display: inline-block;
  max-width: 80%;
  width: fit-content;
  border-radius: 4px 18px 18px 18px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  color: var(--on-surface-color);
  transition: all 0.2s ease;
  padding: var(--spacing-s) var(--spacing-m);
  margin-left: var(--spacing-xs);
  text-align: left;
  text-indent: 0;
  white-space: normal;
}

.ai-message {
  align-items: flex-start;
  gap: var(--spacing-xs);
}

.ai-message .message-content:hover {
  background-color: var(--surface-variant);
}

.user-message .message-content {
  background-color: var(--primary-color);
  color: white;
  text-align: left;
  font-weight: 500;
  display: inline-block;
  max-width: 80%;
  width: auto;
  align-self: flex-end;
  margin-left: auto;
  border-radius: 18px 4px 18px 18px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  padding: var(--spacing-s) var(--spacing-m);
}

.user-message {
  justify-content: flex-end;
  align-items: flex-end;
}

.user-message .message-content:hover {
  background-color: var(--primary-variant);
}

.real-time-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 12px;
  background-color: var(--primary-color);
  color: white;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.real-time-indicator .material-icons-round {
  font-size: 14px;
  animation: rotate 2s linear infinite;
}

.ai-chat-input-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  margin-top: var(--spacing-s);
}

#ai-chat-input {
  flex: 1;
  padding: var(--spacing-m);
  border: 1px solid var(--surface-variant);
  border-radius: var(--border-radius-medium);
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  font-family: inherit;
  font-size: 1rem;
  resize: none;
  min-height: 60px;
  outline: none;
  transition: border-color 0.2s ease;
}

#ai-chat-input:focus {
  border-color: var(--primary-color);
}

#ai-send-message {
  height: 40px;
  width: 40px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ai-send-message:hover {
  background-color: var(--primary-variant);
}

#ai-send-message .material-icons-round {
  font-size: 20px;
}

.ai-thinking {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: var(--spacing-s);
}

.ai-thinking span {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: thinking 1.4s infinite ease-in-out both;
}

.ai-thinking span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking span:nth-child(2) { animation-delay: -0.16s; }

@keyframes thinking {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 768px) {
  header { height: auto; padding: var(--spacing-s) 0; }
  .header-content {
    flex-direction: column;
    padding: var(--spacing-s);
    gap: var(--spacing-s);
  }

  #app-title { font-size: 1.5rem; }

  .carousel-heading {
    margin-top: var(--header-height-mobile-medium);
    font-size: 1.2rem;
    padding: var(--spacing-m) var(--spacing-m) var(--spacing-s);
  }

  #carousel-container {
    margin-top: 0;
  }

  .carousel-item img { height: 250px; }
  .carousel-item-content h3 { font-size: 1.2rem; }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--spacing-s);
  }

  .card img, .manga-card img { aspect-ratio: 2 / 3; height: auto; }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-controls .dropdown-select { width: 100%; }

  #embed-content {
    width: 95%;
    margin: 2% auto;
    padding: var(--spacing-m);
    max-height: 95vh;
  }
  #embed-content iframe { max-height: 45vh; }
  .embed-buttons { justify-content: center; }

  .whats-new-content,
  .tutorial-content,
  .ai-chat-modal {
      width: 95%;
      max-height: 85vh;
      padding: var(--spacing-m);
  }

  .ai-chat-messages {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .header-controls { gap: var(--spacing-xs); }
  .icon-button { width: 36px; height: 36px; }
  .dropdown-select, .primary-button, .secondary-button, .action-button, .back-button {
    padding: var(--spacing-xs) var(--spacing-s);
    font-size: 0.8rem;
  }
  .dropdown-select { height: 36px; }

  #app-title { font-size: 1.3rem; }

  .carousel-heading {
    margin-top: var(--header-height-mobile-small);
    font-size: 1.1rem;
    padding: var(--spacing-m) var(--spacing-m) var(--spacing-s);
  }

  #carousel-container {
    margin-top: 0;
  }

  .carousel-item img { height: 180px; }
  .carousel-item-content h3 { font-size: 1rem; }
  .carousel-item-content p { font-size: 0.8rem; }
  .carousel-nav { width: 30px; height: 30px; font-size: 1rem; }
  #carousel-prev { left: var(--spacing-s); }
  #carousel-next { right: var(--spacing-s); }
  .carousel-dot { width: 8px; height: 8px; }

   .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-s);
  }

  .card-content h3 { font-size: 0.9rem; }
  .card-content p { font-size: 0.8rem; }
  .card img, .manga-card img { aspect-ratio: 2 / 3; height: auto; }
  .watchlist-btn, .remove-item-btn { width: 32px; height: 32px; }
  .watchlist-btn > .material-icons-round,
  .remove-item-btn > .material-icons-round { font-size: 18px !important; }

  #embed-content iframe { max-height: 40vh; }
  .selectors { flex-direction: column; align-items: stretch; }
  .selectors .dropdown-select { width: 100%; }

   .whats-new-content h2,
   .tutorial-content h2,
   .ai-chat-modal h2 { font-size: 1.5rem; }

   .whats-new-content,
   .tutorial-content,
   .ai-chat-modal { padding: var(--spacing-s); }

   #changelog-content li,
   #tutorial-text li { padding-left: var(--spacing-m); }

   #changelog-content h3,
   .tutorial-content h3 { font-size: 1rem; }

   .ai-chat-messages {
     min-height: 150px;
     max-height: 35vh;
   }

   .ai-message, .user-message {
     gap: var(--spacing-s);
   }

   .ai-avatar, .user-avatar {
     width: 30px;
     height: 30px;
   }

   .message-content {
     padding: var(--spacing-s);
     font-size: 0.9rem;
   }
}

@keyframes blinking-red {
  0% { background-color: transparent; box-shadow: none; }
  50% { background-color: rgba(207, 102, 121, 0.3); box-shadow: 0 0 8px rgba(207, 102, 121, 0.5); }
  100% { background-color: transparent; box-shadow: none; }
}

#whats-new-button.blink {
  animation: blinking-red 1.5s infinite ease-in-out;
  border-radius: 50%;
}

#trakt-login {
  position: relative;
  cursor: pointer;
}

#trakt-login::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: transparent;
  border-radius: 50%;
  right: 8px;
  bottom: 8px;
  transition: background-color 0.3s ease;
}

#trakt-login.logged-in::after {
  background-color: #32CD32;
}

.account-popup {
  position: fixed;
  z-index: 2200;
  min-width: 250px;
  background-color: var(--surface-color);
  border-radius: var(--border-radius-medium);
  box-shadow: var(--elevation-3);
  overflow: hidden;
  animation: popup-appear 0.3s ease forwards;
  transform-origin: top right;
  transition: top 0.2s ease;
}

@keyframes popup-appear {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.account-popup-content {
  padding: 0;
}

.account-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  padding: var(--spacing-m);
  background-color: var(--surface-variant);
  border-bottom: 1px solid rgba(255, 20, 147, 0.2);
}

.user-avatar-container {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  flex-shrink: 0;
  background-color: rgba(255, 20, 147, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info {
  flex: 1;
}

.user-info h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.user-info p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.account-actions {
  padding: var(--spacing-s);
}

.account-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  width: 100%;
  padding: var(--spacing-m);
  margin-bottom: var(--spacing-xs);
  border: none;
  background-color: transparent;
  color: var(--on-surface-color);
  font-size: 0.9rem;
  text-align: left;
  border-radius: var(--border-radius-medium);
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.account-button:last-child {
  margin-bottom: 0;
}

.account-button:hover {
  background-color: rgba(255, 20, 147, 0.1);
}

.account-button .material-icons-round {
  font-size: 20px;
  color: var(--primary-color);
}

#logout-button .material-icons-round {
  color: var(--error-color);
}

#logout-button:hover {
  color: var(--error-color);
}

.light-mode .account-button:hover {
  background-color: rgba(233, 30, 99, 0.1);
}

#whats-new-button .material-icons-round,
#tutorial-button .material-icons-round,
#trakt-login .material-icons-round,
#ai-chat .material-icons-round {
    font-size: 24px;
}

#ai-chat {
    position: relative;
    overflow: visible;
}

#ai-chat::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 20, 147, 0.2);
    top: 0;
    left: 0;
    z-index: -1;
    animation: pulse 2s infinite;
    pointer-events: none;
}

.ai-chat-backdrop .ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ai-chat-backdrop .ai-avatar .material-icons-round {
    font-size: 20px;
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.6; }
}

#changelog-content .material-icons-round {
    font-size: 1em;
    vertical-align: middle;
    margin: 0 2px;
}

.settings-popup-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--scrim-color);
  z-index: 1001;
  display: none;
  backdrop-filter: blur(5px);
}

.settings-popup-menu {
  position: fixed;
  z-index: 1002;
  background-color: var(--surface-color);
  border-radius: var(--border-radius-large);
  box-shadow: var(--elevation-3);
  min-width: 280px;
  max-width: 90%;
  overflow: hidden;
  display: none;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.95);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.settings-popup-menu.slide-in {
  opacity: 1;
  transform: scale(1);
}

.settings-popup-content {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-l);
  max-height: 80vh;
  overflow-y: auto;
}

.settings-popup-title {
  text-align: center;
  margin-top: 0;
  margin-bottom: var(--spacing-m);
  color: var(--primary-color);
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}

.settings-popup-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  padding: var(--spacing-m);
  cursor: pointer;
  color: var(--on-surface-color);
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  font-size: 0.9rem;
  font-family: 'Roboto', sans-serif;
  transition: all var(--transition-speed) ease;
  border-radius: var(--border-radius-medium);
  margin-bottom: var(--spacing-xs);
}

.settings-popup-item .material-icons-round {
  color: var(--primary-color);
  font-size: 20px;
  flex-shrink: 0;
}

.settings-popup-item:hover {
  background-color: var(--surface-variant);
  transform: translateY(-2px);
}

.settings-popup-dropdown {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-s) var(--spacing-m);
  gap: var(--spacing-s);
}

.settings-popup-dropdown-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  color: var(--on-surface-color);
  font-size: 0.9rem;
}

.settings-popup-dropdown-label .material-icons-round {
  color: var(--primary-color);
  font-size: 20px;
  flex-shrink: 0;
}

.settings-popup-select {
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: var(--border-radius-small);
  border: 1pxsolid var(--surface-variant);
  background-color: var(--surface-color);
  color: var(--on-surface-color);
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
}

.settings-popup-select:hover, .settings-popup-select:focus {
  border-color: var(--primary-color);
}

.settings-popup-separator {
  height: 1px;
  background-color: var(--surface-variant);
  margin: var(--spacing-s) var(--spacing-m);
}

.mode-select-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.mode-select {
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: 20px;
  border: 1px solid var(--surface-variant);
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 135px;
  height: 40px;
}

.mode-select:hover, .mode-select:focus {
  border-color: var(--primary-color);
  background-color: var(--surface-color);
}

#settings-toggle {
  margin-left: var(--spacing-xs);
}

#trakt-login {
  margin-left: var(--spacing-xs);
}

@media (max-width: 480px) {
  #settings-toggle, #trakt-login {
    margin-left: 2px;
  }
}

.account-popup .close-popup-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--on-surface-color);
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1;
}
.account-popup .close-popup-btn:hover {
    opacity: 1;
    color: var(--primary-color);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background-color: var(--surface-color);
  color: var(--on-surface-color);
  border-left: 4px solid var(--primary-color);
  padding: 12px 20px;
  border-radius: var(--border-radius-medium);
  box-shadow: var(--elevation-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast .material-icons-round {
  color: var(--primary-color);
  font-size: 20px;
}

.toast-message {
  flex: 1;
}

.sync-count {
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-left: 5px;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--on-surface-color);
  opacity: 0.7;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-left: auto;
}

.toast-close:hover {
  opacity: 1;
  color: var(--primary-color);
}

@media (max-width: 480px) {
  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 20px;
  }
  .toast {
    max-width: none;
    width: calc(100% - 20px);
  }
}

.account-stats {
  padding: var(--spacing-m);
  background-color: var(--surface-color);
}

.account-stats h4 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: var(--spacing-m);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  font-weight: 500;
  border-bottom: 1px solid var(--surface-variant);
  padding-bottom: var(--spacing-s);
}

.account-stats h4::before {
  content: none;
}

#stats-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  font-size: 0.85rem;
  padding: var(--spacing-m) 0;
  color: var(--on-surface-color);
  opacity: 0.7;
}

#stats-content {}

.stats-section {
  margin-bottom: 0;
}
.stats-section h5 {
  display: none;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-s) 0;
}

.stats-row + .stats-row {
   border-top: 1px solid var(--surface-variant);
}


.stats-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-s);
    font-size: 0.9rem;
    color: var(--on-surface-color);
    opacity: 0.8;
}

.stats-label .material-icons-round {
    font-size: 18px;
    color: var(--secondary-color);
}

.stats-value-group {
    text-align: right;
}

.stats-value {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--on-surface-color);
  display: block;
}

.stats-count {
    font-size: 0.75rem;
    color: var(--on-surface-color);
    opacity: 0.6;
    display: block;
    margin-top: 2px;
}

.light-mode .account-stats h4 {
   border-bottom-color: #eee;
}

.light-mode .stats-row + .stats-row {
   border-top-color: #eee;
}

.light-mode .stats-label {
    opacity: 0.7;
}

.light-mode .stats-value {
  color: var(--on-surface-color);
}
.light-mode .stats-count {
    opacity: 0.5;
}

.watched-label {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: var(--watched-label-bg);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.card {
  position: relative;
}

.comments-modal {
  position: fixed;
  z-index: 2200;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-color: var(--scrim-color);
  backdrop-filter: blur(8px);
}

.comments-content {
  position: relative;
  background-color: var(--surface-color);
  padding: var(--spacing-m);
  width: 100%;
  height: 100%;
  overflow-y: auto;
  margin: 0 auto;
  max-width: 100%;
}

@media (min-width: 769px) {
  .comments-content {
    width: 90%;
    max-width: 800px;
    height: 90%;
    margin: 5% auto;
    border-radius: var(--border-radius-large);
    box-shadow: var(--elevation-3);
  }
}

@media (max-width: 768px) {
  .comments-content {
    padding: var(--spacing-s);
  }
}

@media (max-width: 480px) {
  .comments-content {
    padding: var(--spacing-xs);
  }
}

.comments-content h3 {
  text-align: center;
  margin: 0 0 var(--spacing-m);
  color: var(--primary-color);
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  padding-bottom: var(--spacing-s);
  border-bottom: 1px solid var(--surface-variant);
}

.comments-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-s) var(--spacing-m);
  position: relative;
  flex-wrap: wrap;
  gap: var(--spacing-s);
}

@media (max-width: 768px) {
  .comments-header-controls {
    padding: var(--spacing-s);
  }
}

@media (max-width: 480px) {
  .comments-header-controls {
    padding: var(--spacing-xs);
    flex-direction: column;
    align-items: flex-start;
  }

  .comments-header-controls h3 {
    order: 1;
    width: 100%;
    text-align: center;
    margin: 0;
  }

  .close-comments-button,
  .close-cast-button {
    order: 0;
    align-self: flex-end;
  }

  .ai-summarize-btn {
    order: 2;
    align-self: flex-start;
  }
}

.close-comments-button {
  background-color: var(--surface-variant);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.ai-summarize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-variant);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
  color: var(--on-surface-color);
}

.ai-summarize-btn .material-icons-round {
  font-size: 18px;
  color: var(--primary-color);
}

.ai-summarize-btn:hover {
  background-color: rgba(255, 20, 147, 0.15);
}

.ai-summarize-btn.active {
  background-color: var(--primary-color);
  color: white;
}

.ai-summarize-btn.active .material-icons-round {
  color: white;
}

.ai-summary-container {
  background-color: var(--surface-variant);
  padding: var(--spacing-m);
  border-radius: var(--border-radius-medium);
  margin-bottom: var(--spacing-l);
  position: relative;
  border-left: 4px solid var(--primary-color);
  animation: summary-fade-in 0.3s ease forwards;
}

@keyframes summary-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-summary-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-s);
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
}

.ai-summary-heading .material-icons-round {
  font-size: 18px;
}

.ai-summary-content {
  line-height: 1.6;
  font-size: 0.95rem;
  animation: content-appear 0.25s ease-out forwards;
}

@keyframes content-appear {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-summary-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-m);
  gap: var(--spacing-s);
}

.ai-summary-loading p {
  color: var(--primary-color);
  font-weight: 500;
  margin: 0;
}

.ai-summary-loading .material-icons-round {
  font-size: 24px;
  color: var(--primary-color);
  animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .ai-btn-text {
    display: none;
  }

  .ai-summarize-btn {
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    justify-content: center;
  }
}

#comments-container,
#cast-container {
  margin-top: var(--spacing-s);
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-bottom: var(--spacing-l);
}

@media (max-width: 768px) {
  #comments-container,
  #cast-container {
    max-height: calc(100vh - 200px);
    padding-bottom: 80px;
  }
}

@media (max-width: 480px) {
  #comments-container,
  #cast-container {
    max-height: calc(100vh - 220px);
    padding-bottom: 100px;
  }
}

.cast-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--spacing-l);
  padding: var(--spacing-l);
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .cast-container {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-m);
    padding: var(--spacing-m);
    max-height: 45vh;
    padding-bottom: 100px;
  }
}

@media (max-width: 480px) {
  .cast-container {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-m);
    padding: var(--spacing-m);
    max-height: 40vh;
    padding-bottom: 120px;
  }
}

.cast-item {
  text-align: center;
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-s);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cast-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cast-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--border-radius-small);
  margin-bottom: var(--spacing-s);
  background-color: var(--surface-color);
}

.cast-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 50px;
}

.cast-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--on-surface-color);
}

.cast-character {
  font-size: 0.9rem;
  opacity: 0.8;
  margin: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--primary-color);
  font-style: italic;
  font-weight: 500;
}

@media (max-width: 768px) {
  .cast-item {
    min-height: 160px;
    padding: var(--spacing-s);
  }

  .cast-name {
    font-size: 0.9rem;
  }

  .cast-character {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .cast-item {
    min-height: 140px;
    padding: var(--spacing-xs);
  }

  .cast-name {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }

  .cast-character {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }
}

.clickable-cast {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.clickable-cast:hover .cast-overlay {
  opacity: 1;
}

.cast-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--border-radius-medium);
  font-size: 0.8rem;
  gap: 4px;
}

.cast-overlay .material-icons-round {
  font-size: 32px;
  color: var(--primary-color);
}

.cast-overlay span:not(.material-icons-round) {
  font-size: 0.9rem;
  font-weight: 500;
}

.filmography-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-s);
  padding: var(--spacing-m);
  max-height: 60vh;
  overflow-y: auto;
  padding-bottom: var(--spacing-l);
}

@media (max-width: 768px) {
  .filmography-container {
    padding: var(--spacing-s);
    max-height: 55vh;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-l);
  }
}

@media (max-width: 480px) {
  .filmography-container {
    padding: var(--spacing-s);
    max-height: 50vh;
    padding-bottom: var(--spacing-l);
  }
}

.back-to-cast-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-m);
  padding: var(--spacing-xs) var(--spacing-s);
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  border: 1px solid var(--outline-variant);
  border-radius: var(--border-radius);
  text-decoration: none;
  transition: all 0.2s ease;
}

.load-more-filmography {
  position: relative;
  width: calc(100% - var(--spacing-l));
  max-width: 400px;
  margin: var(--spacing-l) auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-s);
  grid-column: 1 / -1;
  padding: var(--spacing-m) var(--spacing-l);
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 24px;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--elevation-2);
  z-index: 10;
}

.load-more-filmography:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--elevation-3);
}

.load-more-filmography .material-icons-round {
  font-size: 20px;
}

@media (max-width: 768px) {
  .load-more-filmography {
    font-size: 0.9rem;
    padding: var(--spacing-m);
    width: calc(100% - var(--spacing-m));
    margin: var(--spacing-l) auto var(--spacing-xxl);
  }
}

@media (max-width: 480px) {
  .load-more-filmography {
    font-size: 0.85rem;
    padding: var(--spacing-s) var(--spacing-m);
    width: calc(100% - var(--spacing-m));
    margin: var(--spacing-l) auto calc(var(--spacing-xxl) + 20px);
  }
}

.filmography-header h4 {
  margin: 0 0 var(--spacing-m) 0;
  color: var(--primary-color);
  text-align: center;
}

.filmography-item {
  display: flex;
  gap: var(--spacing-l);
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-l);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-height: 120px;
  align-items: center;
}

.filmography-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
  background-color: var(--surface-color);
}

.filmography-poster {
  width: 90px;
  height: 135px;
  object-fit: cover;
  border-radius: var(--border-radius-medium);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filmography-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 8px;
}

.filmography-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--on-surface-color);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.filmography-year {
  margin: 0;
  font-size: 1rem;
  color: var(--on-surface-color);
  opacity: 0.7;
  font-weight: 500;
}

.filmography-character {
  margin: 0;
  font-size: 0.95rem;
  color: var(--primary-color);
  font-style: italic;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 768px) {
  .filmography-item {
    gap: var(--spacing-m);
    padding: var(--spacing-m);
    min-height: 100px;
  }

  .filmography-poster {
    width: 70px;
    height: 105px;
  }

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

  .filmography-year {
    font-size: 0.9rem;
  }

  .filmography-character {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .filmography-item {
    gap: var(--spacing-s);
    padding: var(--spacing-s);
    min-height: 90px;
  }

  .filmography-poster {
    width: 60px;
    height: 90px;
  }

  .filmography-title {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }

  .filmography-year {
    font-size: 0.8rem;
  }

  .filmography-character {
    font-size: 0.8rem;
  }
}

.no-filmography {
  text-align: center;
  padding: var(--spacing-l);
  color: var(--on-surface-variant);
}

.no-filmography .material-icons-round {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: var(--spacing-s);
}

.filmography-error {
  text-align: center;
  padding: var(--spacing-l);
  color: var(--error-color);
}

.filmography-error .material-icons-round {
  font-size: 48px;
  margin-bottom: var(--spacing-s);
}

.comment {
  padding: var(--spacing-m);
  border-radius: var(--border-radius-medium);
  background-color: var(--surface-variant);
  margin-bottom: var(--spacing-xxl);
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: var(--spacing-l);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  margin-bottom: var(--spacing-s);
}

.comment-user-info {
  flex: 1;
  min-width: 0;
}

.comment-username {
  font-weight: 600;
  color: hotpink !important;
  margin: 0;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-timestamp {
  font-size: 0.7rem;
  opacity: 0.7;
  margin: 0;
  color: var(--on-surface-color);
}

.comment-body {
  margin: 0;
  margin-top: var(--spacing-xs);
  line-height: 1.5;
  font-size: 0.9rem;
  word-break: break-word;
  white-space: pre-line;
  color: var(--on-surface-color);
}

.comment-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
  color: gold !important;
  font-size: 0.8rem;
  margin-left: var(--spacing-s);
  vertical-align: middle;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 5px;
  border-radius: 12px;
}

.comment-rating .material-icons-round {
  color: gold !important;
}

.comments-loading, .comments-error, .no-comments {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-l) 0;
  text-align: center;
}

.comments-loading .material-icons-round,
.comments-error .material-icons-round,
.no-comments .material-icons-round {
  font-size: 28px;
  margin-bottom: var(--spacing-s);
  color: var(--primary-color);
}

.comments-error .material-icons-round {
  color: var(--error-color);
}

.no-comments .material-icons-round {
  opacity: 0.5;
}

.comments-loading-progress {
  width: 100%;
  max-width: 240px;
  height: 4px;
  background-color: var(--surface-variant);
  margin: var(--spacing-m) auto;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.comments-loading-progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  width: 30%;
  position: absolute;
  animation: progress-animation 1.5s infinite ease-in-out;
  border-radius: 2px;
}

@keyframes progress-animation {
  0% { left: -30%; }
  100% { left: 100%; }
}

#comments-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotate-icon {
  animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.comments-header {
  position: sticky;
  top: 0;
  background-color: var(--surface-color);
  z-index: 5;
  padding: var(--spacing-s) 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--surface-color);
  border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-top: 2px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 10;
  display: none;
  border: 1px solid var(--surface-variant);
}

.suggestion-item {
  padding: var(--spacing-s) var(--spacing-m);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--surface-variant);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: var(--surface-variant);
}

.suggestion-title {
  font-weight: 500;
  flex: 1;
}

.suggestion-type {
  color: var(--secondary-color);
  font-size: 0.85rem;
  padding-left: var(--spacing-s);
}

.search-filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-m);
  margin: var(--spacing-m) 0;
  padding: var(--spacing-m);
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  align-items: center;
}

.search-filter {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
}

.search-filter label {
  font-weight: 500;
  white-space: nowrap;
}

.filter-select {
  padding: var(--spacing-xs) var(--spacing-s);
  border-radius: var(--border-radius-small);
  border: 1px solid var(--surface-variant);
  background-color: var(--surface-color);
  color: var(--on-surface-color);
  min-width: 100px;
}

.filter-button {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs)var(--spacing-m);
}

.filter-no-results {
  color: var(--on-surface-variant-color);
  font-style: italic;
  padding: var(--spacing-m);
}

.history-header-controls {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--spacing-m);
}

.history-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-s);
  flex-wrap: wrap;
  gap: var(--spacing-m);
}

.history-filters {
  display: flex;
  gap: var(--spacing-s);
}

.history-filter-button {
  padding: var(--spacing-xs) var(--spacing-m);
  border: none;
  background-color: var(--surface-variant);
  color: var(--on-surface-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.history-filter-button:hover {
  background-color: rgba(255, 20, 147, 0.15);
}

.history-filter-button.active {
  background-color: var(--primary-color);
  color: white;
}

.history-clear-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-m);
  border: none;
  background-color: var(--error-color);
  color: white;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.history-clear-button:hover {
  background-color: #d81b60;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .search-filters-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-select, .filter-button {
    width: 100%;
  }
}

.progress-bar-container {
  position: relative;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.progress-bar {
  position: absolute;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.episode-info {
  position: absolute;
  bottom: 50px;
  left: 10px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.resume-hint {
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-s) var(--spacing-m);
  margin-top: var(--spacing-s);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
}

.resume-hint-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  font-size: 0.9rem;
}

.resume-action-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-small);
  padding: var(--spacing-xs) var(--spacing-s);
  cursor: pointer;
  margin-left: auto;
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
}

.resume-action-btn:hover {
  background-color: var(--primary-variant);
}

@keyframes pulse-hint {
  0% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 20, 147, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0); }
}

.skeleton-card {
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  overflow: hidden;
  box-shadow: none;
  display flex;
  flex-direction: column;
  height: 100%;
  opacity: 0.7;
  position: relative;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--surface-color);
  margin-bottom: var(--spacing-m);
}

.skeleton-content {
  padding: 0 var(--spacing-m) var(--spacing-m);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.skeleton-line {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-small);
  height: 1em;
  margin-bottom: var(--spacing-s);
}

.skeleton-line.short {
  width: 60%;
  height: 0.85em;
  margin-bottom: 0;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  height: 100%;
  width: 150%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.5s infinite linear;
}

.light-mode .skeleton-card::after {
   background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);
}


@keyframes shimmer {
  0% {
    left: -150%;
  }
  100% {
    left: 100%;
  }
}

.more-like-this-section {
    margin-top: var(--spacing-l);
    padding-top: var(--spacing-m);
    border-top: 1px solid var(--surface-variant);
}

.more-like-this-heading {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-m);
    padding-left: var(--spacing-m);
}

#more-like-this-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--spacing-s) var(--spacing-m) var(--spacing-m);
    gap: var(--spacing-m);
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
 #more-like-this-grid::-webkit-scrollbar {
   display: none;
 }

#more-like-this-grid .card {
    flex: 0 0 auto;
    width: 160px;
    scroll-snap-align: start;
}

 #more-like-this-grid .card-content h3 {
     font-size: var(--font-size-card-text);
     -webkit-line-clamp: 2;
 }
  #more-like-this-grid .card-content p {
     display: none;
 }
  #more-like-this-grid .watchlist-btn {
     width: 28px;
     height: 28px;
     bottom: 4px;
     left: 4px;
  }
  #more-like-this-grid .watchlist-btn > .material-icons-round {
    font-size: 16px !important;
  }

.details-more-section {
  margin-top: var(--spacing-m);
  transition: max-height 0.3s ease;
  overflow: hidden;
}

#details-read-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
  margin-top: var(--spacing-s);
  transition: all 0.3s ease;
}

#details-read-more .material-icons-round {
  transition: transform 0.3s ease;
}

#details-read-more:hover .material-icons-round {
  transform: translateY(2px);
}

.manga-detail-container {
  display: flex;
  flex-direction: row;
  gap: var(--spacing-l);
  margin-top: var(--spacing-m);
  padding-bottom: var(--spacing-m);
}

.manga-detail-image {
  flex: 0 0 200px;
}

.manga-detail-center {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 var(--spacing-s);
}

.manga-detail-image img {
  width: 100%;
  border-radius: var(--border-radius-medium);
  box-shadow: var(--elevation-1);
}

.manga-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.manga-detail-info h2 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: var(--spacing-s);
  text-align: left;
}

.manga-description {
  margin-bottom: var(--spacing-m);
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.5;
  text-align: left;
}

.manga-actions {
  margin-top: auto;
  display: flex;
  gap: var(--spacing-m);
}

@media (max-width: 768px) {
  .manga-detail-container {
    flex-direction: column;
  }

  .manga-detail-image {
    flex: 0 0 auto;
    max-width: 200px;
    margin: 0 auto;
  }
}

#search-results-section {
  width: 100%;
  margin: 0 auto var(--spacing-xl);
  padding: 0 var(--spacing-m);
  text-align: left;
  position: relative;
  padding-top: 100px;
  z-index: 5;
}

#search-results-heading {
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  margin-top: 20px;
  position: relative;
}

.resume-hint {
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  padding: var(--spacing-s) var(--spacing-m);
  margin-top: var(--spacing-s);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease;
}

.resume-hint-content {
  display: flex;
  align-items: center;
  gap: var(--spacing-s);
  font-size: 0.9rem;
}

.resume-action-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-small);
  padding: var(--spacing-xs) var(--spacing-s);
  cursor: pointer;
  margin-left: auto;
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
}

.resume-action-btn:hover {
  background-color: var(--primary-variant);
}

@keyframes pulse-hint {
  0% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 20, 147, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 20, 147, 0); }
}

.skeleton-card {
  background-color: var(--surface-variant);
  border-radius: var(--border-radius-medium);
  overflow: hidden;
  box-shadow: none;
  display flex;
  flex-direction: column;
  height: 100%;
  opacity: 0.7;
  position: relative;
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--surface-color);
  margin-bottom: var(--spacing-m);
}

.skeleton-content {
  padding: 0 var(--spacing-m) var(--spacing-m);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.skeleton-line {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-small);
  height: 1em;
  margin-bottom: var(--spacing-s);
}

.skeleton-line.short {
  width: 60%;
  height: 0.85em;
  margin-bottom: 0;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  height: 100%;
  width: 150%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.5s infinite linear;
}

.light-mode .skeleton-card::after {
   background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);
}


@keyframes shimmer {
  0% {
    left: -150%;
  }
  100% {
    left: 100%;
  }
}

.more-like-this-section {
    margin-top: var(--spacing-l);
    padding-top: var(--spacing-m);
    border-top: 1px solid var(--surface-variant);
}

.more-like-this-heading {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-m);
    padding-left: var(--spacing-m);
}

#more-like-this-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--spacing-s) var(--spacing-m) var(--spacing-m);
    gap: var(--spacing-m);
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
 #more-like-this-grid::-webkit-scrollbar {
   display: none;
 }

#more-like-this-grid .card {
    flex: 0 0 auto;
    width: 160px;
    scroll-snap-align: start;
}

 #more-like-this-grid .card-content h3 {
     font-size: var(--font-size-card-text);
     -webkit-line-clamp: 2;
 }
  #more-like-this-grid .card-content p {
     display: none;
 }
  #more-like-this-grid .watchlist-btn {
     width: 28px;
     height: 28px;
     bottom: 4px;
     left: 4px;
  }
  #more-like-this-grid .watchlist-btn > .material-icons-round {
    font-size: 16px !important;
  }

.details-more-section {
  margin-top: var(--spacing-m);
  transition: max-height 0.3s ease;
  overflow: hidden;
}

#details-read-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  width: 100%;
  margin-top: var(--spacing-s);
  transition: all 0.3s ease;
}

#details-read-more .material-icons-round {
  transition: transform 0.3s ease;
}

#details-read-more:hover .material-icons-round {
  transform: translateY(2px);
}