/* ================================================================
   VELRA SOLUTIONS - PREMIUM IPTV UI
   Thiết kế: Sang trọng, Tối giản, 10-foot-UI ready
   Phong cách: Modern Luxury Hotel TV Interface
   ================================================================ */

/* =============== CSS VARIABLES =============== */
:root {
  /* Color Palette - Velra Brand (Yellow-Green Gradient) */
  --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%);
  
  /* Primary colors using Velra brand */
  --color-primary: var(--velra-gold);
  --color-primary-light: var(--velra-gold-light);
  --color-primary-dark: #B8923F;
  --color-accent: var(--velra-green);
  --color-accent-light: var(--velra-green-light);
  
  /* Backgrounds */
  --bg-dark: #0D1810;
  --bg-primary: #0D1810;
  --bg-secondary: #121A14;
  --bg-tertiary: #1A241C;
  --bg-card: rgba(13, 24, 16, 0.6);
  --bg-card-hover: rgba(13, 24, 16, 0.8);
  --bg-overlay: rgba(13, 24, 16, 0.7);
  --bg-glass: rgba(13, 24, 16, 0.6);
  
  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.6);
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: var(--velra-gold);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(212, 168, 75, 0.3);
  --shadow-green-glow: 0 0 40px rgba(74, 124, 63, 0.4);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  
  /* Typography */
  --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;
  
  /* Spacing - 10-foot-UI */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 60px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* =============== RESET =============== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============== BACKGROUND =============== */
.bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.5);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(13, 24, 16, 0.6) 0%,
    rgba(13, 24, 16, 0.4) 50%,
    rgba(13, 24, 16, 0.7) 100%
  );
  z-index: 1;
}

/* Gradient overlay - top */
.bg-top-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* Gradient overlay - bottom */
.bg-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 50;
}

/* =============== HEADER =============== */
.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  background: transparent;
}

.brand-container {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 80px;
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.5));
  transition: opacity var(--transition-normal);
}

/* Velra Logo SVG styling */
.velra-logo {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.5));
}

/* Header Right - Top Menu Bar */
.header-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  z-index: 10;
}

