/**
 * FlixHouse Vizio SmartCast Application Styles
 * 
 * Optimized for TV displays (1920x1080)
 * Focus states are critical for remote navigation
 * Design: Netflix-style dark theme with teal accents
 */

/* CSS Variables for easy theming */
:root {
  --color-primary: #e50914;
  --color-accent: #e50914;
  --color-focus: #fff;
  --color-background: #141414;
  --color-surface: #181818;
  --color-surface-light: #232323;
  --color-text: #fff;
  --color-text-muted: #b3b3b3;
  --color-text-dim: #808080;
  --sidebar-width-collapsed: 60px;
  --sidebar-width-expanded: 240px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #000;
  color: #fff;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Visually Hidden (for accessibility) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* App Container */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 60px;
  overflow: hidden;
  position: relative;
  transition: margin-left 0.3s ease;
}

/* =============================================
   SIDEBAR NAVIGATION
   ============================================= */
/* =============================================
   APP HEADER WITH LOGO
   ============================================= */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 30px 0 80px;
  z-index: 900;
}

.app-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.sidebar {
  width: 60px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  padding-top: 90px;
  transition: width 0.3s ease;
  z-index: 1000;
  position: fixed;
  left: 0;
  top: 0;
}

.sidebar.expanded {
  width: 240px;
  background: rgba(0, 0, 0, 0.95);
}

.sidebar-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: #808080;
  position: relative;
}

.menu-item .menu-icon {
  font-size: 22px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.menu-item .menu-title {
  margin-left: 20px;
  font-size: 16px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar.expanded .menu-item .menu-title {
  opacity: 1;
}

/* Active state - Current page indicator (subtle, persistent) */
.menu-item.active {
  color: #fff;
  border-left-color: #e50914;
  background: transparent;
}

.menu-item.active .menu-icon {
  color: #e50914;
}

/* Active indicator dot when sidebar is collapsed */
.menu-item.active::after {
  content: '';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: #e50914;
  border-radius: 50%;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.sidebar.expanded .menu-item.active::after {
  opacity: 0;
}

/* Focus/Hover state - Navigation highlight (prominent, temporary) */
.menu-item.focused,
.menu-item:focus {
  outline: none;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.2) 0%, rgba(229, 9, 20, 0.05) 100%);
  color: #fff;
  border-left-color: #fff;
  border-left-width: 3px;
}

.menu-item.focused .menu-icon,
.menu-item:focus .menu-icon {
  color: #fff;
  transform: scale(1.1);
}

/* Combined: Active + Focused (when navigating back to current page) */
.menu-item.active.focused,
.menu-item.active:focus {
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.3) 0%, rgba(229, 9, 20, 0.1) 100%);
  border-left-color: #fff;
}

.menu-item.active.focused .menu-icon,
.menu-item.active:focus .menu-icon {
  color: #fff;
  transform: scale(1.1);
}

/* =============================================
   FOCUSABLE ELEMENTS - NETFLIX STYLE
   ============================================= */
.focusable {
  outline: none;
  border: 3px solid transparent;
  transition: all var(--transition-normal);
  transform-origin: center;
}

.focusable.focused,
.focusable:focus {
  outline: none;
  border-color: #fff;
  z-index: 100;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* =============================================
   LOADER - NETFLIX STYLE
   ============================================= */
.loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.loader-container.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
}

