/* Custom Styling matching the "Netflixy" Theme */

:root {
  --background-color: #141414;
  --navbar-color: rgba(20, 20, 20, 0.85);
  --primary-color: #e50914;
  --primary-hover: #b80710;
  --card-background: #1f1f1f;
  --glass-background: rgba(30, 30, 30, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-color: #ffffff;
  --text-muted: #808080;
  --success-color: #46d369;
  --info-color: #54b4d3;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --transition-speed: 0.3s;
}

/* Auth Screens */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--background-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: var(--card-background);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 380px;
  max-width: 92vw;
  text-align: center;
}
.auth-logo {
  font-size: 56px;
  margin-bottom: 16px;
}
.auth-title {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-color);
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}
.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--text-color);
  font-size: 15px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition-speed);
  margin-bottom: 12px;
}
.auth-input:focus {
  border-color: var(--primary-color);
}
.auth-input::placeholder {
  color: var(--text-muted);
}
.auth-btn {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background var(--transition-speed);
  margin-top: 4px;
}
.auth-btn:hover { background: var(--primary-hover); }
.auth-btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.auth-btn-outline:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-color);
}
.auth-btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  margin-top: 16px;
  font-family: var(--font-body);
}
.auth-btn-link:hover { color: var(--text-color); }
.auth-error {
  color: var(--primary-color);
  font-size: 13px;
  margin-bottom: 8px;
  text-align: left;
}
.auth-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.auth-btn-row .auth-btn { flex: 1; }
.auth-avatar-large {
  font-size: 72px;
  margin-bottom: 12px;
}
.profile-select-card {
  width: 520px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.profile-tile:hover { transform: scale(1.05); }
.profile-tile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transition: border-color 0.2s;
}
.profile-tile:hover .profile-tile-avatar {
  border-color: var(--text-color);
}
.profile-tile-name {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}
.avatar-option {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.avatar-option:hover { border-color: var(--text-muted); }
.avatar-option.selected { border-color: var(--primary-color); }

.nav-profile-btn {
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  margin-left: 12px;
  transition: border-color 0.2s;
}
.nav-profile-btn:hover { border-color: var(--text-color); }

.nav-admin-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
  padding: 4px 6px;
  transition: color 0.2s;
  line-height: 1;
}
.nav-admin-btn:hover { color: var(--text-color); }

.admin-modal-container .auth-input {
  margin-bottom: 8px;
}
#admin-profiles-list .profile-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  margin-bottom: 6px;
}
#admin-profiles-list .profile-item span { font-size: 14px; }
#admin-profiles-list .profile-item button {
  background: rgba(229,9,20,0.2);
  border: none;
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
#admin-profiles-list .profile-item button:hover { background: rgba(229,9,20,0.4); }
#admin-temp-list .temp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}
#admin-temp-list .temp-item .temp-pass { color: var(--success-color); font-family: monospace; }
#admin-temp-list .temp-item .temp-expiry { color: var(--text-muted);   font-size: 11px;
}
.admin-modal-container {
  max-width: 550px;
  padding: 30px;
}
.admin-modal-container .modal-close {
  top: 14px;
  right: 18px;
}
#admin-temp-list .temp-item button {
  background: rgba(229,9,20,0.2);
  border: none;
  color: var(--primary-color);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

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

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #141414;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.scrollbar-hidden::-webkit-scrollbar {
  display: none; /* Hide scrollbars for rows */
}
.scrollbar-hidden {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  padding: 0 4%;
  background-color: var(--navbar-color);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: background-color var(--transition-speed);
  border-bottom: 1px solid var(--glass-border);
}

.navbar-left, .navbar-right {
  display: flex;
  align-items: center;
}

.logo {
  color: var(--primary-color);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 1px;
  margin-right: 25px;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: #e5e5e5;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-color);
  font-weight: 600;
}

