/* ═══════════════════════════════════════════════════════════════
   ARCTIC FUSE 3 KODI SKIN THEME
   Inspired by Arctic Horizon 2 / Arctic Fuse 3 - Clean, modern, 
   icy blue aesthetic with smooth animations and glass morphism
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Arctic Fuse 3 Color Palette - Ice/Crystal Theme */
  --arctic-bg-primary: #0a0e14;
  --arctic-bg-secondary: #0f1620;
  --arctic-bg-tertiary: #141f2e;
  --arctic-surface: rgba(20, 31, 46, 0.85);
  --arctic-surface-glass: rgba(20, 31, 46, 0.65);
  --arctic-accent-primary: #00d4ff;
  --arctic-accent-secondary: #0099cc;
  --arctic-accent-glow: rgba(0, 212, 255, 0.4);
  --arctic-ice-blue: #7de3ff;
  --arctic-frost: #b8f0ff;
  --arctic-snow: #e6f7ff;
  --arctic-text-primary: #ffffff;
  --arctic-text-secondary: #a0b3c6;
  --arctic-text-muted: #5a6f84;
  --arctic-border: rgba(0, 212, 255, 0.15);
  --arctic-border-glow: rgba(0, 212, 255, 0.3);
  
  /* Glass Morphism */
  --glass-blur: blur(20px);
  --glass-saturate: saturate(180%);
  --glass-bg: rgba(20, 31, 46, 0.6);
  --glass-border: rgba(0, 212, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  /* Dimensions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  
  /* Animation Timing */
  --ease-arctic: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 700ms;
  
  /* Focus States */
  --focus-ring: 0 0 0 3px var(--arctic-accent-glow);
  --focus-glow: 0 0 20px var(--arctic-accent-glow);
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, var(--arctic-bg-tertiary) 0%, var(--arctic-bg-primary) 100%);
  color: var(--arctic-text-primary);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Animated Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 153, 204, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(125, 227, 255, 0.05) 0%, transparent 40%);
  animation: arcticShift 30s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes arcticShift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2%, 2%) rotate(1deg); }
  50% { transform: translate(-1%, 3%) rotate(-1deg); }
  75% { transform: translate(3%, -2%) rotate(2deg); }
}

/* Scrollbar Styling - Arctic Theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--arctic-bg-secondary);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--arctic-border);
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-arctic);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--arctic-accent-secondary);
}

/* Selection */
::selection {
  background: var(--arctic-accent-glow);
  color: var(--arctic-text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   APP CONTAINER
   ═══════════════════════════════════════════════════════════════ */

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER - Arctic Glass Design
   ═══════════════════════════════════════════════════════════════ */

header {
  padding: 20px 32px;
  background: linear-gradient(180deg, 
    rgba(20, 31, 46, 0.95) 0%, 
    rgba(20, 31, 46, 0.7) 60%, 
    transparent 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--arctic-border);
  position: relative;
  overflow: hidden;
  animation: headerSlideDown var(--duration-slow) var(--ease-arctic);
}

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

/* Subtle glow effect on header */
header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--arctic-accent-glow) 50%, 
    transparent 100%);
  animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, 
    var(--arctic-frost) 0%, 
    var(--arctic-accent-primary) 50%, 
    var(--arctic-ice-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
  animation: titlePulse 4s ease-in-out infinite;
  position: relative;
  display: inline-block;
}

@keyframes titlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
}

header h1::after {
  content: 'KuroStream';
  position: absolute;
  left: 0;
  top: 0;
  background: linear-gradient(135deg, 
    var(--arctic-frost) 0%, 
    var(--arctic-accent-primary) 50%, 
    var(--arctic-ice-blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: blur(20px);
  opacity: 0.5;
  z-index: -1;
}

header p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--arctic-text-secondary);
  font-weight: 400;
  opacity: 0;
  animation: fadeIn var(--duration-slow) var(--ease-arctic) var(--duration-normal) forwards;
}

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

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════ */