.loader {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* Netflix circular spinner */
.netflix-spinner {
  position: relative;
  width: 75px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-svg {
  width: 100%;
  height: 100%;
  animation: netflix-rotate 1.4s linear infinite;
}

.spinner-path {
  stroke: #e50914;
  stroke-dasharray: 187;
  stroke-dashoffset: 0;
  transform-origin: center;
  animation: netflix-dash 1.4s ease-in-out infinite;
}

@keyframes netflix-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes netflix-dash {
  0% {
    stroke-dashoffset: 187;
  }
  50% {
    stroke-dashoffset: 46.75;
    transform: rotate(135deg);
  }
  100% {
    stroke-dashoffset: 187;
    transform: rotate(450deg);
  }
}

.spinner-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.loader-message {
  font-size: 15px;
  color: #b3b3b3;
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Icon component styles */
.icon {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

.icon svg {
  display: block;
}

.loader-message {
  font-size: 16px;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* =============================================
   LOGIN PAGE - NETFLIX STYLE
   ============================================= */
.login-page {
  width: 100vw;
  height: 100vh;
  background: #141414;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px;
}

.login-logo {
  margin-bottom: 35px;
}

.login-logo img {
  height: 70px;
  width: auto;
}

.login-content {
  display: flex;
  gap: 80px;
  max-width: 1300px;
  width: 100%;
}

.login-form-section,
.login-code-section {
  flex: 1;
  padding: 35px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
}

.login-title {
  font-size: 24px;
  margin-bottom: 25px;
  color: #fff;
}

.login-input {
  background-color: #333;
  padding: 18px 20px;
  margin-bottom: 12px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.login-input .input-label {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 5px;
}

.login-input .input-value {
  font-size: 17px;
  color: #fff;
}

.login-input.focused,
.login-input:focus {
  border-color: var(--color-focus);
  background-color: #454545;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.login-button {
  padding: 16px 35px;
  font-size: 17px;
  border-radius: 4px;
  margin-top: 18px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  font-weight: 600;
}

.login-button.primary {
  background-color: var(--color-primary);
  color: #fff;
}

.login-button.focused,
.login-button:focus {
  border-color: var(--color-focus);
  transform: scale(1.02);
  outline: none;
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.5);
}

.login-error {
  margin-top: 18px;
  padding: 14px;
  background-color: rgba(229, 9, 20, 0.15);
  border-radius: 4px;
  color: #e87c03;
  border-left: 3px solid var(--color-primary);
}

.login-instructions {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.login-url {
  font-size: 22px;
  color: var(--color-primary);
  margin-bottom: 25px;
  font-weight: 600;
}

.activation-code {
  background-color: #333;
  padding: 28px;
  border-radius: 4px;
  text-align: center;
  margin-bottom: 25px;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.activation-code.focused {
  border-color: var(--color-focus);
}

.code-text {
  font-size: 44px;
  font-weight: bold;
  letter-spacing: 12px;
  color: #fff;
}

/* =============================================
   USER PROFILE - LOGGED IN STATE
   ============================================= */
.profile-page {
  justify-content: center;
}

.profile-content {
  max-width: 500px;
  width: 100%;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  padding: 40px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.profile-channel {
  font-size: 16px;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.profile-email {
  font-size: 15px;
  color: var(--color-text-muted);
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-actions .login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  width: 100%;
}

.logout-btn {
  background-color: transparent;
  border: 2px solid #555;
}

.logout-btn.focused,
.logout-btn:focus {
  border-color: #e50914;
  background-color: rgba(229, 9, 20, 0.15);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
}

/* =============================================
   LOGIN LANDING PAGE - TV 10-FOOT UI
   ============================================= */
.login-landing {
  justify-content: center;
  padding: 60px;
}

.login-welcome {
  text-align: center;
  margin-bottom: 50px;
}

.login-welcome-title {
  font-size: 42px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.login-welcome-subtitle {
  font-size: 20px;
  color: var(--color-text-muted);
}

.login-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 700px;
  width: 100%;
}

.login-option {
  display: flex;
  align-items: center;
  padding: 25px 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.login-option.focused,
.login-option:focus {
  border-color: var(--color-focus);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.3);
}

.login-option.primary-option {
  background: rgba(229, 9, 20, 0.1);
  border: 2px solid rgba(229, 9, 20, 0.3);
}

.login-option.primary-option.focused,
.login-option.primary-option:focus {
  background: rgba(229, 9, 20, 0.2);
  border-color: var(--color-primary);
}

.login-option-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  margin-right: 25px;
  flex-shrink: 0;
}

.login-option.primary-option .login-option-icon {
  background: rgba(229, 9, 20, 0.2);
  border-color: rgba(229, 9, 20, 0.4);
}

.login-option.focused .login-option-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.login-option.primary-option.focused .login-option-icon {
  background: rgba(229, 9, 20, 0.3);
  border-color: var(--color-primary);
}

.login-option-content {
  flex: 1;
}

.login-option-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.login-option-desc {
  font-size: 15px;
  color: var(--color-text-muted);
}

.login-option-arrow {
  color: var(--color-text-muted);
  margin-left: 20px;
}

.login-option.focused .login-option-arrow {
  color: #fff;
}

.login-url-inline {
  color: var(--color-primary);
  font-weight: 600;
}

.login-create-hint {
  margin-top: 40px;
  text-align: center;
  font-size: 15px;
  color: var(--color-text-muted);
}

.login-content.single-panel {
  justify-content: center;
  max-width: 500px;
}

.login-form-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =============================================
   CODE ENTRY PAGE - DEVICE AUTHORIZATION
   ============================================= */
.code-entry-page {
  justify-content: flex-start;
  padding: 40px 60px;
}

.code-entry-header {
  text-align: center;
  margin-bottom: 30px;
}

.code-entry-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.code-entry-subtitle {
  font-size: 18px;
  color: var(--color-text-muted);
}

.code-display-container {
  margin-bottom: 20px;
}

.code-display {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 25px 40px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.code-char {
  font-size: 48px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: #fff;
  width: 45px;
  text-align: center;
}

.code-char.placeholder {
  color: #444;
}

.code-char.hyphen {
  color: #666;
  width: 25px;
}

.code-entry-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: rgba(229, 9, 20, 0.15);
  border-radius: 6px;
  color: #e87c03;
  font-size: 15px;
  margin-bottom: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Code Entry Keyboard */
.code-keyboard {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}

.code-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.code-keyboard-key {
  min-width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-keyboard-key.focused,
.code-keyboard-key:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--color-focus);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.code-keyboard-key.action-key {
  min-width: 100px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.code-keyboard-key.action-key.focused {
  background: rgba(255, 255, 255, 0.15);
}

.code-keyboard-key.submit-key {
  min-width: 150px;
  background: rgba(229, 9, 20, 0.3);
  color: #fff;
}

.code-keyboard-key.submit-key.ready {
  background: var(--color-primary);
}

.code-keyboard-key.submit-key.focused,
.code-keyboard-key.submit-key:focus {
  background: var(--color-primary);
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.5);
}

.code-keyboard-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.code-entry-footer {
  margin-top: 30px;
  text-align: center;
}

/* =============================================
   VIRTUAL KEYBOARD - NETFLIX STYLE
   ============================================= */
.virtual-keyboard {
  padding: 40px;
  background-color: #181818;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
}

.keyboard-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.keyboard-close-btn {
  padding: 15px 30px;
  background-color: var(--color-primary);
  border-radius: 4px;
  font-size: 18px;
  transition: all var(--transition-fast);
}

.keyboard-close-btn.focused {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.5);
}

.keyboard-letters,
.keyboard-numbers,
.keyboard-special,
.keyboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  justify-content: center;
}

.keyboard-key {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  border-radius: 4px;
  font-size: 20px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.keyboard-key.keyboard-space {
  width: 200px;
}

.keyboard-key.keyboard-shift {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
}

.keyboard-key.keyboard-shift.active {
  background-color: var(--color-primary);
  color: #fff;
}

.keyboard-key.focused,
.keyboard-key:focus {
  background-color: var(--color-primary);
  border-color: var(--color-focus);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.5);
}

.keyboard-input-preview {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background-color: #1a1a1a;
  border-radius: 8px;
}

.keyboard-input-preview label {
  display: block;
  font-size: 14px;
  color: #888;
  margin-bottom: 10px;
}

.keyboard-input-preview .input-value {
  font-size: 28px;
  color: #fff;
  min-height: 40px;
}

/* =============================================
   HOME PAGE
   ============================================= */
.home-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.home-page.loading,
.home-page.error {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category Filter Header */
.home-page.category-filtered {
  padding-top: 0;
}

.category-filter-header {
  position: fixed;
  top: 0;
  left: 60px;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 70%, transparent 100%);
  display: flex;
  align-items: center;
  padding: 0 40px;
  z-index: 100;
}

.category-filter-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.home-page.category-filtered .home-content {
  padding-top: 20px;
}

/* Video Grid - For category pages (fluid columns) */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  padding: 20px 40px;
  margin-top: 50vh;
}

.video-grid .content-card {
  width: 100%;
}

.video-grid .content-card .card-image {
  aspect-ratio: 2/3;
}

/* Banner - Fixed at top, always visible */
.banner {
  position: fixed;
  top: 0;
  left: 60px;
  right: 0;
  height: 50vh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
  background-color: #000;
}

.banner-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center right;
}

.banner-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Gradiente da esquerda para o texto */
    linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.9) 20%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.2) 60%, transparent 80%),
    /* Gradiente de baixo mais forte para separar do conteudo */
    linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 5%, rgba(0, 0, 0, 0.9) 15%, rgba(0, 0, 0, 0.6) 35%, rgba(0, 0, 0, 0.2) 60%, transparent 80%),
    /* Gradiente de cima suave */
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, transparent 15%);
}