.badge {
  background-color: var(--primary-color);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  margin-left: 5px;
  vertical-align: middle;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

#search-input {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 8px 15px 8px 35px;
  color: white;
  width: 250px;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all var(--transition-speed);
}

#search-input:focus {
  outline: none;
  width: 320px;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.2);
}

/* --- APP LAYOUT CONTAINER --- */
.content-container {
  padding-top: 68px;
  min-height: 100vh;
  padding-bottom: 50px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* --- HERO BANNER --- */
.hero-banner {
  height: 56.25vw;
  max-height: 550px;
  min-height: 380px;
  position: relative;
  background-size: cover;
  background-position: center 20%;
  display: flex;
  align-items: center;
  padding: 0 4%;
  margin-bottom: 20px;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(75deg, rgba(20, 20, 20, 0.95) 0%, rgba(20, 20, 20, 0.45) 45%, rgba(20, 20, 20, 0) 100%),
              linear-gradient(0deg, #141414 0%, rgba(20, 20, 20, 0) 25%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.hero-overview {
  font-size: 15px;
  margin-bottom: 25px;
  color: #d2d2d2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all var(--transition-speed);
}

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

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

.btn-secondary {
  background-color: rgba(109, 109, 110, 0.7);
  color: white;
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  background-color: rgba(109, 109, 110, 0.4);
  transform: translateY(-2px);
}

/* --- HORIZONTAL MOVIE ROWS --- */
.catalog-section {
  padding: 10px 4%;
  margin-bottom: 20px;
}

.row-header {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.movie-row {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding: 10px 0;
  scroll-behavior: smooth;
}

.media-card {
  flex: 0 0 auto;
  width: 160px;
  aspect-ratio: 2/3;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--card-background);
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-card:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 8px rgba(229, 9, 20, 0.25);
  z-index: 5;
}

.card-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 15px 10px 8px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-card:hover .card-title-overlay {
  opacity: 1;
}

/* --- SEARCH GRID --- */
#tab-search {
  padding: 30px 4%;
}

.search-title-header {
  font-size: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
  padding-left: 12px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.no-results {
  text-align: center;
  padding: 100px 0;
  color: var(--text-muted);
}
.no-results i {
  font-size: 60px;
  margin-bottom: 15px;
  color: rgba(255,255,255,0.08);
}

/* --- MEDIA DETAIL MODAL (GLASSMORPHIC) --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.active {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  position: relative;
  z-index: 10;
  background: var(--glass-background);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(25px);
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-container::-webkit-scrollbar {
  width: 6px;
}

.modal-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  transition: background 0.2s;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-speed);
}

.modal-close:hover {
  background-color: var(--primary-color);
}

.modal-header-banner {
  height: 350px;
  position: relative;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  padding: 30px;
}

.modal-banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(0deg, #181818 0%, rgba(24, 24, 24, 0.3) 70%, rgba(24, 24, 24, 0) 100%);
}

.modal-header-content {
  position: relative;
  z-index: 2;
}

.modal-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.modal-meta-tags {
  display: flex;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
}

.meta-tag {
  color: #fff;
}

.meta-tag.rating {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0 6px;
  border-radius: 3px;
  font-size: 11px;
}

.modal-body {
  padding: 30px;
  background-color: #181818;
}

.modal-body-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

@media (min-width: 900px) {
  .modal-body-wrapper.has-tv {
    grid-template-columns: 1.2fr 1fr;
  }
}

.modal-container:has(.has-tv) {
  max-width: 1200px;
  width: 95%;
}

.modal-body-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-body-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-overview {
  font-size: 15px;
  color: #cccccc;
  margin-bottom: 25px;
  line-height: 1.6;
}

/* TV Episode selector style */
.tv-selector-container {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.dropdown {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 36px 10px 16px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

.dropdown:hover, .dropdown:focus {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.dropdown option {
  background-color: #181818;
  color: white;
}

.season-tab {
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d8d8d8;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font-body);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.season-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  transform: translateY(-1px);
}

.season-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
  transform: translateY(0);
}

.episodes-vertical-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 250px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 15px;
}

.episodes-vertical-list::-webkit-scrollbar {
  width: 6px;
}

.episodes-vertical-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.episodes-vertical-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  transition: background 0.2s;
}

.episodes-vertical-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 15px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.episode-row:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.episode-row.active {
  background: rgba(229, 9, 20, 0.05);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.15);
}