main {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 24px 32px 32px;
  min-height: 0;
  animation: contentFadeIn var(--duration-slower) var(--ease-arctic);
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER SHELL - Glass Card Design
   ═══════════════════════════════════════════════════════════════ */

.player-shell {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px solid var(--arctic-border);
  box-shadow: 
    var(--glass-shadow),
    0 0 0 1px var(--arctic-border),
    inset 0 0 60px rgba(0, 212, 255, 0.03);
  position: relative;
  overflow: hidden;
  transition: 
    box-shadow var(--duration-normal) var(--ease-arctic),
    border-color var(--duration-normal) var(--ease-arctic),
    transform var(--duration-normal) var(--ease-arctic);
  animation: cardEntrance var(--duration-slower) var(--ease-arctic);
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.player-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(0, 212, 255, 0.05), 
    transparent);
  animation: shimmer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.player-shell:hover {
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px var(--arctic-border-glow),
    inset 0 0 80px rgba(0, 212, 255, 0.05);
  border-color: var(--arctic-border-glow);
}

.player-shell canvas {
  max-width: 100%;
  max-height: 100%;
  background: #000;
  border-radius: var(--radius-md);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 212, 255, 0.1);
  transition: 
    transform var(--duration-normal) var(--ease-arctic),
    box-shadow var(--duration-normal) var(--ease-arctic);
}

.player-shell canvas:hover {
  transform: scale(1.02);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.7),
    0 0 0 2px var(--arctic-accent-primary);
}

/* Player loading state */
.player-shell.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, 
    rgba(0, 212, 255, 0.1) 0%, 
    transparent 70%);
  animation: playerLoading 1.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes playerLoading {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 0.6; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH SHELL - Modern Input Design
   ═══════════════════════════════════════════════════════════════ */

.search-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  animation: cardEntrance var(--duration-slower) var(--ease-arctic) 100ms backwards;
}

#search {
  width: 100%;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--arctic-border);
  border-radius: var(--radius-lg);
  color: var(--arctic-text-primary);
  font-size: 16px;
  font-weight: 500;
  transition: all var(--duration-normal) var(--ease-arctic);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.02);
}

#search::placeholder {
  color: var(--arctic-text-muted);
  transition: color var(--duration-fast) var(--ease-arctic);
}

#search:hover {
  border-color: var(--arctic-border-glow);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.02);
}

#search:focus {
  outline: none;
  border-color: var(--arctic-accent-primary);
  box-shadow: 
    var(--focus-ring),
    var(--focus-glow),
    0 8px 24px rgba(0, 212, 255, 0.2);
  background: rgba(20, 31, 46, 0.8);
  transform: translateY(-2px);
}

#search:focus::placeholder {
  color: var(--arctic-text-secondary);
  opacity: 0.7;
}

/* Search icon animation wrapper */
#search::before {
  content: '🔍';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  transition: opacity var(--duration-fast) var(--ease-arctic);
}

#search:focus::before {
  opacity: 1;
}

/* Results List - Arctic Cards */
#results {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

#results li {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  margin-bottom: 10px;
  color: var(--arctic-text-primary);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--arctic-border);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-arctic);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: resultSlideIn var(--duration-normal) var(--ease-arctic) forwards;
}

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

#results li:nth-child(1) { animation-delay: 50ms; }
#results li:nth-child(2) { animation-delay: 100ms; }
#results li:nth-child(3) { animation-delay: 150ms; }
#results li:nth-child(4) { animation-delay: 200ms; }
#results li:nth-child(5) { animation-delay: 250ms; }

#results li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, 
    var(--arctic-accent-primary) 0%, 
    var(--arctic-accent-secondary) 100%);
  transform: scaleY(0);
  transition: transform var(--duration-fast) var(--ease-bounce);
}

#results li:hover {
  background: rgba(20, 31, 46, 0.9);
  border-color: var(--arctic-accent-primary);
  box-shadow: 
    var(--focus-glow),
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateX(8px) scale(1.02);
}

#results li:hover::before {
  transform: scaleY(1);
}

#results li:active {
  transform: translateX(4px) scale(0.98);
}

/* Empty state */
#results:empty::after {
  content: 'Search for anime, movies, shows…';
  display: block;
  padding: 20px;
  color: var(--arctic-text-muted);
  font-size: 14px;
  text-align: center;
  font-style: italic;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════
   DETAILS PANEL - Expandable Diagnostics
   ═══════════════════════════════════════════════════════════════ */

details {
  grid-column: 1 / -1;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  padding: 0;
  border: 1px solid var(--arctic-border);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-arctic);
  animation: cardEntrance var(--duration-slower) var(--ease-arctic) 200ms backwards;
}

details[open] {
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px var(--arctic-border-glow);
}

summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--arctic-text-secondary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--duration-fast) var(--ease-arctic);
  position: relative;
}

summary::-webkit-details-marker {
  display: none;
}

summary:hover {
  background: rgba(0, 212, 255, 0.05);
  color: var(--arctic-accent-primary);
}

summary::after {
  content: '▼';
  font-size: 12px;
  transition: transform var(--duration-normal) var(--ease-arctic);
  opacity: 0.6;
}

details[open] summary::after {
  transform: rotate(180deg);
}

details[open] summary {
  border-bottom: 1px solid var(--arctic-border);
  color: var(--arctic-accent-primary);
}

details pre {
  margin: 0;
  padding: 20px;
  color: var(--arctic-text-secondary);
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(0, 0, 0, 0.2);
  overflow-x: auto;
  opacity: 0;
  animation: detailsExpand var(--duration-normal) var(--ease-arctic) forwards;
}

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

/* Syntax highlighting for JSON */
details pre span.string { color: var(--arctic-ice-blue); }
details pre span.number { color: var(--arctic-accent-primary); }
details pre span.boolean { color: var(--arctic-frost); }
details pre span.key { color: var(--arctic-text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   FOCUS STATES - TV Remote Navigation
   ═══════════════════════════════════════════════════════════════ */

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:focus-visible,
input:focus-visible,
li:focus-visible {
  outline: none;
  box-shadow: 
    var(--focus-ring),
    var(--focus-glow);
  transform: scale(1.05);
}

/* D-pad navigation highlight */
.dpad-highlight {
  position: relative;
}

.dpad-highlight::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--arctic-accent-primary);
  box-shadow: 
    0 0 20px var(--arctic-accent-glow),
    inset 0 0 20px rgba(0, 212, 255, 0.1);
  pointer-events: none;
  animation: dpadPulse 1.5s ease-in-out infinite;
}

@keyframes dpadPulse {
  0%, 100% { 
    box-shadow: 
      0 0 20px var(--arctic-accent-glow),
      inset 0 0 20px rgba(0, 212, 255, 0.1);
  }
  50% { 
    box-shadow: 
      0 0 30px var(--arctic-accent-glow),
      inset 0 0 30px rgba(0, 212, 255, 0.2);
  }
}

/* ═══════════════════════════════════════════════════════════════
   LOADING SPINNER - Arctic Crystal
   ═══════════════════════════════════════════════════════════════ */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--arctic-border);
  border-top-color: var(--arctic-accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

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

/* ═══════════════════════════════════════════════════════════════
   STATUS INDICATOR - Pulse Animation
   ═══════════════════════════════════════════════════════════════ */

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--arctic-text-secondary);
}

.status-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--arctic-accent-primary);
  border-radius: 50%;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { 
    opacity: 0.4;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(0, 212, 255, 0);
  }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  main {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .player-shell {
    min-height: 280px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 16px 20px;
  }
  
  header h1 {
    font-size: 26px;
  }
  
  main {
    padding: 16px 20px 20px;
    gap: 16px;
  }
  
  .player-shell {
    padding: 16px;
    min-height: 240px;
  }
  
  #search {
    padding: 14px 16px;
    font-size: 15px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER OVERLAY - Loading State
   ═══════════════════════════════════════════════════════════════ */

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--arctic-text-primary);
  font-size: 15px;
  font-weight: 500;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-arctic);
}

.player-shell.loading .player-overlay {
  opacity: 1;
}

.player-overlay[hidden] {
  display: none;
}

.player-overlay .spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   APP FOOTER - Performance Metrics
   ═══════════════════════════════════════════════════════════════ */

.app-footer {
  padding: 12px 32px;
  background: linear-gradient(0deg, 
    rgba(20, 31, 46, 0.95) 0%, 
    rgba(20, 31, 46, 0.7) 100%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--arctic-border);
  font-size: 12px;
  color: var(--arctic-text-muted);
}

.app-footer[hidden] {
  display: none;
}

.metrics {
  display: flex;
  gap: 24px;
  justify-content: flex-end;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-label {
  font-weight: 500;
  color: var(--arctic-text-secondary);
}

.metric-value {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
  color: var(--arctic-accent-primary);
  font-weight: 600;
}

/* Selected state for results */
#results li.selected {
  background: rgba(0, 212, 255, 0.15);
  border-color: var(--arctic-accent-primary);
  box-shadow: 
    var(--focus-glow),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Visible class for intersection observer */
#results li.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Memory pressure indicator */
#app[style*="--memory-pressure: 1"] {
  animation: memoryPressurePulse 2s ease-in-out infinite;
}