.banner-content {
  position: relative;
  z-index: 1;
  padding: 80px 40px 30px;
  max-width: 550px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: auto;
}

.banner-title {
  font-size: 36px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.banner-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--color-text-muted);
}

.banner-meta .meta-separator {
  color: #555;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border: 1px solid var(--color-text-muted);
  border-radius: 3px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
}

.banner-description {
  font-size: 15px;
  line-height: 1.6;
  color: #ccc;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 480px;
}

/* Tab Bar (used in HomePage) */
.tab-bar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  padding: 6px;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 30px;
}

.tab {
  padding: 12px 28px;
  font-size: 15px;
  color: #b3b3b3;
  border-radius: 25px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  background: transparent;
  font-weight: 600;
}

.tab.active {
  color: #000;
  background: #fff;
}

.tab.focused,
.tab:focus {
  background: rgba(255, 255, 255, 0.9);
  color: #000;
  border-color: #fff;
  outline: none;
}

.tab.active.focused,
.tab.active:focus {
  background: #fff;
  color: #000;
  border-color: #e50914;
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.7);
}

/* Home Content */
.home-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 40px 20px 40px;
  position: relative;
  z-index: 2;
  scroll-padding-top: 50vh;
}

/* Content Rows - scrollable area below fixed banner */
.content-rows {
  margin-top: 50vh;
  position: relative;
  padding-bottom: 40px;
}

