/* public/assets/css/app.css */
:root {
  --primary: #ff0f7b;
  --primary-hover: #f89b29;
  --primary-gradient: linear-gradient(135deg, #ff0f7b 0%, #f89b29 100%);
  --bg-dark: #0a0a0f;
  --bg-darker: #050507;
  --bg-card: #14141e;
  --text-main: #f0f0f5;
  --text-muted: #8b8b99;
  --border-color: rgba(255, 255, 255, 0.08);
  --navbar-bg: rgba(10, 10, 15, 0.75);
  --danger: #ff4757;
  --success: #2ed573;
  --warning: #ffa502;
  
  --font-family: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font-family);
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(255, 15, 123, 0.3);
}

.btn-primary:hover {
  background: var(--primary-gradient);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 15, 123, 0.5);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.btn-ghost {
  background-color: rgba(109, 109, 110, 0.7);
  color: white;
}

.btn-ghost:hover {
  background-color: rgba(109, 109, 110, 0.4);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-warning {
  background-color: var(--warning);
  color: #212529;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1.125rem;
}

.btn-full {
  width: 100%;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: var(--navbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  transition: height 0.3s ease;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.brand-text {
  color: var(--text-main);
}

.brand-accent {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 20px;
}

.search-form {
  display: flex;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  padding-right: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}

.search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  color: white;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-weight: 500;
  color: #e5e5e5;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-admin {
  color: var(--warning);
}

.nav-admin:hover {
  color: #ffda6a;
}

.nav-user-menu {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 5px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(255, 15, 123, 0.3);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 0;
  margin-top: 10px;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.user-dropdown.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-main);
}

.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-item-danger {
  color: var(--danger);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0;
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-mobile-toggle span {
  width: 100%;
  height: 2px;
  background-color: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  height: calc(100vh - 70px);
  background-color: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 30px 20px;
  z-index: 999;
  overflow-y: auto;
  border-top: 1px solid var(--border-color);
}

.mobile-menu.show {
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: slideDown 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-search-form {
  display: flex;
  position: relative;
  gap: 10px;
  margin-bottom: 15px;
}

.mobile-search-form .search-input {
  width: 100%;
}

.mobile-link {
  display: block;
  font-size: 1.1rem;
  padding: 12px 15px;
  border-radius: 8px;
  transition: var(--transition);
}

.mobile-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--primary);
  padding-left: 20px;
}

.mobile-link-danger {
  color: var(--danger);
}

@media (max-width: 992px) {
  .navbar-search, .navbar-menu {
    display: none;
  }
  .nav-mobile-toggle {
    display: flex;
  }
  .navbar-brand {
    font-size: 1.35rem;
  }
}

@media (max-width: 768px) {
  .navbar { height: 60px; }
  .navbar-container { padding: 0 15px; }
  .mobile-menu { top: 60px; height: calc(100vh - 60px); }
  .main-content { padding-top: 60px; }
  .footer { padding: 40px 0 100px 0; } /* Padding for bottom nav */
  .footer-brand { font-size: 1.3rem; }
  .bottom-nav { display: flex; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.8rem !important; word-break: break-word; }
  .hero { height: 50vh; min-height: 400px; }
}

/* Main Content */
.main-content {
  padding-top: 70px;
  min-height: calc(100vh - 100px);
}

/* Bottom Nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background-color: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 4px;
  flex: 1;
  height: 100%;
  transition: var(--transition);
}

.bottom-nav-item span {
  font-size: 0.7rem;
  font-weight: 500;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
  color: var(--primary);
}

/* Footer */
.footer {
  background-color: var(--bg-darker);
  padding: 40px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-brand {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-text {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.footer-copy {
  font-size: 0.875rem;
  color: #777;
}

/* Hero Section */
.hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: top center;
  display: flex;
  align-items: flex-end;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, var(--bg-dark) 0%, transparent 60%, rgba(10, 10, 15, 0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 0 5% 5% 5%;
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 12px;
  background: var(--primary-gradient);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 15px rgba(255, 15, 123, 0.4);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 10px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  line-height: 1.1;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: #e5e5e5;
  margin-bottom: 25px;
}

.meta-dot {
  font-size: 1.5rem;
  line-height: 0;
}

.hero-actions {
  display: flex;
  gap: 15px;
}

@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; margin-bottom: 15px; word-break: break-word; line-height: 1.2; }
  .hero { height: 60vh; min-height: 450px; }
  .hero-content { padding: 0 20px 40px 20px; text-align: center; margin: 0 auto; width: 100%; }
  .hero-meta { justify-content: center; flex-wrap: wrap; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 300px; margin: 0 auto; gap: 12px; }
  .hero-actions .btn { width: 100%; }
}

/* Movie Grids */
.section {
  padding: 40px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.section-title {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.movies-grid-small {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

@media (max-width: 576px) {
  .container { padding: 0 15px; }
  .section { padding: 25px 0; }
  .section-title { font-size: 1.3rem; }
  .movies-grid, .movies-grid-small {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 20px;
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    align-items: flex-start;
  }

  /* Trả về dạng lưới dọc cho trang Lọc Phim và Tìm kiếm trên mobile */
  .filter-results .movies-grid, 
  .search-results .movies-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    margin: 0;
    padding: 0;
    gap: 12px;
    scroll-snap-type: none;
  }
  
  .filter-results .movie-card,
  .search-results .movie-card {
    flex: none;
    width: 100%;
  }

  .movies-grid::-webkit-scrollbar, .movies-grid-small::-webkit-scrollbar {
    display: none;
  }
  .movie-card {
    flex: 0 0 42vw;
    scroll-snap-align: start;
  }
  .movie-name { font-size: 0.95rem; }
  .movie-sub { font-size: 0.8rem; }
  .play-icon { width: 40px; height: 40px; }
  .movie-badge { font-size: 0.7rem; padding: 3px 8px; }
}

.movie-card {
  display: block;
  transition: var(--transition);
  position: relative;
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.movie-poster {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--border-color);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  transition: var(--transition);
  display: block;
}

@supports not (aspect-ratio: 2 / 3) {
  .movie-poster {
    padding-top: 150%;
    height: 0;
  }
}

.movie-card:hover .movie-poster {
  box-shadow: 0 12px 30px rgba(255, 15, 123, 0.25);
}

.movie-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.movie-card:hover .movie-poster img {
  transform: scale(1.1);
}

.movie-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-card:hover .movie-overlay {
  opacity: 1;
}

.play-icon {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(255, 15, 123, 0.5);
}

.play-icon:hover {
  transform: scale(1.15);
}

.movie-badge {
  position: absolute;
  top: 10px;
  background: var(--primary-gradient);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.year-badge { left: 10px; }
.episode-badge { right: 10px; }

.movie-rating {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}

.movie-info {
  padding-top: 10px;
}

.movie-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.movie-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Auth Pages */
.auth-body {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-darker);
}

.auth-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://assets.nflxext.com/ffe/siteui/vlv3/ca6a7616-0acb-4bc5-be25-c4deef0419a7/c5af601a-6657-4531-8f82-22e629a3795e/VN-vi-20231211-popsignuptwoweeks-perspective_alpha_website_large.jpg');
  background-size: cover;
  background-position: center;
}

.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.auth-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 450px;
  padding: 20px;
}

.auth-card {
  background-color: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.auth-logo {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 30px;
}

.auth-title {
  font-size: 2rem;
  margin-bottom: 10px;
}

.auth-subtitle {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #ccc;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 15px;
  color: #8c8c8c;
}

.form-input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  background-color: #333;
  border: 1px solid transparent;
  border-radius: 4px;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus {
  background-color: #444;
  border-color: var(--primary);
}

.toggle-password {
  position: absolute;
  right: 15px;
  background: none;
  border: none;
  color: #8c8c8c;
  cursor: pointer;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  color: #8c8c8c;
}

.auth-link {
  color: white;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.alert, .alert-error {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--danger);
  color: #ff6b6b;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid #28a745;
  color: #28a745;
}

/* Movie Detail */
.movie-detail-hero {
  height: 40vh;
  min-height: 300px;
  background-image: var(--thumb);
  background-size: cover;
  background-position: center;
  position: relative;
  margin-top: -70px;
}

.detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, var(--bg-dark) 0%, rgba(20, 20, 20, 0.7) 100%);
}

.movie-detail-container {
  margin-top: -150px;
  position: relative;
  z-index: 10;
}

.detail-layout {
  display: flex;
  gap: 40px;
}

.detail-poster-col {
  flex: 0 0 300px;
}

.detail-poster-wrap {
  position: sticky;
  top: 90px;
}

.detail-poster {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
}

.favorite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: white;
  font-weight: 600;
}

