:root {
  --primary: #ff6300;
  --bg-dark: #0b0a09;
  --bg-darker: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-dark);
  color: white;
  font-family: 'Montserrat', 'Roboto', sans-serif;
  height: 100vh;
  overflow: hidden;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Title Bar */
.title-bar {
  height: 32px;
  background: var(--bg-darker);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.title-bar-title {
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
}

/* Main Layout */
#page {
  display: flex;
  height: calc(100vh - 32px);
  overflow: hidden;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  #page {
    flex-direction: column;
  }
  
  #navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row !important;
    min-width: auto !important;
    width: 100%;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  }
  
  #navbar .button {
    flex: 1;
    padding: 0.75rem 0.25rem !important;
    font-size: 0.65rem !important;
  }
  
  #navbar .button .material-icons {
    font-size: 1.5rem !important;
  }
  
  #page-content {
    margin: 0 !important;
    padding-bottom: 70px;
    overflow-y: auto;
  }
  
  .title-bar {
    display: none !important;
  }
  
  #intro {
    height: 300px;
  }
  
  #intro .about {
    left: 1rem;
    width: calc(100% - 2rem);
  }
  
  #intro .title {
    font-size: 1.5rem;
  }
  
  #intro .description {
    font-size: 0.875rem;
  }
  
  .anime-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  .home-page {
    padding: 0 1rem 1rem 1rem !important;
  }
  
  .content-section h2 {
    font-size: 1rem !important;
  }
}

/* Hero section */
#intro {
  overflow: hidden;
  position: relative;
  height: 450px;
  margin-bottom: 0px;
  border-radius: 0.25rem;
}

#teaser {
  position: absolute;
  z-index: 0;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}

#teaser::before {
  content: "";
  background: linear-gradient(to right, #0b0a09 0%, #0b0a09 25%, rgba(11,10,9,0.7) 50%, rgba(11,10,9,0) 100%);
  z-index: 1;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

#teaser::after {
  content: "";
  background: linear-gradient(to top, #0b0a09 0%, rgba(11,10,9,0) 50%, #0b0a09 100%);
  z-index: 2;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

#teaser .image {
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
}

#teaser .image img {
  object-fit: cover;
  display: block;
  width: 100%;
  height: 100%;
}

#intro .about {
  position: absolute;
  transform: translateY(-50%);
  left: 3rem;
  top: calc(50% - 2rem);
  width: 600px;
  font-family: 'Montserrat', sans-serif;
  z-index: 10;
  text-shadow: 0 0 6px black;
}

#intro .about-buttons {
  display: flex;
  align-items: center;
  height: 42px;
  gap: .5rem;
  margin-top: 1.5rem;
  text-shadow: none;
}

#intro .about-play {
  background: var(--primary);
  border: none;
  padding: 0 1.5rem;
  font-weight: 600;
  color: white;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
  transition: transform 0.2s;
  gap: 0.5rem;
}

#intro .about-play:hover {
  transform: scale(1.05);
}

#intro .title {
  cursor: pointer;
  text-transform: uppercase;
  font-size: 2rem;
  font-weight: 700;
  line-height: 2.25rem;
}

#intro .description {
  cursor: pointer;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-top: 1rem;
  text-align: justify;
  font-size: 1rem;
  line-height: 1.5rem;
  color: rgba(255,255,255,0.85);
}

/* Player Styles */
.player-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
  display: none;
  cursor: default;
}

.player-modal.active {
  display: block;
}

.player-modal.cursor-hidden {
  cursor: none;
}

/* Content Detail Modal */
.content-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0b0a09;
  z-index: 9998;
  display: none;
  overflow-y: auto;
}

.content-detail-modal.active {
  display: block;
}

.content-detail-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 4rem;
}

.content-detail-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(26,26,26,0.8);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.content-detail-close:hover {
  background: rgba(40,40,40,0.9);
}

.content-detail-content {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.content-detail-left {
  flex: 0 0 auto;
  padding-top: 2.2rem;
}

.content-detail-cover {
  width: 300px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.content-detail-right {
  flex: 1;
  min-width: 300px;
}

.content-detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  font-family: 'Montserrat', sans-serif;
}

.content-detail-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  margin-bottom: 2rem;
}