/* Category Row */
.category-row {
  margin-bottom: 25px;
}

.category-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #fff;
}

.category-items {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 20px;
  scroll-behavior: smooth;
}

.category-items::-webkit-scrollbar {
  display: none;
}

/* Content Card - Netflix Style */
.content-card {
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  border: 3px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.content-card.portrait {
  width: 160px;
}

.content-card.landscape {
  width: 280px;
}

.card-image {
  position: relative;
  overflow: hidden;
  background-color: #181818;
}

.content-card.portrait .card-image {
  height: 240px;
}

.content-card.landscape .card-image {
  height: 160px;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

/* Hide titles by default (Netflix style - show on hover/focus) */
.card-title {
  display: none;
}

.content-card.view-more {
  background: linear-gradient(135deg, #232323 0%, #181818 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-card.view-more .card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.view-more-text {
  font-size: 16px;
  color: #fff;
}

/* View More Loading State */
.content-card.loading {
  pointer-events: none;
}

.view-more-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.view-more-loading .loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Netflix-style focus effect */
.content-card.focused,
.content-card:focus {
  transform: scale(1.08);
  z-index: 10;
  border-color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(255, 255, 255, 0.8);
  outline: none;
}

.content-card.focused .card-image img,
.content-card:focus .card-image img {
  transform: scale(1.02);
}

/* =============================================
   DETAIL PAGE
   ============================================= */
.detail-page {
  width: 100%;
  height: 100vh;
  position: relative;
}

.detail-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center right;
}

.detail-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
}

.detail-content {
  position: relative;
  z-index: 1;
  padding: 80px;
  max-width: 650px;
}

.detail-title {
  font-size: 42px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #fff;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  color: var(--color-text-muted);
}

.detail-badge {
  display: inline-flex;
  padding: 4px 12px;
  border: 1px solid var(--color-text-muted);
  border-radius: 3px;
  font-size: 13px;
  font-weight: bold;
}

.detail-description {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 40px;
}

.detail-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-button {
  padding: 16px 35px;
  font-size: 18px;
  border-radius: 4px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  text-align: center;
  width: fit-content;
  min-width: 220px;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  font-weight: 600;
}

.detail-button.primary {
  background-color: #fff;
  color: #000;
  font-weight: 600;
}

.detail-button.active {
  background-color: #46d369;
}

.detail-button.focused,
.detail-button:focus {
  transform: scale(1.02);
  border-color: var(--color-focus);
  outline: none;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* =============================================
   SEARCH PAGE - NETFLIX STYLE
   ============================================= */
.search-page {
  display: flex;
  height: 100vh;
  background: #141414;
}

.search-sidebar {
  width: 380px;
  background-color: #181818;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
}

.search-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
}

.search-input-display {
  background-color: #333;
  padding: 18px 20px;
  border-radius: 4px;
  font-size: 18px;
  margin-bottom: 25px;
  min-height: 55px;
  color: #fff;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.search-input-display.focused {
  border-color: var(--color-focus);
}

/* Search page inline keyboard styling */
.search-keyboard-inline {
  background: transparent;
  padding: 0;
}

.search-keyboard-inline .keyboard-header {
  display: none;
}

.search-keyboard-inline .keyboard-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.search-keyboard-inline .keyboard-numbers {
  display: none;
}

.search-keyboard-inline .keyboard-special {
  display: none;
}

.search-keyboard-inline .keyboard-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-keyboard-inline .keyboard-key {
  width: 48px;
  height: 48px;
  font-size: 16px;
}

.search-keyboard-inline .keyboard-key.keyboard-space {
  width: 100px;
}

.search-keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.search-key {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.search-key.wide {
  width: 100px;
}

.search-key.focused,
.search-key:focus {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-focus);
  outline: none;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.search-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-results {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  background: #141414;
}

.results-heading {
  font-size: 22px;
  margin-bottom: 25px;
  color: #fff;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.search-card {
  background-color: transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.search-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.search-card-title {
  display: none;
}

.search-card.focused,
.search-card:focus {
  transform: scale(1.05);
  border-color: var(--color-accent);
  outline: none;
}

/* =============================================
   CATEGORY PAGE
   ============================================= */
.category-page {
  padding: 40px;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #0a1628 0%, #000 100%);
}

.category-page.loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-page .category-title {
  font-size: 28px;
  margin-bottom: 30px;
  color: var(--color-accent);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 10px 0;
}

.category-item {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.02) 100%);
}

.category-item-gradient {
  width: 100%;
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 15px 20px;
  position: relative;
  background: linear-gradient(135deg, 
    rgba(229, 9, 20, 0.3) 0%, 
    rgba(0, 0, 0, 0.6) 100%);
}

.category-item-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  transition: background 0.2s ease;
}