.episode-row-index {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 30px;
  text-align: center;
}

.episode-row.active .episode-row-index {
  color: var(--primary-color);
}

.episode-row-img {
  width: 130px;
  aspect-ratio: 16/9;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.episode-row-play-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.episode-row:hover .episode-row-play-overlay {
  opacity: 1;
}

.episode-row-play-overlay i {
  color: white;
  font-size: 20px;
}

.episode-row-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.episode-row-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 15px;
}

.episode-row-title {
  font-size: 14px;
  font-weight: 700;
}

.episode-row-runtime {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.episode-row-overview {
  font-size: 12px;
  color: #a0a0a0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* --- STREAMS CARDS LIST --- */
.streams-section {
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 25px;
}

.streams-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.streams-status {
  font-size: 12px;
  color: var(--text-muted);
}

.streams-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  transition: all var(--transition-speed);
}

.stream-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.stream-details {
  flex-grow: 1;
  max-width: 80%;
}

.stream-title-line {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  word-break: break-all;
}

.stream-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
}

.badge-tag {
  background: #333333;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 600;
}

.badge-tag.cached {
  background-color: rgba(70, 211, 105, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(70, 211, 105, 0.25);
}

.badge-tag.uncached {
  background-color: rgba(240, 173, 78, 0.15);
  color: #f0ad4e;
}

.badge-tag.res-4k {
  background-color: var(--primary-color);
  color: white;
}

.stream-action-btn {
  background-color: rgba(255, 255, 255, 0.95);
  color: black;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

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

/* --- DOWNLOADS PAGE DASHBOARD --- */
#tab-downloads {
  padding: 30px 4%;
  max-width: 1100px;
  margin: 0 auto;
}

.downloads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.download-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.download-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.download-title-area {
  flex-grow: 1;
}

.download-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
  word-break: break-all;
}

.download-status-line {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-badge {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 3px;
}

.status-badge.completed { background-color: var(--success-color); color: black; }
.status-badge.downloading { background-color: var(--info-color); color: black; }
.status-badge.cached { background-color: var(--success-color); color: black; }
.status-badge.checking { background-color: #f0ad4e; color: black; }
.status-badge.paused { background-color: #777; color: white; }

.download-actions {
  display: flex;
  gap: 10px;
}

.action-icon-btn {
  background: rgba(255,255,255,0.05);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  width: 38px;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.action-icon-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.25);
}

.action-icon-btn.delete-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.progress-container {
  width: 100%;
}

.progress-bar-wrapper {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  height: 8px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-bar-fill {
  background: linear-gradient(to right, #e50914, #ff5b5b);
  height: 100%;
  width: 0%;
  transition: width 0.5s ease-out;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.no-downloads {
  text-align: center;
  padding: 120px 0;
  color: var(--text-muted);
}

.no-downloads i {
  font-size: 80px;
  color: rgba(255,255,255,0.05);
  margin-bottom: 20px;
}

/* FILE EXPLORER STYLING */
.file-modal-container {
  max-width: 650px;
}

.file-modal-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.file-list-container {
  padding: 20px;
  max-height: 450px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 15px;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 75%;
}

.file-icon {
  color: var(--primary-color);
  font-size: 18px;
}

.file-name-text {
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.file-size-text {
  font-size: 11px;
  color: var(--text-muted);
}

.file-download-link {
  background-color: var(--success-color);
  color: black;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.file-download-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(70, 211, 105, 0.4);
}

/* --- TOAST SYSTEM --- */
.toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.toast {
  background: rgba(24, 24, 24, 0.95);
  border-left: 4px solid var(--primary-color);
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 15px 20px;
  color: white;
  min-width: 280px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.success { border-left-color: var(--success-color); }
.toast.info { border-left-color: var(--info-color); }
.toast.error { border-left-color: var(--primary-color); }

@keyframes toastFadeIn {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* QUALITY PRESET PANEL STYLING */
.presets-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 15px;
  margin-bottom: 25px;
}

.preset-featured-card {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.15) 0%, rgba(30, 30, 30, 0.85) 100%);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.preset-featured-card:hover {
  transform: translateY(-2px);
  border-color: rgba(229, 9, 20, 0.45);
  box-shadow: 0 12px 30px rgba(229, 9, 20, 0.15);
}

.preset-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.featured-tag {
  background-color: var(--primary-color);
  color: white;
}

.preset-name {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-title);
}

.preset-desc {
  font-size: 12px;
  color: #c0c0c0;
}

.preset-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.preset-action-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
  transition: all 0.2s;
}

.preset-action-btn:hover {
  background-color: var(--primary-hover);
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.5);
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.preset-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.preset-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
}

.preset-action-btn-sm {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(229, 9, 20, 0.2);
}

.preset-action-btn-sm:hover {
  background-color: var(--primary-hover);
  color: white;
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(229, 9, 20, 0.4);
}

/* ADVANCED STREAM LIST COLLAPSIBLE */
.advanced-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin: 15px 0 25px;
}

.advanced-toggle-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.advanced-toggle-btn:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.02);
}