.content-detail-episodes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.season-header {
  width: 100%;
}

.season-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.episode-card {
  background: rgba(26,26,26,0.8);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.episode-card:hover {
  transform: translateY(-2px);
  background: rgba(40,40,40,0.9);
}

.episode-number {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
}

.episode-title {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.player-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  text-align: center;
  z-index: 100;
}

.player-error.active {
  display: flex;
}

.player-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  display: none;
}

.player-loading.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 99, 0, 0.2);
  border-top-color: #ff6300;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.player-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-top-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
  z-index: 50;
  transition: opacity 0.3s;
}

.player-top-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  z-index: 60;
  transition: opacity 0.3s;
}

.player-top-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-anime-name {
  display: block;
  font-size: 0.875rem;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 600;
  text-shadow: 0 0 6px black;
}

.player-episode-title {
  font-size: 1.125rem;
  font-weight: 500;
  text-shadow: 0 0 6px black;
  margin-top: 0.25rem;
}

.player-btn {
  background: rgba(26, 26, 26, 0.8);
  border: none;
  color: white;
  border-radius: 8px;
  padding: 0.625rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.1s;
  position: relative;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
}

.player-btn:hover {
  background: rgba(40, 40, 40, 0.9);
}

.player-btn:active {
  transform: scale(0.98);
}

.player-btn-small {
  padding: 0.375rem 0.5rem;
}

.player-bottom-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 250px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  z-index: 50;
  transition: opacity 0.3s;
}

.player-bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 60;
  transition: opacity 0.3s;
}

.player-progress-container {
  width: 100%;
  margin-bottom: 1rem;
}

.player-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  transition: height 0.2s;
}

.player-progress-track:hover {
  height: 6px;
}

.player-progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.player-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: white;
  border-radius: 4px;
}

.player-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s;
}

.player-progress-track:hover .player-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-volume-btn-group {
  display: flex;
  align-items: center;
  position: relative;
}

.player-volume-btn-inner {
  display: flex;
  align-items: center;
  background: rgba(26, 26, 26, 0.8);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  gap: 0;
  cursor: pointer;
  transition: background 0.2s, padding-right 0.3s ease-out, gap 0.3s ease-out;
}

.player-volume-btn-group:hover .player-volume-btn-inner {
  padding-right: 1rem;
  gap: 0.75rem;
}

.player-volume-btn-inner:hover {
  background: rgba(40, 40, 40, 0.9);
}

.player-volume-btn-inner .player-btn {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

.player-volume-btn-inner .player-btn:hover {
  background: transparent;
}

.player-volume-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease-out, opacity 0.3s ease-out;
  opacity: 0;
  pointer-events: none;
}

.player-volume-btn-group:hover .player-volume-slider {
  width: 80px;
  opacity: 1;
  pointer-events: auto;
}

.player-volume-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

.player-volume-level {
  height: 100%;
  background: white;
  border-radius: 4px;
  width: 100%;
  transition: width 0.1s ease-out;
}

.player-time {
  font-size: 0.9rem;
  color: white;
  margin-left: 0.75rem;
  font-weight: 500;
}

.player-controls-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Auto-hiding controls */
.player-modal.controls-hidden .player-top-gradient,
.player-modal.controls-hidden .player-top-controls,
.player-modal.controls-hidden .player-bottom-gradient,
.player-modal.controls-hidden .player-bottom-controls {
  opacity: 0;
  pointer-events: none;
}

.player-modal.controls-hidden .player-progress-track {
  pointer-events: none;
}

.home-page {
  padding: 0 2rem 2rem 2rem;
  position: relative;
  z-index: 0;
}

#navbar .button.active {
  background: rgba(255, 99, 0, 0.2);
  color: #ff6300;
}

.content-section {
  margin-bottom: 2.5rem;
}

