:root {
  color-scheme: dark;
  --bg: #0f1115;
  --panel: rgba(21, 23, 28, 0.6);
  /* Semi-transparent for glass */
  --card: #1c1f26;
  --text: #e2e8f0;
  --muted: #94a3b8;

  /* Modern Accent Gradient (Violet to Pink) */
  --primary-start: #8b5cf6;
  --primary-end: #ec4899;
  --accent: #ec4899;

  --border: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.06);
  --radius: 20px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: #0f1115;
  background-image:
    radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08), transparent 25%);
  color: var(--text);
  min-height: 100vh;
  padding: 32px;
  overflow-x: hidden;
}

.page {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============== Glassmorphism Components ============== */
.glass-panel {
  background: rgba(22, 24, 29, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}

/* ============== Hero Section ============== */
.hero {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-radius: var(--radius);
  /* Apply glass style */
  background: rgba(22, 24, 29, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glow);
}

.hero__brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand__badge {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: #fff;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 12px;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.3);
  text-transform: uppercase;
  font-size: 14px;
}

.hero h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.hero p {
  color: var(--muted);
  font-size: 14px;
}

.hero__metrics {
  display: flex;
  gap: 24px;
}

/* Redesigned Metrics (Icon + Number) */
.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  background: transparent;
  border: none;
}

.metric:hover {
  transform: translateY(-2px);
}

.metric__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: initial;
}

.metric__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ============== Toolbar ============== */
.toolbar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: rgba(22, 24, 29, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  position: sticky;
  top: 20px;
  z-index: 100;
}

.search {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  max-width: 600px;
}

.search input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 48px 12px 16px;
  /* Space for button */
  font-size: 14px;
  transition: all 0.2s;
}

.search input:focus {
  background: rgba(0, 0, 0, 0.5);
  border-color: var(--primary-start);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
  outline: none;
}

.search input::placeholder {
  color: var(--zinc-500);
}

.search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  border-radius: 8px;
  background: var(--primary-start);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-width: 36px;
  height: 36px;
}

.search button:hover {
  background: var(--primary-end);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.search button svg {
  width: 18px;
  height: 18px;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-3), #16a34a) !important;
  color: #fff !important;
}

.btn-accent:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4) !important;
}

