/* ==========================================================================
   AniStream Hub - Modern Dark Glassmorphism CSS Architecture
   ========================================================================== */

:root {
  --bg-dark: #090B10;
  --bg-card: rgba(22, 27, 40, 0.7);
  --bg-glass: rgba(18, 23, 36, 0.75);
  --bg-elevated: #161C2C;
  
  --primary-color: #6C5CE7;
  --primary-gradient: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
  --accent-color: #FF7675;
  --accent-gradient: linear-gradient(135deg, #FF7675 0%, #d63031 100%);
  
  --text-main: #FFFFFF;
  --text-muted: #A0AEC0;
  --text-dim: #718096;
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(108, 92, 231, 0.4);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.35);
  --glass-backdrop: blur(16px) saturate(180%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

#app-container {
  width: 100%;
  max-width: 480px; /* Standard Mobile Viewport Width Cap */
  min-height: 100vh;
  background-color: var(--bg-dark);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  padding-bottom: 70px; /* Nav height clearance */
}

/* Header Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-bottom: 1px solid var(--border-glass);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 16px;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-name span {
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--primary-color);
}

/* Search Drawer */
.search-bar-container {
  padding: 12px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-glass);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 42px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(108, 92, 231, 0.2);
}

.clear-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

/* Main Content & Hero Carousel */
.main-content {
  flex: 1;
  padding: 16px 0;
}

.hero-section {
  padding: 0 16px;
  margin-bottom: 20px;
}

.hero-carousel {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.hero-slide {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  cursor: pointer;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 11, 16, 0.95) 0%, rgba(9, 11, 16, 0.3) 60%, rgba(9, 11, 16, 0) 100%);
}

.hero-info {
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Kategori Genre Chips */
.genre-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-chips-wrapper,
.genre-chips-wrapper {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.day-chips-wrapper::-webkit-scrollbar,
.genre-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.day-chip,
.genre-chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-chip.active,
.day-chip:hover,
.genre-chip.active,
.genre-chip:hover {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.bg-live {
  background: rgba(225, 112, 85, 0.2) !important;
  color: #ff7675 !important;
  border: 1px solid rgba(225, 112, 85, 0.4) !important;
}

.badge-day {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(108, 92, 231, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  z-index: 3;
}

/* Anime Section & Grid Cards */
.anime-section {
  padding: 0 16px;
  margin-bottom: 24px;
}

.badge-pill {
  padding: 3px 8px;
  background: rgba(255, 118, 117, 0.2);
  color: var(--accent-color);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.anime-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.anime-card:active {
  transform: scale(0.96);
}

.anime-card-poster {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background-color: var(--bg-elevated);
}

.anime-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: #F1C40F;
  display: flex;
  align-items: center;
  gap: 4px;
}

.anime-card-ep {
  position: absolute;
  bottom: 60px;
  right: 8px;
  padding: 3px 8px;
  background: var(--primary-color);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  color: #FFF;
}

.anime-card-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.anime-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-main);
}

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

/* Skeletons Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 37%, rgba(255,255,255,0.03) 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
}

@keyframes skeletonLoading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.anime-card-skeleton {
  width: 100%;
  aspect-ratio: 3/4.5;
  border-radius: var(--radius-md);
}

/* Detail Modal Drawer */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  animation: fadeIn 0.25s ease-out;
}

.detail-content {
  width: 100%;
  max-width: 480px;
  height: 90vh;
  background: var(--bg-dark);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  overflow-y: auto;
  position: relative;
  padding-bottom: 40px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
}

.detail-banner {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--bg-elevated);
}

.banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-dark) 0%, rgba(9, 11, 16, 0.4) 100%);
}

