/* ==========================================================================
   Himanoon TV Design System & Core Styles
   Himanoon Visual Identity: Dark, Turquoise, Orange, Purple & Pink
   ========================================================================== */

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

:root {
  --bg-primary: #111521;
  --bg-secondary: #1A1D29;
  --bg-card: rgba(26, 29, 41, 0.78);
  --bg-card-hover: rgba(38, 31, 51, 0.9);
  --bg-glass: rgba(26, 29, 41, 0.84);
  
  --electric-blue: #00C8B0;
  --electric-blue-dark: #00A993;
  --electric-blue-glow: rgba(0, 200, 176, 0.34);
  
  --gold-primary: #F7941D;
  --gold-secondary: #E94364;
  --gold-glow: rgba(247, 148, 29, 0.34);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 200, 176, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Custom Luxury Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--electric-blue-dark);
}

/* Background Atmospheric Glows */
.ambient-glow-blue {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 200, 176, 0.14) 0%, rgba(90,43,136,0.04) 45%, rgba(0,0,0,0) 72%);
  top: -100px;
  left: -100px;
  pointer-events: none;
  z-index: 0;
  filter: blur(50px);
}

.ambient-glow-gold {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(233, 67, 100, 0.11) 0%, rgba(247,148,29,0.05) 45%, rgba(0,0,0,0) 72%);
  bottom: 10%;
  right: -50px;
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.glass-nav {
  background: rgba(17, 21, 33, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

/* Button & Badge Variants */
.btn-electric {
  background: linear-gradient(135deg, #00C8B0 0%, #5A2B88 100%);
  color: #030712;
  font-weight: 700;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
  box-shadow: 0 4px 20px var(--electric-blue-glow);
}
.btn-electric:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 200, 176, 0.46);
  color: #000;
}

.btn-gold {
  background: linear-gradient(135deg, #F7941D 0%, #E94364 100%);
  color: #000;
  font-weight: 800;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
  box-shadow: 0 4px 20px var(--gold-glow);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(233, 67, 100, 0.42);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--electric-blue);
  color: var(--electric-blue);
}

/* Category Quick Badges */
.category-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}
.category-chip:hover, .category-chip.active {
  background: rgba(0, 210, 255, 0.12);
  border-color: var(--electric-blue);
  color: var(--electric-blue);
  box-shadow: 0 0 15px var(--electric-blue-glow);
}

/* Card Hover Animations */
.interactive-card {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.interactive-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 210, 255, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 255, 0.15);
}

/* Live Badge Pulsing */
.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-red 1.6s infinite ease-in-out;
}

@keyframes pulse-red {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px #ef4444; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Quality Badges */
.badge-quality {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge-quality-4k {
  background: linear-gradient(135deg, #F7941D 0%, #E94364 100%);
  color: #000;
  box-shadow: 0 0 10px var(--gold-glow);
}
.badge-quality-fhd {
  background: rgba(0, 210, 255, 0.2);
  color: var(--electric-blue);
  border: 1px solid var(--electric-blue);
}
.badge-quality-hd {
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

/* Custom Video Player Styling */
.player-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.1);
  border: 1px solid var(--border-subtle);
}

.video-wrapper {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  width: 100%;
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: transform 0.3s ease, max-width 0.3s ease;
}

/* Himanoon Aspect Ratio Modes */
.video-wrapper video.aspect-fit {
  object-fit: contain !important;
  transform: none !important;
  max-width: 100% !important;
}
.video-wrapper video.aspect-fill {
  object-fit: fill !important;
  transform: none !important;
  max-width: 100% !important;
}
.video-wrapper video.aspect-zoom {
  object-fit: cover !important;
  transform: scale(1.18) !important;
  max-width: 100% !important;
}
.video-wrapper video.aspect-4-3 {
  object-fit: contain !important;
  transform: none !important;
  max-width: 75% !important;
  margin: 0 auto !important;
  left: 12.5% !important;
}

/* Custom Player Overlay Controls */
.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0) 100%);
  padding: 1.2rem 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}
.player-container:hover .player-controls-overlay,
.player-container.touch-active .player-controls-overlay {
  opacity: 1;
}

/* Custom Progress / Live bar */
.player-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  transition: height 0.15s ease;
}
.player-progress-bar:hover {
  height: 6px;
}
.player-progress-filled {
  height: 100%;
  background: var(--electric-blue);
  width: 100%;
  box-shadow: 0 0 10px var(--electric-blue);
  border-radius: 2px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 25px;
  left: 25px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-msg {
  background: var(--bg-secondary);
  color: #fff;
  border: 1px solid var(--border-subtle);
  border-right: 4px solid var(--electric-blue);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  pointer-events: auto;
  animation: slideIn 0.3s ease forwards;
}
.toast-msg.gold {
  border-right-color: var(--gold-primary);
}

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

/* Animations */
.fade-in {
  animation: fadeIn 0.35s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Channel playlist item active state */
.channel-item {
  transition: all 0.2s ease;
  cursor: pointer;
}
.channel-item:hover {
  background: rgba(255, 255, 255, 0.07);
}
.channel-item.active {
  background: rgba(0, 210, 255, 0.14);
  border-right: 3px solid var(--electric-blue);
}

/* Modal styling */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