.filters {
  display: flex;
  gap: 16px;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.filter select {
  background: #11141a;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

/* ============== Preview Panel ============== */
.preview-panel {
  grid-column: 1 / -1;
  background: transparent;
  margin-bottom: 32px;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  perspective: 1000px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.preview-card {
  display: flex;
  background: rgba(24, 24, 27, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.preview-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.preview-loading,
.preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 180px;
  color: var(--muted);
}

.preview-error {
  color: var(--accent);
}

.preview-content {
  display: flex;
  gap: 24px;
}

.preview-cover {
  width: 200px;
  flex-shrink: 0;
}

.preview-cover img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.preview-info {
  flex: 1;
}

.preview-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.preview-code {
  background: var(--accent);
  color: #0a0a0a;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.preview-date {
  color: var(--muted);
  font-size: 14px;
}

.preview-title {
  font-size: 18px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}

.meta-row {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.meta-label {
  color: var(--muted);
  flex-shrink: 0;
}

.meta-value {
  color: var(--text);
}

.preview-resources {
  display: flex;
  gap: 24px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.resource-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.resource-stat strong {
  font-size: 24px;
  color: var(--accent-2);
}

.resource-stat span {
  font-size: 12px;
  color: var(--muted);
}

.preview-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.preview-actions .btn-accent {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-actions .btn-accent:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-large {
  padding: 14px 24px !important;
  font-size: 16px !important;
}

/* ============== Modern Movie Card Design ============== */
:root {
  --zinc-950: #09090b;
  --zinc-900: #18181b;
  --zinc-800: #27272a;
  --zinc-700: #3f3f46;
  --zinc-600: #52525b;
  --zinc-500: #71717a;
  --zinc-400: #a1a1aa;

  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;

  --card-bg: var(--zinc-900);
  --card-border: var(--zinc-800);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: linear-gradient(145deg, rgba(39, 39, 42, 0.6) 0%, rgba(24, 24, 27, 0.8) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* More subtle glass border */
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Poster - 2:3 Aspect Ratio */
.card__poster {
  position: relative;
  width: 100%;
  padding-top: 150%;
  background: #0f1116;
  overflow: hidden;
}

.card__cover-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card__cover-img {
  transform: scale(1.05);
}

.card__cover-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--zinc-900);
  color: var(--zinc-700);
}

/* Badges & Overlays */
.card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.card__badges {

  /* ============== Sidebar (Insights) ============== */
  .insights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
  }

  .insights__card {
    background: rgba(22, 24, 29, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px;
    /* Reduced padding */
    box-shadow: var(--shadow-sm);
  }

  /* System Status Row Layout */
  .system-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
  }

  .status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
  }

  /* ============== Modern Card Hover Effects ============== */
  .card {
    position: relative;
    /* Remove min-height fix, let it be determined by content/aspect ratio */
    background: var(--card-bg);
    /* Fallback */
  }

  .card__poster {
    /* Ensure poster is covered properly */
    background: #000;
  }

  /* Code Badge (New) */
  .card__code-badge {
    background: var(--primary-start);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 4px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  /* Hide Meta/Body initially */
  .card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 20px;
    z-index: 2;
    transform: translateY(100%);
    /* Start fully pushed down? No, 20px is better for subtle */
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .card:hover .card__body {
    transform: translateY(0);
    opacity: 1;
  }

  .card__title {
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card__meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
  }

  /* New Card Actions */
  .card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .card__action-btn {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    /* Larger hit area */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card__action-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
  }

  .card__action-btn svg {
    width: 20px;
    /* Specific size for icons */
    height: 20px;
    stroke-width: 2;
  }

  .card__action-btn.danger:hover {
    color: #ff4d4f;
    background: rgba(255, 77, 79, 0.15);
  }

  /* Make actor link clickable again */
  .actor-link {
    cursor: pointer;
    transition: color 0.2s;
  }

  .actor-link:hover {
    color: #fff;
    text-decoration: underline;
  }

  .btn-pill-primary {
    background: var(--indigo-600);
    color: white;
    border: none;
    border-radius: 100px;
    /* Full pill */
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-pill-primary:hover {
    background: var(--indigo-500);
    transform: translateY(-1px);
  }

  .btn-pill-primary svg {
    width: 14px;
    height: 14px;
  }

  /* Ghost Icons (Secondary) */
  .card__tools {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--zinc-500);
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-ghost:hover {
    background: var(--zinc-800);
    color: var(--zinc-200);
  }

  .btn-ghost.active {
    color: #10b981;
    /* emerald-500 */
    background: rgba(16, 185, 129, 0.1);
  }

  .btn-ghost.danger:hover {
    color: #ef4444;
    /* red-500 */
    background: rgba(239, 68, 68, 0.1);
  }

  /* Admin Only visibility */
  body.guest-mode .admin-only {
    display: none !important;
  }


  /* ============== Empty State ============== */
  .empty-state {
    grid-column: 1;
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
  }

  .empty-state p:first-child {
    font-size: 48px;
    margin-bottom: 16px;
  }

  /* ============== Insights Sidebar ============== */
  .insights {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .insights__card {
    background: var(--panel);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  .insights__card h3 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .muted {
    color: var(--muted);
    font-size: 14px;
  }

  .status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
  }

  .status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
  }

  .status__dot--ok {
    background: var(--accent-3);
    box-shadow: 0 0 8px var(--accent-3);
  }

  .status__dot--warn {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
  }

  .status__dot--error {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
  }

  .status__dot--loading {
    background: var(--muted);
    animation: pulse 1.5s infinite;
  }

  @keyframes pulse {

    0%,
    100% {
      opacity: 0.4;
    }

    50% {
      opacity: 1;
    }
  }

  #alerts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  #alerts-list li {
    padding: 10px 12px;
    background: #12151c;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
  }

  /* ============== Modal ============== */
  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }

  .modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
  }

  .modal__content {
    position: relative;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
  }

  .modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
  }

  .modal__close:hover {
    color: var(--text);
  }

  .modal__body {
    padding: 32px;
  }

  .detail-loading,
  .detail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 200px;
    color: var(--muted);
  }

  .detail-header {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
  }

  .detail-cover {
    width: 250px;
    flex-shrink: 0;
  }

  .detail-cover img {
    width: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }

  .detail-info h2 {
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 4px;
  }

  .detail-info h3 {
    font-size: 22px;
    margin-bottom: 16px;
    line-height: 1.4;
  }

  .detail-meta p {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--muted);
  }

  .detail-meta strong {
    color: var(--text);
    margin-right: 8px;
  }

  .detail-actions {
    display: flex;
    gap: 32px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
  }

  .rating-section {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .rating-section label {
    color: var(--muted);
    font-size: 14px;
  }

  .star-rating {
    display: flex;
    gap: 2px;
  }

  .star-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .star-btn.active,
  .star-btn:hover {
    color: #f59e0b;
  }

  #rating-display {
    font-weight: 600;
    color: var(--accent-2);
  }

  .toggle-section {
    display: flex;
    gap: 20px;
    align-items: center;
  }

  .toggle-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
  }

  .toggle-section input {
    width: 18px;
    height: 18px;
    cursor: pointer;
  }

  .detail-resources h4 {
    margin-bottom: 12px;
    font-size: 16px;
  }

  .resource-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
  }

  .tab-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
  }

  .tab-btn.active,
  .tab-btn:hover {
    background: var(--accent-2);
    color: #0b0f19;
    border-color: var(--accent-2);
  }

  .resource-list {
    max-height: 300px;
    overflow-y: auto;
  }

  .resource-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
  }

  .resource-info {
    flex: 1;
    min-width: 0;
  }

  .resource-title {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
  }

  .resource-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
  }

  .resource-size {
    font-size: 12px;
    color: var(--muted);
  }

  .resource-link {
    padding: 6px 12px;
    background: var(--accent-2);
    color: #0b0f19;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 12px;
  }

  .no-resources {
    text-align: center;
    padding: 24px;
    color: var(--muted);
  }

  .detail-samples h4 {
    margin: 24px 0 12px;
    font-size: 16px;
  }

  .samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .samples-grid img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .samples-grid img:hover {
    transform: scale(1.05);
  }

  /* ============== Spinner ============== */
  .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }



  /* ============== Responsive ============== */
  @media (max-width: 1024px) {
    .page {
      grid-template-columns: 1fr;
    }

    .hero {
      flex-direction: column;
      align-items: flex-start;
      gap: 20px;
    }

    .toolbar {
      flex-direction: column;
    }

    .search {
      flex-wrap: wrap;
    }

    .preview-content {
      flex-direction: column;
    }

    .preview-cover {
      width: 100%;
      max-width: 300px;
    }

    .detail-header {
      flex-direction: column;
    }

    .detail-cover {
      width: 100%;
      max-width: 300px;
    }

    .detail-actions {
      flex-direction: column;
      gap: 16px;
    }
  }

  @media (max-width: 600px) {
    body {
      padding: 16px;
    }

    .hero__metrics {
      flex-wrap: wrap;
      gap: 12px;
    }

    .metric {
      min-width: 80px;
    }

    .cards {
      grid-template-columns: 1fr;
    }

    .modal__content {
      width: 95%;
    }
  }

  /* ============== Login & Auth Styles ============== */
  .btn-login {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .btn-login:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .btn-login.logged-in {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-3);
    border-color: rgba(34, 197, 94, 0.3);
  }

  .btn-logout {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
  }

  .btn-logout:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
  }

  .modal__content--small {
    max-width: 400px;
  }

  .login-form {
    padding: 24px;
  }

  .login-form h2 {
    margin-bottom: 8px;
    font-size: 24px;
  }

  .login-hint {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--muted);
  }

  .form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f1116;
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s ease;
  }

  .form-group input:focus {
    outline: none;
    border-color: var(--accent-2);
  }

  .form-error {
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
  }

  .btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent-2), #4f8cff);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .btn-submit:hover {
    box-shadow: 0 4px 16px rgba(91, 157, 255, 0.4);
    transform: translateY(-1px);
  }

  .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Guest mode - hide admin controls */
  body.guest-mode .admin-only {
    display: none !important;
  }

  body.guest-mode .search {
    display: none !important;
  }

  .guest-notice {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 20px;
  }

  .guest-notice a {
    color: var(--accent-2);
    cursor: pointer;
    text-decoration: underline;
  }

  /* Toast Notifications - Top Right */
  .toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(8px);
    color: #fafafa;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateY(-10px) scale(0.95);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
  }

  .toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .toast-success {
    border-left: 3px solid #10b981;
  }

  .toast-error {
    border-left: 3px solid #ef4444;
  }

  /* ============== Resource List & Badges ============== */
  .resource-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
  }

  .resource-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .resource-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
  }

  .resource-title {
    font-size: 14px;
    color: var(--text);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .resource-size {
    font-size: 12px;
    color: var(--muted);
  }

  .resource-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
  }

  .resource-link {
    background: linear-gradient(135deg, var(--accent-2), #4f8cff);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
  }

  .resource-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(91, 157, 255, 0.3);
  }

  .resource-link.copied {
    background: #10b981;
  }

  /* Quality Badges */
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .badge-4k {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #fff;
  }

  .badge-fhd {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #fff;
  }

  .badge-hd {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
  }

  .badge-uc {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
  }

  .badge-leaked {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
  }

  .badge-ai {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
  }

  .badge-sub {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
  }

  .no-resources {
    color: var(--muted);
    text-align: center;
    padding: 24px;
    font-size: 14px;
  }

  /* ============== Actor Link Styling ============== */
  .actor-link {
    cursor: pointer;
    color: var(--accent-2);
    transition: color 0.2s, text-decoration 0.2s;
  }

  .actor-link:hover {
    color: var(--accent);
    text-decoration: underline;
  }

  /* ============== Actor Modal ============== */
  .modal__content--large {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    padding: 0;
  }

  .actor-modal {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 32px;
    padding-top: 48px;
    /* Space for close button */
  }

  .actor-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
  }

  .actor-modal__avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(91, 157, 255, 0.3);
  }

  .actor-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
  }

  .actor-modal__avatar svg {
    stroke: #fff;
    opacity: 0.7;
    width: 48px;
    height: 48px;
  }

  .actor-modal__info {
    flex: 1;
    min-width: 0;
  }

  .actor-modal__name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .actor-modal__stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
  }

  .actor-modal__progress {
    color: var(--muted);
    font-size: 14px;
  }

  .actor-modal__badges {
    display: flex;
    gap: 6px;
  }

  .badge-achievement {
    font-size: 18px;
    background: none;
    padding: 0;
  }

  /* Progress Bar */
  .progress-bar {
    height: 8px;
    background: var(--card);
    border-radius: 4px;
    overflow: hidden;
  }

  .progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-3), #4ade80);
    border-radius: 4px;
    transition: width 0.5s ease;
  }

  .actor-modal__actions {
    display: flex;
    gap: 12px;
  }

  .actor-modal__actions .btn-primary,
  .actor-modal__actions .btn-secondary {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
  }

  .actor-modal__actions .btn-primary {
    background: var(--accent);
    color: #fff;
  }

  .actor-modal__actions .btn-primary:hover {
    background: #ff8080;
  }

  .actor-modal__actions .btn-primary.active {
    background: #666;
  }

  .actor-modal__actions .btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
  }

  .actor-modal__actions .btn-secondary:hover {
    background: #2a2d35;
  }

  .actor-modal__actions .btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Filter Buttons */
  .actor-modal__filter {
    display: flex;
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    transition: all 0.2s;
  }

  .filter-btn:hover {
    background: var(--card);
    color: var(--text);
  }

  .filter-btn.active {
    background: var(--accent-2);
    color: #fff;
    border-color: var(--accent-2);
  }

  /* Actor Movies Grid */
  .actor-modal__movies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
  }

  .actor-modal__movies::-webkit-scrollbar {
    width: 6px;
  }

  .actor-modal__movies::-webkit-scrollbar-track {
    background: transparent;
  }

  .actor-modal__movies::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
  }

  .actor-modal__loading,
  .actor-modal__empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--muted);
  }

  /* Actor Movie Card */
  .actor-movie-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card);
    cursor: pointer;
    transition: transform 0.2s, filter 0.3s, opacity 0.3s;
  }

  .actor-movie-card:hover {
    transform: scale(1.05);
  }

  /* Unwatched: Grayscale */
  .actor-movie-card--unwatched {
    filter: grayscale(100%);
    opacity: 0.7;
  }

  .actor-movie-card--unwatched:hover {
    filter: grayscale(0%);
    opacity: 1;
  }

  /* Watched: Full color with check */
  .actor-movie-card--watched {
    filter: none;
    opacity: 1;
  }

  .actor-movie-card__poster {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--panel);
  }

  .actor-movie-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .actor-movie-card__check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-3);
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
  }

  .actor-movie-card__info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .actor-movie-card__code {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
  }

  .actor-movie-card__rating {
    font-size: 11px;
    color: var(--muted);
  }

  /* Responsive */
  @media (max-width: 768px) {
    .actor-modal__header {
      flex-direction: column;
      text-align: center;
    }

    .actor-modal__actions {
      width: 100%;
      justify-content: center;
    }

    .actor-modal__movies {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
  }

  /* ============== Comment Section ============== */
  .comment-section {
    padding: 10px 0;
  }

  .comment-section h2 {
    margin-bottom: 16px;
    font-size: 18px;
  }

  .comment-section h3 {
    margin: 16px 0 12px;
    font-size: 14px;
    color: var(--muted);
  }

  .comment-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
  }

  .comments-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 16px;
  }

  .comments-list .loading {
    color: var(--muted);
    font-style: italic;
  }

  .comments-list .no-comments {
    color: var(--muted);
    text-align: center;
    padding: 20px;
  }

  .comment-item {
    background: var(--card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .comment-item__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
  }

  .comment-item__author {
    font-weight: 600;
    color: var(--accent-2);
    font-size: 13px;
  }

  .comment-item__date {
    font-size: 11px;
    color: var(--muted);
  }

  .comment-item__content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
  }

  .captcha-group {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .captcha-group label {
    flex: 1;
    font-weight: 500;
    color: var(--accent);
  }

  .captcha-group input {
    width: 80px;
  }

  /* Guest Mode - Hide admin controls */
  body.guest-mode .admin-only {
    display: none !important;
  }

  body.guest-mode .search {
    display: none;
  }

  body.guest-mode .toolbar {
    justify-content: flex-end;
  }

  /* ============== Confirm Modal ============== */
  .confirm-box {
    padding: 32px;
    text-align: center;
  }

  .confirm-box h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text);
  }

  .confirm-box p {
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.5;
  }

  .confirm-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
  }

  .confirm-actions button {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
  }

  .btn-secondary {
    background: var(--zinc-800);
    color: var(--text);
  }

  .btn-secondary:hover {
    background: var(--zinc-700);
  }

  .btn-danger {
    background: #ef4444;
    color: white;
  }

  .btn-danger:hover {
    background: #dc2626;
  }