.category-item .category-item-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: left;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
  line-height: 1.3;
  word-wrap: break-word;
  max-width: 100%;
}

.category-item.focused,
.category-item:focus {
  transform: scale(1.05);
  z-index: 10;
  border-color: #fff;
  outline: none;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.category-item.focused .category-item-gradient::before,
.category-item:focus .category-item-gradient::before {
  background: rgba(0, 0, 0, 0.1);
}

/* Loading More Animation */
.loading-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  margin-top: -50px;
  gap: 16px;
}

.loading-more-spinner {
  width: 40px;
  height: 40px;
  position: relative;
}

.loading-more-spinner::before,
.loading-more-spinner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.loading-more-spinner::before {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(229, 9, 20, 0.2);
}

.loading-more-spinner::after {
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: var(--color-accent);
  animation: loading-spin 1s linear infinite;
}

.loading-more-text {
  color: var(--color-text-muted);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading-more-dots {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.loading-more-dots span {
  width: 6px;
  height: 6px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: loading-bounce 1.4s ease-in-out infinite;
}

.loading-more-dots span:nth-child(1) {
  animation-delay: 0s;
}

.loading-more-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-more-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loading-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes loading-bounce {
  0%, 80%, 100% { 
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% { 
    transform: scale(1);
    opacity: 1;
  }
}

/* =============================================
   SETTINGS PAGE
   ============================================= */
.settings-page {
  display: flex;
  height: 100vh;
  background: linear-gradient(135deg, #0a1628 0%, #000 100%);
}

.settings-sidebar {
  width: 320px;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 40px 30px;
}

.settings-sidebar h2 {
  font-size: 24px;
  margin-bottom: 30px;
  color: var(--color-accent);
}

.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-menu-item {
  padding: 18px 20px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.settings-menu-item.active {
  background-color: rgba(78, 205, 196, 0.15);
  border-left: 3px solid var(--color-accent);
}

.settings-menu-item.focused,
.settings-menu-item:focus {
  background-color: var(--color-accent);
  color: #000;
  outline: none;
}

.settings-content {
  flex: 1;
  padding: 50px;
}

.settings-content h2 {
  font-size: 28px;
  margin-bottom: 15px;
  color: #fff;
}

.settings-content p {
  font-size: 16px;
  color: #aaa;
  margin-bottom: 30px;
  line-height: 1.6;
}

.settings-option {
  padding: 18px 25px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.settings-option.active {
  background-color: rgba(40, 167, 69, 0.3);
  border-color: #28a745;
}

.settings-option.danger {
  background-color: rgba(220, 53, 69, 0.3);
}

.settings-option.focused,
.settings-option:focus {
  border-color: var(--color-accent);
  transform: scale(1.01);
  outline: none;
}

/* =============================================
   VIDEO PLAYER
   ============================================= */
.video-player-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  z-index: 2000;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-controls {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.9) 100%);
  padding: 40px;
}

.controls-top {
  display: flex;
  justify-content: center;
}

.video-title {
  font-size: 24px;
  color: var(--color-accent);
}

.controls-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.control-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  border: 2px solid transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.control-btn.play-btn {
  width: 90px;
  height: 90px;
  font-size: 36px;
  background-color: var(--color-accent);
  color: #000;
}

.control-btn.focused,
.control-btn:focus {
  border-color: #fff;
  transform: scale(1.1);
  outline: none;
}

.controls-bottom {
  display: flex;
  align-items: center;
  gap: 20px;
}

.time-current,
.time-duration {
  font-size: 16px;
  min-width: 60px;
  color: #ccc;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--color-accent);
  transition: width 0.1s linear;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-container {
  background: linear-gradient(135deg, #1a2a3a 0%, #0a1628 100%);
  padding: 45px;
  border-radius: 10px;
  text-align: center;
  max-width: 480px;
  border: 1px solid rgba(78, 205, 196, 0.2);
}

.modal-title {
  font-size: 28px;
  margin-bottom: 18px;
  color: var(--color-accent);
}

.modal-message {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 35px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.modal-button {
  padding: 16px 45px;
  font-size: 18px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.modal-button.danger {
  background-color: rgba(220, 53, 69, 0.4);
}

.modal-button.focused,
.modal-button:focus {
  border-color: var(--color-accent);
  transform: scale(1.03);
  outline: none;
}

/* =============================================
   ERROR STATE
   ============================================= */
.error-message {
  text-align: center;
  padding: 60px;
}

.error-message h2 {
  font-size: 32px;
  margin-bottom: 18px;
  color: var(--color-accent);
}

.error-message p {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 35px;
}

.retry-button {
  padding: 16px 45px;
  font-size: 18px;
  background-color: var(--color-accent);
  color: #000;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.retry-button.focused,
.retry-button:focus {
  transform: scale(1.03);
  border-color: #fff;
  outline: none;
}

/* =============================================
   SCROLLBAR (Hidden for TV)
   ============================================= */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* =============================================
   RESPONSIVE (Smaller TVs)
   ============================================= */
@media (max-width: 1280px) {
  html {
    font-size: 14px;
  }
  
  .sidebar {
    width: 55px;
  }
  
  .sidebar.expanded {
    width: 220px;
  }
  
  .main-content {
    margin-left: 55px;
  }
  
  .banner-content {
    padding: 60px 30px 30px;
  }
  
  .banner-title {
    font-size: 28px;
  }
  
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .content-card.portrait {
    width: 140px;
  }
  
  .content-card.portrait .card-image {
    height: 210px;
  }
}

/* =============================================
   FAVORITES PAGE
   ============================================= */
.favorites-page {
  padding: 40px;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #0a1628 0%, #000 100%);
}

.favorites-header {
  margin-bottom: 30px;
}

.favorites-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding: 10px 0;
}

.favorites-empty,
.favorites-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  text-align: center;
  color: #888;
}

.favorites-empty h2,
.favorites-error h2 {
  font-size: 24px;
  color: #fff;
  margin-bottom: 10px;
}

.favorites-empty p,
.favorites-error p {
  font-size: 16px;
  color: #888;
}