.favorite-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.favorite-btn.is-favorite {
  color: var(--primary);
  border-color: var(--primary);
}

.detail-info-col {
  flex: 1;
  padding-top: 20px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-type { background-color: var(--primary); }
.badge-status { background-color: var(--success); }
.badge-quality { background-color: var(--warning); color: #000; }
.badge-lang { background-color: #17a2b8; }

.detail-title {
  font-size: 3rem;
  margin-bottom: 5px;
}

.detail-origin {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 25px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 8px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.rating-value {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #FFD700;
}

.detail-tags {
  margin-bottom: 15px;
}

.tags-label {
  color: var(--text-muted);
  margin-right: 10px;
  font-weight: 500;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 0 5px 5px 0;
  color: #e5e5e5;
}

.tag:hover {
  background-color: var(--primary);
  color: white;
}

.tag-plain {
  background: none;
  padding: 0;
  margin-right: 15px;
}
.tag-plain:hover { background: none; color: white; }

.detail-desc {
  margin: 30px 0;
}

.desc-title {
  font-size: 1.3rem;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.desc-text {
  color: #ccc;
  line-height: 1.8;
  max-height: 150px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

.desc-text.expanded {
  max-height: 1000px;
}

.desc-text::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(to top, var(--bg-dark), transparent);
}

.desc-text.expanded::after {
  display: none;
}

.desc-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  padding: 0;
  font-size: 1rem;
}

.detail-cta {
  display: flex;
  gap: 20px;
  margin-top: 30px;
}

.episodes-section {
  margin: 50px 0;
}

.episodes-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.server-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1px;
}

.server-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.server-tab.active {
  color: white;
  border-bottom-color: var(--primary);
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.episode-grid.hidden {
  display: none;
}

.episode-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: center;
  border-radius: 4px;
  font-weight: 500;
}

.episode-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.episode-current {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

@media (max-width: 768px) {
  .detail-layout { flex-direction: column; }
  .detail-poster-col { flex: none; max-width: 250px; margin: 0 auto; }
  .movie-detail-container { margin-top: -100px; }
  .detail-title { font-size: 2rem; }
  .detail-cta { flex-direction: column; }
}

/* Watch Page */
.watch-page {
  padding-top: 20px;
}

.player-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background-color: #000;
  position: relative;
}

.player-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.player-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 15px;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 20px;
}

.watch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.watch-title {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.watch-ep-badge {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.2rem;
}

.watch-servers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.servers-label {
  font-weight: 600;
  color: var(--text-muted);
}

.server-pill {
  padding: 6px 15px;
  background-color: var(--bg-card);
  border-radius: 20px;
  font-size: 0.9rem;
}

.server-pill.active {
  background-color: var(--primary);
  color: white;
}

.watch-episodes {
  background-color: var(--bg-card);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.episodes-nav-title {
  margin-bottom: 15px;
}

.episodes-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}

.episodes-scroll::-webkit-scrollbar { width: 6px; }
.episodes-scroll::-webkit-scrollbar-track { background: var(--bg-dark); }
.episodes-scroll::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.ep-pill {
  min-width: 60px;
  text-align: center;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.9rem;
}

.ep-pill:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.ep-pill.active {
  background-color: var(--primary);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border-radius: 4px;
  font-weight: 600;
}

.page-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.page-btn.active {
  background-color: var(--primary);
  color: white;
}

/* Empty States */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 15px;
}

/* Category & Search Pages */
.page-header {
  margin: 40px 0 30px;
  display: flex;
  align-items: baseline;
  gap: 15px;
}

.page-title {
  font-size: 2rem;
}

.page-count {
  color: var(--text-muted);
}

.search-keyword {
  color: var(--primary);
}

.search-page-wrapper {
  display: flex;
  max-width: 600px;
  gap: 10px;
  margin-bottom: 40px;
}

.search-page-input {
  flex: 1;
  padding: 15px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: white;
  font-size: 1.1rem;
}

/* User Profile */
.profile-container {
  max-width: 900px;
  padding-top: 40px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: bold;
}

.profile-name {
  font-size: 2rem;
  margin-bottom: 5px;
}

.profile-email {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.badge-admin, .role-admin { background-color: rgba(255, 193, 7, 0.2); color: var(--warning); }
.badge-user, .role-user { background-color: rgba(255, 255, 255, 0.1); color: white; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 5px;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.profile-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.profile-tab.active {
  color: white;
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.movie-card-wrapper {
  position: relative;
}

.remove-fav-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(220, 53, 69, 0.8);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-card-wrapper:hover .remove-fav-btn {
  opacity: 1;
}

.remove-fav-btn:hover {
  background-color: var(--danger);
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.history-item {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  padding: 15px;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.history-item:hover {
  transform: translateX(5px);
  background-color: rgba(255, 255, 255, 0.05);
}

.history-thumb {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 20px;
}

.history-info {
  flex: 1;
}

.history-name {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.history-ep {
  color: var(--primary);
  font-size: 0.9rem;
  margin-right: 15px;
}

.history-time {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.history-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin Panel */
.admin-container {
  padding-top: 40px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.current-user-row {
  background-color: rgba(40, 167, 69, 0.05);
}

.self-badge {
  color: var(--success);
  font-weight: bold;
}

.admin-actions-cell {
  
  gap: 8px;
  align-items: center;
}

.admin-actions-cell form {
  margin: 0;
}

.admin-actions-cell .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.btn-status { width: 75px; }
.btn-role { width: 90px; }
.btn-delete { width: 60px; }

/* Filter Page Layout */
.filter-page { padding-top: 30px; }
.filter-layout { display: flex; gap: 30px; align-items: flex-start; }
.filter-sidebar { 
  flex: 0 0 280px; 
  background-color: var(--bg-card); 
  padding: 25px; 
  border-radius: 8px; 
  position: sticky; 
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.filter-sidebar::-webkit-scrollbar {
  width: 6px;
}
.filter-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.filter-results { flex: 1; min-width: 0; }
.filter-select { 
  width: 100%; 
  padding: 12px 40px 12px 15px; 
  border-radius: 8px; 
  border: 1px solid var(--border-color); 
  background-color: var(--bg-card); 
  color: white; 
  font-size: 1rem; 
  outline: none; 
  appearance: none; 
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 15px top 50%;
  background-size: 12px auto;
}
.filter-select:focus { border-color: var(--primary); }
.filter-select option { background-color: var(--bg-card); color: white; }
.results-count { color: var(--text-muted); margin-bottom: 20px; font-size: 1.1rem; }
.filter-actions { margin-top: 30px; }
@media (max-width: 768px) {
  .filter-layout { flex-direction: column; }
  .filter-sidebar { flex: none; width: 100%; position: static; }
}
/* Admin & Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background-color: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid #28a745;
}

.status-pending {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.current-user-row {
  background-color: rgba(229, 9, 20, 0.05);
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-outline {
  background: transparent;
  border: 1px solid #555;
  color: #ccc;
}

.btn-outline:hover {
  background: #333;
  border-color: #777;
  color: #fff;
}