.advanced-toggle-btn.active i {
  transform: rotate(180deg);
}

.advanced-toggle-btn i {
  transition: transform var(--transition-speed);
}

.advanced-streams-wrapper {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  animation: fadeIn 0.3s ease;
}

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

/* MOVIE ROW SLIDER ARROWS & SEE ALL LINK */
.movie-row-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.movie-row-wrapper:hover .row-arrow {
  opacity: 1;
}

.row-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.row-arrow:hover {
  background-color: rgba(0, 0, 0, 0.95);
  font-size: 24px;
}

.left-arrow {
  left: -4%;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.right-arrow {
  right: -4%;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.clickable-header {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: color 0.2s;
}

.clickable-header:hover {
  color: white;
}

.see-more-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.3s, transform 0.3s;
  font-family: var(--font-body);
}

.clickable-header:hover .see-more-link {
  opacity: 1;
  transform: translateX(0);
}

/* LOADING PLACEHOLDER FOR STREAM HEIGHT STABILITY */
.streams-loading-placeholder {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin: 15px 0 25px;
  animation: pulseBg 2s infinite ease-in-out;
}

@keyframes pulseBg {
  0% { background-color: rgba(255, 255, 255, 0.01); }
  50% { background-color: rgba(255, 255, 255, 0.03); }
  100% { background-color: rgba(255, 255, 255, 0.01); }
}

.streams-loading-placeholder .spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
}

.streams-loading-placeholder i {
  font-size: 36px;
  color: var(--primary-color);
}

