/* ================================================================
   CUSTOM STYLES - Velra Premium IPTV UI
   Các style bổ sung cho tất cả các trang
   Phong cách: Modern Luxury Hotel TV Interface
   ================================================================ */

/* =============== CSS VARIABLES (Velra Theme) =============== */
:root {
  /* Velra Brand Colors */
  --velra-gold: #D4A84B;
  --velra-gold-light: #E8C56D;
  --velra-green: #4A7C3F;
  --velra-green-dark: #1E3D1A;
  --velra-green-light: #6B9E23;
  --velra-gradient: linear-gradient(135deg, #D4A84B 0%, #8FB83A 50%, #4A7C3F 100%);
  
  --color-primary: var(--velra-gold);
  --color-primary-light: var(--velra-gold-light);
  --color-accent: var(--velra-green);
  --bg-primary: #0D1810;
  --bg-secondary: #121A14;
  --bg-tertiary: #1A241C;
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --shadow-glow: 0 0 40px rgba(212, 168, 75, 0.3);
}

/* =============== HOME PAGE OVERRIDES =============== */
.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============== WELCOME PAGE - Main Wrap =============== */
.main-wrap {
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  max-width: 600px;
  text-align: left;
}

.main-wrap .welcome-text {
  font-size: 72px;
  font-weight: 300;
  margin-bottom: 16px;
  letter-spacing: -1px;
  line-height: 1.1;
  transition: opacity 0.3s ease;
}

.main-wrap .room-info {
  font-size: 24px;
  font-weight: 300;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.7);
  transition: opacity 0.3s ease;
}

.main-wrap .wish {
  font-size: 18px;
  font-weight: 300;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  transition: opacity 0.3s ease;
}

.line {
  width: 80px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
  margin: 30px 0;
}

/* =============== FLAGS / LANGUAGE SELECTION =============== */
.flags {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.lang-icon {
  width: 60px;
  height: 40px;
  background-size: cover;
  background-position: center;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  outline: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: inline-block;
  cursor: pointer;
}

.lang-icon:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

.lang-icon:focus,
.lang-icon.focused {
  border-color: var(--velra-gold);
  transform: scale(1.2);
  box-shadow: 
    var(--shadow-glow),
    0 12px 40px rgba(0, 0, 0, 0.5);
}

/* =============== FOOTER =============== */
.footer {
  position: absolute;
  bottom: 40px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  box-sizing: border-box;
  z-index: 5;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer .arrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* =============== VOD PAGE =============== */
.btn {
  padding: 16px 48px;
  font-size: 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  outline: none;
  border: 2px solid transparent;
  letter-spacing: 0.5px;
}

.btn.focused {
  border-color: var(--velra-gold);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.btn-play {
  background: rgba(212, 168, 75, 0.2);
  color: #fff;
  margin-right: 24px;
  border: 2px solid var(--velra-gold);
}

.btn-play:hover {
  background: rgba(212, 168, 75, 0.3);
  border-color: var(--velra-gold-light);
  transform: scale(1.02);
}

.btn-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.detail-buttons {
  margin-top: 30px;
  display: flex;
  gap: 20px;
}

#playerBox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 200;
  display: none;
}

#vodPlayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  background: #000;
}

.player-back {
  position: fixed;
  top: 24px;
  left: 24px;
  padding: 14px 28px;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  z-index: 300;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.player-back:hover,
.player-back.focused {
  border-color: var(--velra-gold);
  background: rgba(212, 168, 75, 0.2);
}

/* =============== LIVE TV PAGE =============== */
.player-view {
  display: flex;
}

.player-view:not(.active) {
  display: none;
}

.player-view.active {
  display: flex;
}

.player-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1;
}

#html5Player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

#videoChannelLGPlayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url(tv:);
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.channel-info {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.75);
  padding: 14px 24px;
  border-radius: 8px;
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  backdrop-filter: blur(12px);
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease;
  z-index: 5;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.player-sidebar.hidden {
  transform: translateX(360px);
}

.sidebar-header {
  background: rgba(212, 168, 75, 0.1);
  border-bottom: 1px solid rgba(212, 168, 75, 0.3);
  padding: 16px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  letter-spacing: 0.5px;
}

.sidebar-channels {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.sidebar-channel {
  display: flex;
  align-items: center;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.sidebar-channel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-channel.focused {
  border-color: var(--velra-gold);
  background: rgba(212, 168, 75, 0.15);
}

.sidebar-channel.active {
  background: rgba(212, 168, 75, 0.2);
  border-color: var(--velra-gold);
}

.channel-number {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  margin-right: 12px;
  flex-shrink: 0;
}

.channel-logo {
  width: 260px;
  height: 150px;
  object-fit: contain;
  background: transparent;
  border-radius: 4px;
  padding: 4px;
}

.preview-panel {
  position: fixed;
  top: 400px;
  right: 60px;
  width: 400px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#previewBox {
  width: 100%;
  height: 240px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#previewVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-title {
  margin-top: 16px;
  font-size: 24px;
  font-weight: 500;
}

.preview-desc {
  margin-top: 8px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

/* Toast notification */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(180, 60, 60, 0.95);
  color: #fff;
  padding: 24px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  animation: fadeInOut 3s ease;
  pointer-events: none;
  text-align: center;
  max-width: 80%;
  backdrop-filter: blur(12px);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  10% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  90% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

body.playing .header,
body.playing .tabs-nav,
body.playing .main-content,
body.playing .nav-hints {
  display: none !important;
}

.content-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100%;
}

/* =============== SETTINGS PAGE =============== */
.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 24px;
  min-height: 100vh;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.settings-section {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.settings-section:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--velra-gradient);
  border-radius: 2px;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 1rem;
  color: #fff;
}

.setting-description {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.slider {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.slider-value {
  min-width: 36px;
  text-align: center;
  color: #fff;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.toggle-switch.active {
  background: var(--velra-gold);
  box-shadow: 0 0 12px rgba(212, 168, 75, 0.5);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active::after {
  transform: translateX(28px);
}

.action-btn {
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: var(--velra-gold);
  color: #000;
  transform: translateY(-2px);
}

/* =============== PROMOTION PAGE =============== */
.promo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--velra-gold);
  color: #000;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(212, 168, 75, 0.4);
}

.grid-item video {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.grid-item:hover video {
  transform: scale(1.05);
}

.detail-left video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  background: #000;
}

/* =============== ADS PAGE =============== */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  opacity: 0.6;
}

#video, #img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

/* =============== VIDEO INTRO PAGE =============== */
#videoLayer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
}

video.bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hint {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 14px 28px;
  border-radius: 8px;
  z-index: 10;
  backdrop-filter: blur(10px);
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