.detail-header-info {
  padding: 0 20px;
  margin-top: -50px;
  position: relative;
  z-index: 2;
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.detail-poster {
  width: 100px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
}

.detail-title-block {
  flex: 1;
}

.detail-title-block h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-japanese {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.score-badge {
  padding: 3px 8px;
  background: rgba(241, 196, 15, 0.2);
  color: #F1C40F;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.meta-pill {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
}

.detail-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #FFF;
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 16px 20px;
}

.detail-synopsis {
  padding: 0 20px 20px 20px;
}

.detail-synopsis h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.detail-synopsis p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.episodes-wrapper {
  padding: 0 20px;
}

.episodes-wrapper h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.ep-btn {
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.ep-btn.active, .ep-btn:hover {
  background: var(--primary-color);
  border-color: transparent;
  color: #FFF;
}

/* Video Player Modal */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

.player-top-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(15, 18, 26, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
}

.unreleased-notice {
  background: rgba(231, 76, 60, 0.25);
  border: 1px solid rgba(231, 76, 60, 0.6);
  color: #FF7675;
  padding: 10px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.back-btn {
  background: none;
  border: none;
  color: #FFF;
  font-size: 18px;
  cursor: pointer;
}

.player-title-info h3 {
  font-size: 14px;
  font-weight: 700;
}

.player-title-info .ep-subtitle {
  font-size: 11px;
  color: var(--primary-color);
}

.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 60vh;
  background: #000;
  position: relative;
  margin: 0 auto;
  max-width: 960px;
}

.video-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.player-loader {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.player-toolbar {
  padding: 14px 16px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.server-selector-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.server-select {
  padding: 8px 12px;
  background: rgba(108, 92, 231, 0.25);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  color: #FFF;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.player-nav-btns {
  display: flex;
  gap: 10px;
}

.btn-sm {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: #FFF;
  font-size: 12px;
  cursor: pointer;
}

.player-episodes-section {
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

.player-episodes-section h4 {
  font-size: 13px;
  margin-bottom: 10px;
}

.episodes-grid.mini {
  grid-template-columns: repeat(5, 1fr);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 62px;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-item i {
  font-size: 18px;
}

.nav-item.active {
  color: var(--primary-color);
}

/* Utilities */
.hidden {
  display: none !important;
}

.empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  color: var(--primary-color);
  opacity: 0.5;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

/* Creator / About Card Section */
.about-card-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

.creator-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(108, 92, 231, 0.15);
  color: var(--primary-color);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  border: 1px solid rgba(108, 92, 231, 0.3);
}

.creator-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #a29bfe);
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
}

.creator-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.creator-bio {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 0 10px;
}

.creator-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.c-stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 6px;
}

.stat-num {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-color);
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
}

.creator-features-list {
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.c-feature-item {
  font-size: 12px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Auth Header Button & Modal */
.auth-pill-btn {
  height: 38px;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.3), rgba(162, 155, 254, 0.2));
  color: #FFF;
  border: 1px solid rgba(108, 92, 231, 0.6);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.auth-pill-btn:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
  transform: translateY(-1px);
}

.auth-pill-btn:active {
  transform: scale(0.95);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border-radius: 12px;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #FFF;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-tab-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--border-glass);
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--primary-color);
  color: #FFF;
  box-shadow: var(--shadow-sm);
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  margin-bottom: 14px;
  text-align: center;
  font-weight: 600;
}

.auth-alert.error {
  background: rgba(235, 77, 75, 0.2);
  color: #ff7979;
  border: 1px solid rgba(235, 77, 75, 0.4);
}

.auth-alert.success {
  background: rgba(46, 213, 115, 0.2);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: #FFF;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  border-color: var(--primary-color);
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
}

/* User Profile Modal Custom Styles */
.profile-header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  text-align: center;
}

.profile-avatar-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #FFF;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.profile-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFF;
  margin-bottom: 2px;
}

.profile-email-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(46, 213, 115, 0.15);
  border: 1px solid rgba(46, 213, 115, 0.4);
  border-radius: 20px;
  color: #2ed573;
  font-size: 11px;
  font-weight: 700;
}

.btn-danger-glow {
  padding: 12px 18px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  border: none;
  border-radius: var(--radius-md);
  color: #FFF;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255, 71, 87, 0.35);
  transition: all 0.2s ease;
}

.btn-danger-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 71, 87, 0.5);
}






/* ==========================================================================
   DESKTOP & LARGE SCREEN RESPONSIVE LAYOUT OVERRIDES (MEDIA QUERIES)
   ========================================================================== */

/* Ensure hidden class ALWAYS overrides everything */
.hidden {
  display: none !important;
}

@media screen and (min-width: 768px) {
  /* Expand main container width on desktop */
  #app-container {
    max-width: 1380px !important;
    margin: 0 auto !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
    padding-bottom: 40px !important;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    border-right: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* Header adjustments for desktop */
  .app-header {
    padding: 18px 45px !important;
  }

  .brand-name {
    font-size: 1.65rem !important;
  }

  .main-content {
    padding: 24px 45px 50px !important;
  }

  /* Wide Hero Banner / Carousel */
  .hero-carousel {
    height: 380px !important;
    max-height: 420px !important;
    border-radius: 20px !important;
  }

  /* Wide Grid Layout for Anime Cards (5-6 cards per row on PC) */
  .anime-grid, #trending-grid, #otakudesu-ongoing-grid, #seasonal-grid, #history-grid, #watchlist-grid, #search-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
    gap: 24px !important;
    padding: 20px 0 !important;
  }

  /* Anime Cards Hover Effects */
  .anime-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease !important;
  }

  .anime-card:hover {
    transform: translateY(-8px) scale(1.03) !important;
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.45) !important;
    z-index: 5;
  }

  /* Hide mobile bottom navigation bar on desktop */
  .bottom-nav {
    display: none !important;
  }

  /* Modals MUST only display flex when NOT hidden */
  .detail-modal:not(.hidden), .player-modal:not(.hidden), .auth-modal:not(.hidden), #profile-modal:not(.hidden) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 30px !important;
  }

  .detail-modal .modal-content, .player-modal .modal-content, .auth-modal .modal-content, #profile-modal .modal-content {
    max-width: 950px !important;
    width: 100% !important;
    max-height: 90vh !important;
    border-radius: 24px !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  /* Wide Video Player */
  .video-container, #hls-video, #video-iframe {
    border-radius: 16px !important;
    max-height: 600px !important;
    aspect-ratio: 16 / 9 !important;
  }
}

