:root {
  --background: #0a0a0b;
  --foreground: #ffffff;
  --accent: #e50914;
  /* Netflix red or something similar */
  --accent-glow: rgba(229, 9, 20, 0.5);
  --surface: #1a1a1c;
  --surface-hover: #2a2a2c;
  --card-bg: rgba(255, 255, 255, 0.05);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-muted: #a0a0a0;
  --tv-focus: #ffffff;
}

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

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
  background: radial-gradient(circle at 50% 0%, #1a1a2e 0%, #0a0a0b 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* Glassmorphism utility */
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--surface);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--surface-hover);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Grid layout for movies/series */
.content-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 2 columns on mobile by default */
  gap: 8px;
  /* Extra narrow gap */
  padding: 8px;
  /* Minimal edge padding */
}

@media (min-width: 480px) {
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 20px;
  }
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding: 30px;
  }
}

/* Responsive Header Utility */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

@media (min-width: 1024px) {
  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
  }
}

/* TV Optimization */
@media (aspect-ratio: 16/9) {
  body {
    font-size: 1.2rem;
  }
}

:focus-visible {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

/* TV Navigation Focus */
.focused {
  outline: 4px solid var(--tv-focus) !important;
  outline-offset: 4px !important;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3) !important;
  z-index: 100;
  position: relative;
}

.movie-card.focused {
  border: 2px solid var(--accent) !important;
}

.menu-item.focused {
  background: var(--surface) !important;
  color: white !important;
}

.menu-item:focus,
.movie-card:focus,
button:focus {
  transform: scale(1.05);
  box-shadow: 0 0 20px var(--accent-glow);
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 10px 0 30px;
}

.brand {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(to right, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.menu-item:hover,
.menu-item.active {
  background: var(--surface);
  color: white;
}

.admin-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 16px;
  letter-spacing: 1px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.user-info {
  margin-bottom: 15px;
  padding: 0 16px;
}

.user-email {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dashboard-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px;
  width: 100%;
}

.dashboard-content.full-width {
  margin-left: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    width: 100%;
    max-width: 300px;
    background: rgba(20, 20, 22, 0.98);
    /* Less transparent on mobile */
    border-right: 1px solid var(--accent);
  }

  .dashboard-content {
    margin-left: 0;
    padding: 10px;
    /* Minimal padding for edge-to-edge look */
    padding-top: 80px;
    /* Space for mobile header */
  }
}

.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
  background: rgba(10, 10, 11, 0.8);
}

@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
  }
}

.menu-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--glass);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 950;
}

@media (max-width: 1024px) {
  .sidebar-overlay.open {
    display: block;
  }
}

.sidebar-search {
  padding: 0 0 20px;
}

.sidebar-search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: white;
}

.sidebar-search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.movie-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 12px;
}

.movie-card:hover,
.movie-card:focus,
.movie-card:focus-visible {
  transform: scale(1.05);
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 20px var(--accent-glow);
  z-index: 10;
  outline: none;
}

.movie-poster {
  aspect-ratio: 2/3;
  position: relative;
  background: #111;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 12px 12px 0 0;
}

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

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #1a1a2e, #0a0a0b);
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-card:hover .play-overlay,
.movie-card:focus .play-overlay,
.movie-card:focus-visible .play-overlay {
  opacity: 1;
}

.movie-info {
  padding: 12px 10px;
  /* Reduced padding for mobile */
}

@media (min-width: 768px) {
  .movie-info {
    padding: 20px 16px;
  }
}

.movie-name {
  font-size: 0.85rem;
  /* Slightly smaller for mobile */
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  color: white;
}

@media (min-width: 768px) {
  .movie-name {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }
}

.movie-group {
  font-size: 0.7rem;
  /* Smaller for mobile */
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .movie-group {
    font-size: 0.75rem;
  }
}

.movie-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

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

.loader-spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}