.content-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.content-section h2 i {
  color: var(--primary);
  font-size: 1.5rem;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.anime-card {
  cursor: pointer;
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.anime-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.anime-cover-wrapper {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.anime-lang-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
}

.anime-lang-badge {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.anime-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.anime-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
}

.anime-episode-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

.anime-card:hover {
  transform: scale(1.05);
}

.anime-title {
  margin-top: 0.5rem;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* Mobile Search Page */
@media (max-width: 768px) {
  #search-page > div {
    flex-direction: column !important;
  }
  
  .filters-sidebar {
    width: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin-bottom: 1rem;
  }
  
  #mobile-filter-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }
  
  #filters-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }
  
  #filters-content.expanded {
    max-height: 2000px;
  }
  
  #genre-filter-section {
    max-height: 300px;
    overflow-y: auto;
  }
  
  #search-input {
    font-size: 16px !important;
  }
  
  .anime-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  #search-results {
    padding: 0 0.5rem;
  }
  
  /* Collapsible filters */
  .filters-sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
  }
  
  #genre-filter-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  #genre-filter-list label {
    padding: 8px 12px !important;
  }
}

.anime-progress {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
}

/* Player Settings Modal */
.player-settings-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.player-settings-modal.active {
  display: flex;
  pointer-events: auto;
}

.player-settings-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.player-settings-container {
  background: rgba(30, 30, 30, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  width: 420px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 1.5rem 6rem 0;
  z-index: 2;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.player-settings-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'Montserrat', sans-serif;
}

.player-settings-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.player-settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.player-settings-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.player-settings-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-settings-section:last-child {
  border-bottom: none;
}

.player-settings-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  padding: 1rem 1.5rem 0.75rem;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-lang-options {
  padding: 0.5rem 0;
}

.player-lang-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}

.player-lang-choice:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: rgba(255, 99, 0, 0.5);
}

.player-lang-choice.active {
  background: rgba(255, 99, 0, 0.1);
  border-left-color: var(--primary);
}

.player-lang-choice-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-lang-choice-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 400;
  font-family: 'Montserrat', sans-serif;
}

.player-lang-choice-check {
  color: var(--primary);
  font-size: 1.25rem;
  opacity: 0;
}

.player-lang-choice.active .player-lang-choice-check {
  opacity: 1;
}

.player-settings-episode-list {
  padding: 0.5rem 0;
}

.player-settings-episode-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}

.player-settings-episode-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: rgba(255, 99, 0, 0.5);
}

.player-settings-episode-card.active {
  background: rgba(255, 99, 0, 0.1);
  border-left-color: var(--primary);
}

.player-settings-episode-number {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  min-width: 60px;
}

.player-settings-episode-card.active .player-settings-episode-number {
  color: var(--primary);
}

.player-settings-episode-title {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}


/* Mobile improvements for all pages */
@media (max-width: 768px) {
  /* Settings page */
  #settings-page {
    padding: 1rem !important;
  }
  
  .settings-section {
    margin-bottom: 1.5rem !important;
  }
  
  .settings-option {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }
  
  /* Lists page */
  #lists-page {
    padding: 1rem !important;
  }
  
  #create-list-card {
    padding: 1rem !important;
  }
  
  /* Content detail modal */
  .content-detail-container {
    padding: 1rem !important;
    padding-top: 3rem !important;
  }
  
  .content-detail-content {
    flex-direction: column !important;
    padding: 1rem !important;
  }
  
  .content-detail-left {
    width: 100%;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
  
  .content-detail-cover {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    margin-bottom: 0 !important;
  }
  
  /* Amélioration bouton "Ajouter à ma liste" sur mobile */
  #add-to-list-btn {
    width: 100% !important;
    max-width: none !important;
    margin-top: 12px !important;
    padding: 14px 20px !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 12px rgba(255, 99, 0, 0.3) !important;
    transition: all 0.2s ease !important;
  }
  
  #add-to-list-btn:active {
    transform: scale(0.98) !important;
    box-shadow: 0 2px 8px rgba(255, 99, 0, 0.4) !important;
  }
  
  .content-detail-title {
    font-size: 1.75rem !important;
    margin-top: 1.5rem !important;
    line-height: 1.3 !important;
  }
  
  .content-detail-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-top: 1rem !important;
  }
  
  .season-episodes-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Player controls on mobile */
  .player-top-controls,
  .player-bottom-controls {
    padding: 1rem !important;
  }
  
  .player-anime-name {
    font-size: 0.75rem !important;
  }
  
  .player-episode-title {
    font-size: 0.9rem !important;
  }
  
  .player-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
  }
  
  .player-btn .material-icons {
    font-size: 1.25rem !important;
  }
  
  .player-controls {
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }
  
  .player-controls-left,
  .player-controls-right {
    gap: 0.5rem !important;
  }
  
  #prev-episode-btn,
  #next-episode-btn {
    font-size: 0 !important;
    padding: 0.5rem !important;
  }
  
  #prev-episode-btn span,
  #next-episode-btn span {
    display: none;
  }
  
  .player-time {
    font-size: 0.75rem !important;
    margin-left: 0.25rem !important;
  }
  
  /* Player settings modal on mobile */
  .player-settings-container {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 12px 12px 0 0 !important;
    max-height: 80vh !important;
  }
  
  /* Search results count */
  #search-results-count {
    padding: 0 0.5rem;
    font-size: 0.875rem !important;
  }
  
  /* Pagination on mobile */
  #search-pagination {
    flex-wrap: wrap;
    padding: 0.5rem !important;
  }
  
  .pagination-btn {
    min-width: 36px !important;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.8rem !important;
  }
}