/* Top Menu Icons */
.top-menu {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.top-menu-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.top-menu-item:hover,
.top-menu-item.focused {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.top-menu-item svg,
.top-menu-item img {
  width: 24px;
  height: 24px;
  opacity: 0.9;
}

/* Notification badge */
.top-menu-item .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #E53935;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Room Number Display */
.room-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.room-label {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.room-number {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

/* Time Display */
.time-display {
  font-size: 42px;
  font-weight: var(--font-weight-light);
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1;
}

/* Legacy support */
.date-block {
  display: flex;
  flex-direction: column;
  margin-right: var(--space-sm);
  text-align: right;
}

.date-line {
  font-size: 26px;
  font-weight: var(--font-weight-light);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.temperature {
  font-size: 26px;
  font-weight: var(--font-weight-light);
  margin-top: 4px;
  color: var(--text-secondary);
}

.time-line {
  font-size: 48px;
  font-weight: var(--font-weight-light);
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 2px;
  margin-left: var(--space-sm);
}

.weather-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 4px;
}

.weather-icon {
  font-size: 26px;
  margin-right: 6px;
  color: var(--text-secondary);
  line-height: 1;
}

/* =============== TABS NAVIGATION =============== */
/* =============== TABS NAVIGATION - Velra Style =============== */
.tabs-nav {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 50px;
  flex-shrink: 0;
  margin-top: 10px;
  background: transparent;
}

.tab-item {
  padding: 14px 32px;
  font-size: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

.tab-item:hover {
  color: rgba(255, 255, 255, 0.8);
}

.tab-item.active {
  color: #fff;
  border-bottom-color: #D4A84B;
}

.tab-item.focused {
  color: #fff;
  background: linear-gradient(135deg, #D4A84B 0%, #8FB83A 50%, #4A7C3F 100%);
  border-radius: 30px;
  border-bottom-color: transparent;
  box-shadow: 0 0 0 3px rgba(143, 184, 58, 0.5), 0 8px 24px rgba(143, 184, 58, 0.4);
  z-index: 10;
  transform: scale(1.02);
}

/* =============== MAIN LAYOUT =============== */
.main-layout {
  position: fixed;
  top: 180px;
  left: 0;
  right: 0;
  bottom: 80px;
  z-index: 2;
}

/* =============== GRID CONTAINER =============== */
.grid-container {
  position: absolute;
  left: var(--space-lg);
  top: 0;
  right: var(--space-lg);
  bottom: 0;
  padding: var(--space-md) 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.grid-wrapper {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-left: var(--space-lg);
  padding-right: var(--space-sm);
  gap: var(--space-md);
}

.grid-item {
  width: calc(25% - 18px);
  height: max-content;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
}

.grid-item:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.grid-item.focused {
  border-color: var(--velra-gold);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  transform: translateY(-4px);
  z-index: 10;
}

.grid-item-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.grid-item:hover .grid-item-image,
.grid-item.focused .grid-item-image {
  transform: scale(1.05);
}

.grid-item-title {
  height: 65px;
  padding: var(--space-sm);
  text-align: center;
  font-weight: var(--font-weight-medium);
  font-size: 22px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-top: 1px solid var(--border-subtle);
}

/* =============== DETAIL VIEW =============== */
.detail-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: transparent;
  display: none;
  flex-direction: column;
}

.detail-view.active {
  display: flex;
}

/* Hide tabs and grid when in detail mode */
body.detail-mode .tabs-nav,
body.detail-mode .main-layout {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.detail-mode .nav-hints:not(.detail-view .nav-hints) {
  display: none !important;
}

/* Detail Header */
.detail-header {
  padding: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

/* Detail Content */
.detail-content {
  flex: 1;
  padding: var(--space-lg);
  display: flex;
  overflow-y: auto;
  margin: var(--space-md) auto 100px auto;
  max-width: 1600px;
  width: 85%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.detail-content > * {
  margin-right: var(--space-lg);
}

.detail-content > *:last-child {
  margin-right: 0;
}

.detail-left {
  flex: 0 0 450px;
  display: flex;
  flex-direction: column;
}

.detail-left > * {
  margin-bottom: var(--space-sm);
}

.detail-left > *:last-child {
  margin-bottom: 0;
}

.detail-thumbnail {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.detail-video {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.detail-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.detail-title {
  font-size: 40px;
  font-weight: var(--font-weight-bold);
  color: #fff;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.detail-description {
  font-size: 26px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: justify;
}

.detail-info {
  margin-top: var(--space-sm);
}

.info-row {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 26px;
  overflow: hidden;
}

.info-label {
  float: left;
  color: var(--text-muted);
  font-weight: var(--font-weight-normal);
}

.info-value {
  float: right;
  font-weight: var(--font-weight-medium);
  color: #fff;
}

/* =============== NAVIGATION HINTS (FOOTER) =============== */
.nav-hints {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-xl);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 22px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.hint-item {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: var(--font-weight-normal);
}

.hint-item > * {
  margin-right: var(--space-xs);
}

.hint-item > *:last-child {
  margin-right: 0;
}

.hint-item.center {
  flex: 1;
  justify-content: center;
}

.arrow {
  font-size: 22px;
  color: var(--velra-gold);
}

/* Hide center hint in detail view */
body.detail-mode .hint-item.center,
.detail-view .nav-hints .hint-item.center,
.detail-view.active .nav-hints .hint-item.center,
#detailView .nav-hints .hint-item.center {
  display: none !important;
  visibility: hidden !important;
}

body.detail-mode .nav-hints,
.detail-view.active .nav-hints,
#detailView .nav-hints {
  justify-content: space-between !important;
}

.arrow-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin: 0 6px;
  opacity: 0.8;
}

/* =============== UTILITIES =============== */
/* Loading */
.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -25px;
  margin-top: -25px;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(212, 168, 75, 0.2);
  border-top: 3px solid var(--velra-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scrollbars - Premium Style */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

/* =============== FOCUS STATE =============== */
/* Animation pulse-glow đã được loại bỏ - focus state tĩnh */

/* =============== VELRA GRADIENT TEXT =============== */
.velra-gradient-text {
  background: var(--velra-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============== VELRA DIVIDER =============== */
.velra-divider {
  width: 200px;
  height: 3px;
  background: var(--velra-gradient);
  border-radius: 2px;
}

/* =============== VELRA KEY HINT =============== */
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 40px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 500;
  color: var(--velra-gold);
}

/* =============== TOAST NOTIFICATION =============== */
#toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  font-size: 20px;
  z-index: 9999;
  opacity: 0;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* =============== RESPONSIVE - TV SIZES =============== */
@media (max-width: 1366px) {
  :root {
    --space-lg: 32px;
    --space-xl: 48px;
  }
  
  .grid-item {
    width: calc(33.333% - 16px);
  }
  
  .tabs-nav {
    gap: 10px;
    padding: 3px 40px;
  }

  .tab-item {
    padding: 12px 26px;
    font-size: 17px;
  }
}

@media (min-width: 1920px) {
  .tabs-nav {
    gap: 14px;
    padding: 5px 60px;
  }

  .tab-item {
    padding: 16px 36px;
    font-size: 22px;
  }
}

@media (min-width: 3840px) {
  .tabs-nav {
    gap: 20px;
    padding: 8px 100px;
  }

  .tab-item {
    padding: 24px 52px;
    font-size: 32px;
  }
}

@media (min-width: 1920px) {
  .grid-item {
    width: calc(25% - 18px);
  }
  
  .grid-item-image {
    height: 200px;
  }
}

@media (min-width: 3840px) {
  :root {
    --space-lg: 60px;
    --space-xl: 80px;
  }
  
  .brand-logo {
    height: 100px;
  }
  
  .time-line {
    font-size: 64px;
  }
  
  .date-line,
  .temperature {
    font-size: 36px;
  }
}