@keyframes memoryPressurePulse {
  0%, 100% { 
    box-shadow: inset 0 0 0 0 transparent;
  }
  50% { 
    box-shadow: inset 0 0 60px rgba(255, 183, 0, 0.1);
  }
}

/* Status type variants */
.status-loading { color: var(--arctic-text-secondary); }
.status-ready { color: var(--arctic-accent-primary); }
.status-success { color: #00e676; }
.status-warning { color: #ffb700; }
.status-error { color: #ff4444; }

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION - Accessibility
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body::before {
    animation: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   HIGH CONTRAST MODE
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-contrast: high) {
  :root {
    --arctic-border: rgba(0, 212, 255, 0.4);
    --arctic-text-secondary: #c0d4e8;
    --arctic-text-muted: #8095aa;
  }
  
  .player-shell,
  #search,
  #results li,
  details {
    border-width: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER UI OVERLAY — Glass Morphism Controls
   ═══════════════════════════════════════════════════════════════ */

.player-overlay-ui {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.player-overlay-ui .glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.player-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: auto;
  transition: opacity var(--duration-normal) var(--ease-arctic);
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: var(--arctic-text-primary);
  font-size: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-arctic),
              transform var(--duration-fast) var(--ease-bounce);
  white-space: nowrap;
}

.ctrl-btn:hover,
.ctrl-btn:focus-visible {
  background: rgba(0, 212, 255, 0.15);
  transform: scale(1.05);
}

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

.timeline-container {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
  transition: height var(--duration-fast) var(--ease-arctic);
}

.timeline-container:hover {
  height: 10px;
}

.timeline-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 3px;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--arctic-accent-primary);
  border-radius: 3px;
  box-shadow: 0 0 8px var(--arctic-accent-glow);
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  background: var(--arctic-accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--arctic-accent-glow);
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.timeline-container:hover .timeline-thumb {
  opacity: 1;
}

.time-current,
.time-duration {
  font-size: 13px;
  font-family: 'Inter', monospace;
  color: var(--arctic-text-secondary);
  min-width: 50px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 80px;
  accent-color: var(--arctic-accent-primary);
}

/* Skip Chips */
.player-skip-chips {
  position: absolute;
  bottom: 80px;
  right: 20px;
  display: flex;
  gap: 10px;
  pointer-events: auto;
  border-radius: var(--radius-md);
  padding: 8px 16px;
}

.skip-chip {
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid var(--arctic-accent-primary);
  color: var(--arctic-text-primary);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-arctic);
}

.skip-chip:hover {
  background: var(--arctic-accent-primary);
  color: var(--arctic-bg-primary);
}

/* Stats Overlay */
.player-stats-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  pointer-events: none;
  font-size: 12px;
  font-family: 'Inter', monospace;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.stat-label {
  color: var(--arctic-text-muted);
}

.stat-value {
  color: var(--arctic-accent-primary);
  font-weight: 600;
}

/* Settings Panel */
.player-settings-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 280px;
  border-radius: var(--radius-md);
  padding: 16px;
  pointer-events: auto;
}

.settings-section {
  margin-bottom: 14px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--arctic-text-muted);
  margin: 0 0 8px;
}

.quality-options,
.audio-options,
.subtitle-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quality-options button,
.audio-options button,
.subtitle-options button {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid var(--arctic-border);
  color: var(--arctic-text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-arctic);
}

.quality-options button:hover,
.quality-options button.active,
.audio-options button:hover,
.audio-options button.active,
.subtitle-options button:hover,
.subtitle-options button.active {
  background: var(--arctic-accent-primary);
  color: var(--arctic-bg-primary);
  border-color: var(--arctic-accent-primary);
}

/* Search Result Items */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-arctic);
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(0, 212, 255, 0.12);
}

.result-poster {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--arctic-text-primary);
}

.result-meta {
  font-size: 12px;
  color: var(--arctic-text-muted);
}

.search-loading,
.search-empty,
.search-error {
  padding: 12px;
  text-align: center;
  color: var(--arctic-text-muted);
  font-size: 13px;
}

/* Gesture Overlay Indicator */
.gesture-indicator {
  user-select: none;
  -webkit-user-select: none;
}