/* Very small mobile screens */
@media (max-width: 480px) {
  .anime-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .anime-title {
    font-size: 0.75rem !important;
  }
  
  .anime-progress,
  .anime-episode-meta {
    font-size: 0.65rem !important;
  }
  
  #intro {
    height: 250px !important;
  }
  
  #intro .title {
    font-size: 1.25rem !important;
  }
  
  #intro .description {
    font-size: 0.75rem !important;
  }
  
  #intro .about-play {
    padding: 0 1rem !important;
    font-size: 0.875rem !important;
  }
}

/* Landscape mode on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  #navbar {
    flex-direction: row !important;
  }
  
  #intro {
    height: 200px !important;
  }
}


/* Fix Player Preview Bug */
.player-progress-preview {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.player-preview-video {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

#player-progress-preview {
  display: none !important;
}

#player-preview-video {
  display: none !important;
}


/* Mobile: Better touch targets for video controls */
@media (max-width: 768px) {
  .player-progress-container {
    padding: 20px 0 !important;
    margin: 0 -10px !important;
  }
  
  .player-progress-track {
    height: 8px !important;
    cursor: pointer;
  }
  
  .player-progress-thumb {
    width: 20px !important;
    height: 20px !important;
    margin-top: -6px !important;
  }
  
  .player-progress-played {
    height: 8px !important;
  }
  
  .player-progress-buffer {
    height: 8px !important;
  }
  
  .player-bottom-controls {
    padding: 15px 10px !important;
  }
  
  .player-controls {
    gap: 8px !important;
  }
  
  .player-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
  }
  
  .player-btn .material-icons {
    font-size: 24px !important;
  }
  
  .player-time {
    font-size: 0.85rem !important;
  }
}

/* Ensure progress track is always clickable/touchable */
.player-progress-track {
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.player-progress-track::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: 0;
  right: 0;
  z-index: 0;
}


/* Lock orientation to portrait on mobile (except video player) */
@media (max-width: 768px) and (orientation: landscape) {
  /* Force portrait layout even in landscape mode */
  body:not(.video-playing) {
    transform: rotate(-90deg);
    transform-origin: left top;
    width: 100vh;
    overflow-x: hidden;
    position: absolute;
    top: 100%;
    left: 0;
  }
  
  body:not(.video-playing) #app {
    height: 100vw;
  }
}

/* Video player can rotate freely */
@media (max-width: 768px) and (orientation: landscape) {
  body.video-playing {
    transform: none !important;
    width: 100vw !important;
    position: static !important;
  }
  
  body.video-playing #app {
    height: 100vh !important;
  }
}


/* Hide desktop download section on mobile */
@media (max-width: 768px) {
  #desktop-download-section {
    display: none !important;
  }
}