/* Shimmer loading feedback animation on active click */
.preset-action-btn:disabled,
.preset-action-btn-sm:disabled,
.stream-action-btn:disabled,
button:disabled {
  background: linear-gradient(90deg, var(--primary-color) 25%, var(--primary-hover) 50%, var(--primary-color) 75%) !important;
  background-size: 200% 100% !important;
  animation: shimmerBtn 1.5s infinite linear !important;
  color: rgba(255, 255, 255, 0.8) !important;
  border: none !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

@keyframes shimmerBtn {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Ensure the spinner rotates smoothly */
.fa-spin {
  animation: spinLoader 1s linear infinite !important;
  display: inline-block;
}

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

/* Responsive adjustments */
@media(max-width: 768px) {
  .preset-grid { grid-template-columns: 1fr; }
  .preset-featured-card { flex-direction: column; align-items: stretch; }
  .preset-card { flex-direction: column; align-items: stretch; }
  .preset-action-btn, .preset-action-btn-sm { justify-content: center; }
  .hero-title { font-size: 2rem; }
  #search-input { width: 180px; }
  #search-input:focus { width: 220px; }
  .modal-container { width: 95%; }
  .modal-header-banner { height: 260px; }
  .modal-title { font-size: 1.6rem; }
  .stream-card { flex-direction: column; align-items: stretch; }
  .stream-action-btn { justify-content: center; }
  .download-top { flex-direction: column; }
  .download-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   v60 refinements
   ========================================================================== */

/* --- Media cards: title + year, always visible on touch screens --- */
.card-title-overlay { line-height: 1.3; }
.card-year { display: block; font-weight: 500; opacity: 0.7; margin-top: 2px; font-size: 10px; }
@media (hover: none) {
  .card-title-overlay { opacity: 1; }
}
.media-card img { display: block; }

/* --- Movie / show modal: less dead space so the sources are visible without scrolling --- */
.modal-header-banner { height: 300px; }
.modal-overview { margin-bottom: 0; }
.streams-section { margin-top: 10px; padding-top: 20px; }
.streams-loading-placeholder { height: 160px; }

/* --- Quality presets: vertical cards so text is never squeezed next to the buttons --- */
.preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.preset-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.preset-card-info { max-width: none; }
.preset-card .preset-desc { min-height: 2.6em; }
.preset-meta { flex-wrap: wrap; row-gap: 2px; font-weight: 500; }
.preset-meta strong { color: #d8d8d8; font-weight: 700; }
.preset-actions-container { display: flex; gap: 8px; flex-shrink: 0; }
.preset-actions-container > button { flex: 0 0 auto; }
.preset-action-btn.stream-btn,
.preset-action-btn-sm.stream-btn,
.stream-action-btn.stream-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: #fff;
  box-shadow: none;
}
.preset-action-btn.stream-btn:hover,
.preset-action-btn-sm.stream-btn:hover,
.stream-action-btn.stream-btn:hover { background: rgba(255, 255, 255, 0.18); }
.preset-featured-card .preset-actions-container { flex-wrap: nowrap; }
.preset-card .preset-actions-container > button { flex: 1 1 0; justify-content: center; }

/* --- Source list: readable name first, raw filename underneath --- */
.stream-details { flex: 1; min-width: 0; max-width: none; }
.stream-title-line { word-break: normal; overflow-wrap: anywhere; margin-bottom: 2px; }
.stream-filename {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}
.stream-meta-line { gap: 6px; }
.stream-actions-container { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.badge-tag { white-space: nowrap; }
.badge-tag i { margin-right: 2px; opacity: 0.8; }
.badge-tag.hdr { background: rgba(255, 193, 7, 0.14); color: #ffc107; }
.badge-tag.pack { background: rgba(84, 180, 211, 0.15); color: var(--info-color); }
.advanced-heading { margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--text-muted); }

/* --- Not-digitally-released notice (was inline-styled) --- */
.unreleased-warning {
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.3);
  padding: 22px;
  border-radius: 8px;
  text-align: center;
  margin: 15px 0;
}
.unreleased-warning i { font-size: 30px; color: var(--primary-color); display: block; margin-bottom: 10px; }
.unreleased-warning h4 { margin-bottom: 8px; color: #fff; }
.unreleased-warning p { font-size: 13px; color: #c0c0c0; line-height: 1.5; max-width: 500px; margin: 0 auto; }

/* --- Episodes --- */
.episode-row-img { background-color: #262626; }
.episode-row.upcoming { opacity: 0.45; cursor: not-allowed; }
.episode-row.upcoming:hover { transform: none; box-shadow: none; background-color: rgba(255, 255, 255, 0.02); }
.episode-row.upcoming .episode-row-play-overlay { display: none; }
.episodes-empty { color: var(--text-muted); padding: 15px; text-align: center; }

/* --- Small screens --- */
@media (max-width: 768px) {
  .preset-grid { grid-template-columns: 1fr; }
  .preset-card .preset-desc { min-height: 0; }
  .modal-header-banner { height: 220px; }
  .modal-body { padding: 20px 16px; }
  .catalog-section { padding: 6px 16px; }
  .left-arrow, .right-arrow { display: none; }
}
.preset-meta { display: block; line-height: 1.5; }

/* ==========================================================================
   v70 UI refresh
   ========================================================================== */
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
html { scroll-behavior: smooth; }
body { background: #0d0d0f; }
:root { --background-color: #0d0d0f; }

/* ---------- auth screens ---------- */
.auth-screen {
  background:
    radial-gradient(ellipse at 15% 8%, rgba(229, 9, 20, 0.2), transparent 55%),
    radial-gradient(ellipse at 90% 92%, rgba(84, 180, 211, 0.13), transparent 50%),
    #0d0d0f;
}
.auth-card {
  background: rgba(28, 28, 32, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: card-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
.auth-logo { display: inline-block; animation: logo-bob 3.2s ease-in-out infinite; }
@keyframes logo-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }
.auth-input { border-radius: 10px; }
.auth-btn { border-radius: 10px; }
.auth-btn:hover { transform: translateY(-1px); }
.profile-tile-avatar { border-radius: 16px; transition: transform 0.2s, border-color 0.2s, background 0.2s; }
.profile-tile:hover .profile-tile-avatar { background: rgba(255, 255, 255, 0.12); }

/* ---------- navbar ---------- */
.navbar {
  height: 70px;
  background: linear-gradient(to bottom, rgba(8, 8, 10, 0.9), rgba(8, 8, 10, 0));
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  transition: border-color 0.3s;
}
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 15, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}
.navbar.scrolled { border-bottom-color: var(--glass-border); }
.navbar.scrolled::before { opacity: 1; }
.navbar-left { gap: 34px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-title); font-weight: 800; font-size: 25px; letter-spacing: 0.2px; }
.brand-cat { font-size: 26px; transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand:hover .brand-cat { transform: rotate(-14deg) scale(1.15); }
.brand-name { background: linear-gradient(90deg, #fff 30%, #ff8a92); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { gap: 26px; }
.nav-link { position: relative; padding: 6px 0; color: #b9b9c0; font-weight: 600; }
.nav-link::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--primary-color); transform: scaleX(0); transition: transform 0.25s ease; }
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; font-weight: 700; }
.nav-link.active::after { transform: scaleX(1); }
.nav-badge { display: inline-block; margin-left: 6px; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: var(--primary-color); color: #fff; font-size: 10px; font-weight: 800; text-align: center; vertical-align: 1px; }

.search-box { position: relative; }
#search-input { width: 260px; padding: 9px 62px 9px 38px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); }
#search-input:hover { background: rgba(255, 255, 255, 0.1); }
#search-input:focus { width: 340px; background: rgba(0, 0, 0, 0.6); }
.search-clear { position: absolute; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; font-size: 12px; }
.search-clear:hover { background: var(--primary-color); }
.search-kbd { position: absolute; right: 12px; padding: 1px 7px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.2); color: #9a9aa2; font-size: 11px; font-family: inherit; pointer-events: none; }
.search-box:focus-within .search-kbd, .search-clear:not([hidden]) ~ .search-kbd { display: none; }
.nav-admin-btn, .nav-profile-btn { transition: color 0.2s, border-color 0.2s, transform 0.2s; }
.nav-profile-btn:hover { transform: scale(1.06); }

/* ---------- hero ---------- */
.hero-banner {
  position: relative;
  height: min(80vh, 740px);
  min-height: 470px;
  max-height: none;
  display: flex;
  align-items: flex-end;
  padding: 0 4% 120px;
  margin-bottom: 0;
  background: #0d0d0f;
  overflow: hidden;
}
.content-container { padding-top: 0; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 18%; opacity: 0; transition: opacity 1.1s ease; }
.hero-bg.on { opacity: 1; animation: hero-zoom 16s ease-out forwards; }
@keyframes hero-zoom { from { transform: scale(1.07); } to { transform: scale(1); } }
.hero-overlay {
  background:
    linear-gradient(75deg, rgba(13, 13, 15, 0.94) 0%, rgba(13, 13, 15, 0.5) 42%, rgba(13, 13, 15, 0) 75%),
    linear-gradient(0deg, #0d0d0f 0%, rgba(13, 13, 15, 0.0) 34%),
    linear-gradient(180deg, rgba(13, 13, 15, 0.55) 0%, rgba(13, 13, 15, 0) 22%);
}
.hero-content { max-width: 640px; transition: opacity 0.25s ease, transform 0.25s ease; }
.hero-content.swap { opacity: 0; transform: translateY(10px); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.hero-chip { padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.13); backdrop-filter: blur(8px); font-size: 12px; font-weight: 700; }
.hero-chip.rating { color: #ffd166; }
.hero-chip i { margin-right: 4px; font-size: 10px; }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -1px; text-wrap: balance; }
.hero-overview { font-size: 16px; line-height: 1.6; max-width: 560px; -webkit-line-clamp: 3; }
.btn { padding: 12px 28px; border-radius: 10px; font-weight: 700; }
.btn-primary { box-shadow: 0 8px 26px rgba(229, 9, 20, 0.35); }
.btn-secondary { background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(10px); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.26); }
.hero-dots { position: absolute; right: 4%; bottom: 128px; display: flex; gap: 8px; z-index: 3; }
.hero-dot { position: relative; width: 28px; height: 4px; border: 0; border-radius: 3px; background: rgba(255, 255, 255, 0.28); cursor: pointer; overflow: hidden; padding: 0; }
.hero-dot::after { content: ''; position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: left; }
.hero-dot.on::after { animation: hero-dot 9s linear forwards; }
@keyframes hero-dot { to { transform: scaleX(1); } }

/* rows overlap the bottom of the hero, like a streaming app */
#home-rows { position: relative; z-index: 3; margin-top: -84px; }
.catalog-section { padding: 8px 4% 6px; margin-bottom: 14px; }
.row-header { font-size: 21px; letter-spacing: -0.2px; }
.clickable-header .see-more-link { opacity: 0.55; transform: none; }
.clickable-header:hover .see-more-link { opacity: 1; transform: translateX(3px); }

/* ---------- cards ---------- */
.media-card { border-radius: 10px; background: linear-gradient(160deg, #202024, #17171a); }
.media-card img { transition: filter 0.3s; }
.media-card:hover { transform: scale(1.07) translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7); }
.media-card:hover img { filter: brightness(0.82); }
.card-title-overlay { padding: 26px 10px 10px; font-size: 12px; }
.card-rating { position: absolute; top: 8px; left: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.74); backdrop-filter: blur(6px); font-size: 11px; font-weight: 700; opacity: 0; transition: opacity 0.2s; z-index: 2; }
.card-rating i { color: #ffd166; font-size: 9px; margin-right: 2px; }
.media-card:hover .card-rating { opacity: 1; }
@media (hover: none) { .card-rating { opacity: 1; } }

/* ---------- skeleton loading ---------- */
.skeleton-row { padding: 10px 4%; margin-bottom: 18px; }
.skeleton-title, .skeleton-cards i {
  background: linear-gradient(90deg, #19191c 25%, #242428 50%, #19191c 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
}
.skeleton-title { width: 190px; height: 22px; border-radius: 6px; margin-bottom: 14px; }
.skeleton-cards { display: flex; gap: 15px; overflow: hidden; }
.skeleton-cards i { flex: 0 0 160px; aspect-ratio: 2 / 3; border-radius: 10px; display: block; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- search / "See all" page ---------- */
#tab-search { padding: 96px 4% 40px; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.page-head .search-title-header { margin: 0; border: 0; padding: 0; font-size: 28px; letter-spacing: -0.4px; }
.back-btn { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.06); color: #fff; cursor: pointer; transition: background 0.2s, transform 0.2s; }
.back-btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateX(-2px); }
.page-count { margin-left: auto; color: var(--text-muted); font-size: 13px; font-weight: 700; }
.search-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.search-grid .media-card { width: 100%; }
#tab-downloads { padding: 100px 4% 40px; }

.empty-state { text-align: center; padding: 90px 20px; color: var(--text-muted); }
.empty-state > i { font-size: 44px; margin-bottom: 14px; color: #f0ad4e; display: block; }
.empty-state h3 { color: #fff; margin-bottom: 6px; }
.empty-state .btn { margin-top: 20px; }

/* ---------- modal + toasts ---------- */
.modal-container { border-radius: 18px; }
.modal-close { transition: background 0.2s, transform 0.2s; }
.modal-close:hover { transform: rotate(90deg); }
.toast { border-radius: 12px; border-left-width: 1px; padding: 13px 18px; gap: 12px; }
.toast > i { font-size: 16px; }
.toast.success > i { color: var(--success-color); }
.toast.error > i { color: #ff5a63; }
.toast.info > i { color: var(--info-color); }
.toast.success { border-color: rgba(70, 211, 105, 0.35); }
.toast.error { border-color: rgba(255, 90, 99, 0.4); }
.toast-container { z-index: 6000; }

/* ---------- small screens: bottom tab bar ---------- */
@media (max-width: 820px) {
  .navbar { height: 60px; padding: 0 14px; }
  .navbar-left { gap: 0; }
  .brand-name { display: none; }
  .nav-links {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 60px;
    justify-content: space-around;
    align-items: center;
    gap: 0;
    background: rgba(14, 14, 16, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    z-index: 1001;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav-link { flex: 1; text-align: center; padding: 18px 0; font-size: 13px; }
  .nav-link::after { left: 25%; right: 25%; bottom: auto; top: 0; }
  #search-input, #search-input:focus { width: 170px; }
  .search-kbd { display: none; }
  .content-container { padding-bottom: 90px; }
  .hero-banner { min-height: 440px; padding-bottom: 96px; }
  .hero-dots { bottom: 100px; right: 14px; }
  #home-rows { margin-top: -64px; }
  .catalog-section, .skeleton-row { padding-left: 14px; padding-right: 14px; }
  .skeleton-cards i { flex-basis: 120px; }
  .hero-overview { font-size: 14px; }
  #tab-search { padding-top: 80px; }
  .toast-container { bottom: 74px; right: 12px; left: 12px; }
  .toast { min-width: 0; }
}
/* Reduced motion: switch off the purely decorative animations only (the player handles its own feedback) */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg.on, .auth-logo, .auth-card, .hero-dot.on::after { animation: none !important; }
  .hero-dot.on::after { transform: scaleX(1); }
  .media-card, .hero-content, .hero-bg { transition-duration: 0.01ms !important; }
}

/* v70 fixes */
.nav-link { white-space: nowrap; }
@media (max-width: 820px) {
  .hero-banner { padding-bottom: 128px; }
  .hero-dots { bottom: 92px; left: 14px; right: auto; }
  .nav-link { font-size: 12.5px; }
  .nav-badge { margin-left: 4px; padding: 0 5px; }
}

@media (max-width: 820px) {
  .nav-link { font-size: 11.5px; padding: 18px 2px; min-width: 0; }
  .nav-badge { margin-left: 3px; padding: 0 4px; min-width: 16px; font-size: 9px; }
}