@media screen and (min-width: 1200px) {
  #app-container {
    max-width: 1440px !important;
  }

  .anime-grid, #trending-grid, #otakudesu-ongoing-grid, #seasonal-grid, #history-grid, #watchlist-grid, #search-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

/* Header APK Download Button Styling */
.header-apk-btn {
  background: linear-gradient(135deg, #00f0ff, #7000ff);
  color: #ffffff !important;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.35);
  transition: all 0.3s ease;
  margin-right: 8px;
}

.header-apk-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.5);
  color: #ffffff !important;
}

@media screen and (max-width: 480px) {
  .header-apk-btn span {
    display: inline;
  }
  .header-apk-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}


/* ==========================================================================
   5 NEW PREMIUM FEATURES STYLING
   ========================================================================== */

/* 1. Continue Watching Banner */
.continue-watching-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.25), rgba(0, 240, 255, 0.15));
  border: 1px solid rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(16px);
  padding: 14px 20px;
  border-radius: 18px;
  margin-bottom: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.4s ease;
}

.cw-poster img {
  width: 50px;
  height: 65px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.cw-info {
  flex: 1;
}

.cw-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.cw-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.cw-sub {
  font-size: 0.8rem;
  color: #a0aec0;
}

.cw-close-btn {
  background: transparent;
  border: none;
  color: #a0aec0;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s;
}

.cw-close-btn:hover {
  color: #ffffff;
}

/* 2. Player Seek Controls */
.player-seek-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.seek-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seek-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

/* 3. Today Release Highlight Chip */
.day-chip.is-today {
  border-color: #00f0ff !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4) !important;
  position: relative;
}

.day-chip.is-today::after {
  content: 'HARI INI';
  position: absolute;
  top: -8px;
  right: -5px;
  background: #00f0ff;
  color: #090B10;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 5. Smart APK Banner (Web View) */
.apk-smart-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 23, 36, 0.95);
  border: 1px solid rgba(112, 0, 255, 0.4);
  backdrop-filter: blur(16px);
  padding: 12px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.7), 0 0 20px rgba(112, 0, 255, 0.3);
  z-index: 999;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.apk-banner-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #00f0ff, #7000ff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.apk-banner-text {
  display: flex;
  flex-direction: column;
}

.apk-banner-text strong {
  font-size: 0.88rem;
  color: white;
}

.apk-banner-text small {
  font-size: 0.75rem;
  color: #a0aec0;
}

.apk-banner-close {
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  font-size: 1.1rem;
}

@keyframes slideUp {
  from { transform: translate(-50%, 100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

@media screen and (max-width: 600px) {
  .apk-smart-banner {
    width: 90%;
    border-radius: 20px;
  }
}

/* HIDE all APK download buttons and promo banners on Mobile devices (<= 767px) */
.header-apk-btn, #apk-smart-banner, .apk-smart-banner {
  display: none !important;
}

@media screen and (min-width: 768px) {
  .header-apk-btn {
    display: inline-flex !important;
  }

  #apk-smart-banner, .apk-smart-banner {
    display: flex !important;
  }
}


/* Header Manga Pill Button */
.header-manga-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25), rgba(59, 130, 246, 0.25));
    border: 1px solid rgba(168, 85, 247, 0.45);
    color: #c084fc;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    flex-shrink: 0;
}
.header-manga-pill:hover {
    background: #9333ea;
    color: #fff;
    border-color: #9333ea;
    box-shadow: 0 0 14px rgba(147, 51, 234, 0.5);
    transform: translateY(-1px);
}
@media (max-width: 480px) {
    .header-actions {
        gap: 6px !important;
    }
    .header-manga-pill {
        padding: 5px 9px;
        font-size: 0.74rem;
        gap: 4px;
    }
    .auth-pill-btn {
        padding: 5px 9px !important;
        font-size: 0.74rem !important;
    }
    .icon-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
}
