/* ============================================
   FLIX STREAMING PLATFORM - MODERN STYLES
   ============================================ */

:root {
  --bg-dark: #050508;
  --bg-card: #0d0d14;
  --bg-elevated: #14141f;
  --border-dim: #22222e;
  --text-primary: #f0f0f5;
  --text-secondary: #a1a1b0;
  --accent-purple: #a78bfa;
  --accent-purple-dark: #8b5cf6;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Moving Monochrome Background */
body {
  user-select: none;
  background: #0a0a0f;
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(30, 30, 45, 0.4) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(20, 20, 35, 0.5) 0%, transparent 60%);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(255, 255, 255, 0.02) 40px,
    rgba(255, 255, 255, 0.02) 80px
  );
  animation: shiftBg 20s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes shiftBg {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(-100px) translateY(-100px); }
}

/* Slow floating grain texture */
body {
  background-image: 
    radial-gradient(circle at 25% 40%, rgba(45, 45, 65, 0.3) 0%, transparent 35%),
    radial-gradient(circle at 75% 60%, rgba(35, 35, 55, 0.25) 0%, transparent 40%);
  animation: slowDrift 25s ease-in-out infinite alternate;
}

@keyframes slowDrift {
  0% { background-position: 0% 0%; }
  100% { background-position: 5% 5%; }
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: #14141c;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #4a4a5e;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* Header - clean glass */
header {
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #d4d4e0;
  font-weight: 500;
}

.nav-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
  color: white;
}

.donate-btn {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border: none;
  color: white;
}

.donate-btn:hover {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

/* Discord Widget */
.discord-widget {
  background: #5865f2;
  transition: all 0.25s ease;
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.3);
}

.discord-widget:hover {
  transform: scale(1.06);
  background: #4752c4;
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.5);
}

/* Loading Spinner */
.loading-spinner {
  border: 2px solid rgba(139, 92, 246, 0.2);
  border-top: 2px solid var(--accent-purple);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Page Transitions */
.page-transition {
  animation: fadeSlideUp 0.35s ease-out;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Movie Cards */
.movie-card {
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  background: #0d0d14;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.6);
}

/* Search Input */
.search-input {
  background: #12121c !important;
  border: 1px solid #252538 !important;
  color: white !important;
  border-radius: 100px !important;
  padding: 12px 20px !important;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
  outline: none !important;
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(125deg, #c084fc, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Player Container */
.player-container {
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  aspect-ratio: 16 / 9;
}

/* Genre Buttons */
.genre-btn {
  transition: all 0.2s ease;
  font-weight: 500;
  background: rgba(20, 20, 30, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #c0c0d0;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
}

.genre-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: white;
}

.genre-btn-active {
  background: linear-gradient(105deg, #8b5cf6, #a855f7);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  border: 1px solid transparent;
}

/* Server Selector - Modern Card */
.server-paper {
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  padding: 12px 16px;
  margin-top: 12px;
  transition: all 0.2s ease;
}

.alert-banner {
  background: rgba(34, 197, 94, 0.08);
  border-radius: 40px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #4ade80;
  font-weight: 500;
}

.alert-banner svg {
  width: 18px;
  height: 18px;
  fill: #4ade80;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 48px;
  padding: 6px;
  margin-top: 8px;
}

.server-toggle {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 8px 18px;
  border-radius: 40px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.server-toggle:hover {
  background: rgba(139, 92, 246, 0.2);
  color: white;
}

.server-toggle.active {
  background: linear-gradient(105deg, #8b5cf6, #a855f7);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: rgba(0, 0, 0, 0.5);
}

.chip-success { background: #10b981; color: white; }
.chip-info { background: #3b82f6; color: white; }
.chip-error { background: #ef4444; color: white; }

/* Pagination */
.pagination-btn {
  background: rgba(26, 28, 38, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  border-radius: 40px;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.2);
  border-color: #8b5cf6;
  color: #c084fc;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Rating Badge */
.rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #facc15;
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 40%, transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1rem;
}

.movie-card:hover .play-overlay {
  opacity: 1;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.rating-modal {
  background: rgba(18, 20, 28, 0.98);
  backdrop-filter: blur(24px);
  border-radius: 32px;
  max-width: 460px;
  width: 90%;
  padding: 2rem 1.8rem;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6);
  text-align: center;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.modal-overlay.active .rating-modal {
  transform: scale(1);
}

.star-rating {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 16px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 2.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #3a3c4a;
  padding: 0;
  line-height: 1;
}

.star-btn.active-star {
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.star-btn:hover {
  transform: scale(1.1);
  color: #f59e0b;
}

.review-textarea {
  width: 100%;
  background: #1a1c28;
  border: 1px solid #2d3042;
  border-radius: 24px;
  padding: 12px 16px;
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  margin: 15px 0 10px;
  transition: all 0.2s;
}

.review-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.submit-review {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  border: none;
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  width: 100%;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.submit-review:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.submit-review:disabled {
  opacity: 0.6;
  transform: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #aaa;
  font-size: 22px;
  cursor: pointer;
  border-radius: 30px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.rating-header {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}

.rating-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

.feedback-message {
  font-size: 0.75rem;
  margin-top: 12px;
  padding: 8px;
  border-radius: 40px;
}

/* Selection */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

::-moz-selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* Responsive */
@media (max-width: 640px) {
  .grid {
    gap: 12px;
  }
  
  .server-toggle {
    padding: 6px 12px;
    font-size: 0.7rem;
  }
  
  .toggle-group {
    gap: 4px;
  }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(8, 8, 12, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: none; /* Hidden on desktop */
  justify-content: space-around;
  align-items: center;
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #a1a1b0;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 600;
  flex: 1;
  height: 100%;
  transition: all 0.2s ease;
  gap: 4px;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  color: #c084fc;
}

.mobile-nav-icon {
  width: 20px;
  height: 20px;
}

/* Hide elements depending on screen size */
@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
  }
  
  /* Add padding to body to prevent bottom nav from overlapping content */
  body {
    padding-bottom: 74px;
  }
  
  .desktop-only-nav {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mobile-only-nav {
    display: none !important;
  }
}

/* FLOATING MOVIE POSTERS BACKGROUND (moving left) */
.movie-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: #0a0a0f;
}

.poster-strip {
  position: absolute;
  display: flex;
  gap: 1.8rem;
  will-change: transform;
  animation: scrollLeft linear infinite;
  white-space: nowrap;
}

.strip-0 { top: 2%; animation-duration: 42s; }
.strip-1 { top: 16%; animation-duration: 58s; }
.strip-2 { top: 30%; animation-duration: 50s; }
.strip-3 { top: 44%; animation-duration: 65s; }
.strip-4 { top: 58%; animation-duration: 47s; }
.strip-5 { top: 72%; animation-duration: 55s; }
.strip-6 { top: 86%; animation-duration: 62s; }

@keyframes scrollLeft {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.bg-poster {
  width: 95px;
  height: 142px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(0,0,0,0.4);
  opacity: 0.6;
  transition: all 0.2s ease;
  background: #14161f;
  border: 1px solid rgba(255,255,255,0.08);
}

.bg-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bg-poster:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.bg-gradient-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 30% 20%, rgba(10,10,15,0.2) 0%, rgba(0,0,0,0.7) 100%);
}

/* Starfield Background and Stars (Guaranteed pointer-events: none) */
.starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.star {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  pointer-events: none;
  animation: floatStar 12s infinite linear alternate;
}

@keyframes floatStar {
  0% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-30px) scale(1.1); opacity: 0.4; }
}