/* ========================================================
   OXPLAYER - PREMIUM 10-FOOT CINEMATIC TV DESIGN SYSTEM
   LG webOS 1080p Smart TV Architecture
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #060912;
  --bg-surface: #0b1120;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-focused: rgba(30, 41, 59, 0.95);
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  --accent-glow: rgba(0, 242, 254, 0.45);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focused: #00f2fe;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 18px; /* 10-foot UI base */
  cursor: default;
}

/* Base App Container */
#app {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(0, 242, 254, 0.06), transparent 45%),
              radial-gradient(circle at bottom left, rgba(79, 172, 254, 0.05), transparent 45%),
              var(--bg-main);
}

/* Views */
.view {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  flex-direction: column;
}

.view.active {
  display: flex;
}

/* Nav Item Focus System (Remote D-Pad & Magic Remote) */
.nav-item {
  outline: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.2s ease, 
              border-color 0.2s ease, 
              background-color 0.2s ease;
  cursor: pointer;
}

.nav-item.focused {
  transform: scale(1.04);
  border-color: var(--border-focused) !important;
  box-shadow: 0 0 25px var(--accent-glow) !important;
  z-index: 10;
}

/* TOP HEADER */
.top-header {
  height: 80px;
  padding: 0 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(6, 9, 18, 0.85);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: #060912;
  box-shadow: 0 0 15px var(--accent-glow);
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-status-area {
  display: flex;
  align-items: center;
  gap: 25px;
}

.clock-display {
  font-size: 1.35rem;
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-badge strong {
  color: #fff;
}

/* LOGIN VIEW */
#view-login {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0f172a 0%, #060912 80%);
}

.login-card {
  width: 600px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  background: rgba(6, 9, 18, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: #fff;
  font-size: 1.1rem;
  font-family: inherit;
}

.form-input.focused {
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.95);
}

.btn-primary {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  color: #060912;
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

/* MAIN DASHBOARD TILES */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 60px 80px;
  flex: 1;
  align-items: center;
}

.hub-card {
  height: 380px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 35px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.hub-card-bg-icon {
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 12rem;
  opacity: 0.08;
  transition: transform 0.4s ease;
}

.hub-card.focused .hub-card-bg-icon {
  transform: scale(1.15) rotate(-5deg);
  opacity: 0.15;
}

.hub-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
}

.hub-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.hub-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* LIVE TV VIEW */
.livetv-layout {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.categories-sidebar {
  width: 320px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  padding: 20px 25px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.categories-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.category-item {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-item.active {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.3);
}

.channels-column {
  width: 500px;
  background: rgba(11, 17, 32, 0.5);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.channels-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.channel-logo {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #1e293b;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.channel-info {
  flex: 1;
  overflow: hidden;
}

.channel-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-epg-preview {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-column {
  flex: 1;
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mini-player-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.mini-player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.epg-detail-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 25px;
}

/* VOD POSTER GRID */
.vod-layout {
  display: flex;
  height: calc(100vh - 80px);
  overflow: hidden;
}

.posters-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 25px;
  padding: 30px;
  overflow-y: auto;
}

.movie-poster-card {
  aspect-ratio: 2/3;
  background: #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

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

.movie-poster-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 15px 12px 15px;
  background: linear-gradient(to top, rgba(6, 9, 18, 0.95), transparent);
}

.movie-poster-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-poster-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-top: 4px;
}

/* FULLSCREEN PLAYER & OSD */
#view-player {
  background: #000;
  z-index: 100;
}

.fullscreen-video-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.fullscreen-video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* OSD Overlay */
.player-osd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.92) 100%);
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

.player-osd * {
  pointer-events: auto;
}

.player-osd.hidden {
  opacity: 0;
  visibility: hidden;
}

.osd-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.osd-channel-meta h2 {
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
}

.osd-channel-meta p {
  font-size: 1.2rem;
  color: var(--accent-cyan);
  margin-top: 4px;
}

.osd-bottom-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.osd-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.osd-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
}

.osd-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.osd-buttons-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.osd-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.buffering-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-weight: 700;
  color: #fff;
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
}

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

/* Toast */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: 30px;
  padding: 12px 28px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.3);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========================================================
   M3U PLAYER & ONBOARDING STYLES (LG STORE REVIEW COMPLIANT)
   ======================================================== */
.m3u-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 30px 60px;
  background: radial-gradient(circle at center, #0f172a 0%, #060912 85%);
  overflow-y: auto;
}

.m3u-hero-title {
  text-align: center;
  margin-bottom: 25px;
}

.m3u-hero-title h1 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.m3u-hero-title p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 800px;
  margin: 0 auto;
}

.m3u-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 25px;
}

.m3u-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.m3u-card.focused {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 30px var(--accent-glow) !important;
  transform: translateY(-4px) scale(1.02);
}

.m3u-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.m3u-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.m3u-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.m3u-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

.legal-disclaimer-banner {
  max-width: 1100px;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.4;
  margin-bottom: 15px;
}

.legal-icon {
  font-size: 1.4rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.m3u-bottom-bar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
}

.btn-ghost {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost.focused {
  border-color: var(--accent-cyan);
  color: #fff;
}

