/*
Theme Name: NSM Idol Live Theme
Theme URI: https://ngoisaomedia.com
Author: NSM Development Team
Author URI: https://ngoisaomedia.com
Description: Theme chuyên nghiệp cho hệ thống quản lý Idol Live TikTok với phong cách Neon - Holographic - Gradient động. Thiết kế hiện đại, năng lượng cao, tối ưu cho trải nghiệm idol và người dùng.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: nsm-idol-live
Tags: custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, blog, entertainment, portfolio

NSM Idol Live Theme, Copyright 2025 NSM Development Team
NSM Idol Live Theme is distributed under the terms of the GNU GPL
*/

/**
 * Table of Contents:
 * 
 * 1.0 - CSS Variables & Design System
 * 2.0 - Reset & Base Styles
 * 3.0 - Typography
 * 4.0 - Layout & Grid
 * 5.0 - Components
 * 6.0 - Animations & Effects
 * 7.0 - Responsive Design
 * 8.0 - Dark Mode
 */

/* ==========================================================================
   1.0 - CSS Variables & Design System
   ========================================================================== */

:root {
  /* Primary Neon Colors */
  --neon-pink: var(--nsm-color-secondary);
  --neon-aqua: var(--nsm-color-primary);
  --neon-purple: var(--nsm-color-accent);
  --neon-yellow: #FFD600;
  --neon-green: #39FF14;

  /* Background Colors */
  --bg-dark: #0B0014;
  --bg-dark-secondary: #1A0B2E;
  --bg-dark-tertiary: #2D1B4E;
  --bg-gradient: linear-gradient(135deg, #0B0014 0%, #1A0B2E 50%, #2D1B4E 100%);
  --bg-overlay: rgba(11, 0, 20, 0.85);

  /* Text Colors - High Contrast */
  --text-primary: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-muted: #B0B0B0;
  /* Lightened for better readability */
  --text-neon: var(--neon-pink);

  /* Gradient Combinations */
  --gradient-primary: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--neon-aqua) 0%, var(--neon-purple) 100%);
  --gradient-hero: linear-gradient(135deg, rgba(255, 47, 212, 0.3) 0%, rgba(176, 38, 255, 0.3) 100%);

  /* Shadows & Glows */
  --glow-pink: 0 0 20px rgba(255, 47, 212, 0.6), 0 0 40px rgba(255, 47, 212, 0.4);
  --glow-aqua: 0 0 20px rgba(0, 255, 255, 0.6), 0 0 40px rgba(0, 255, 255, 0.4);
  --glow-purple: 0 0 20px rgba(176, 38, 255, 0.6), 0 0 40px rgba(176, 38, 255, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-text: 2px 2px 4px rgba(0, 0, 0, 0.8);

  /* RGBA variants for existing colors */
  --neon-pink-rgba-05: rgba(255, 47, 212, 0.05);
  --neon-pink-rgba-10: rgba(255, 47, 212, 0.1);
  --neon-pink-rgba-20: rgba(255, 47, 212, 0.2);
  --neon-pink-rgba-30: rgba(255, 47, 212, 0.3);
  --neon-pink-rgba-50: rgba(255, 47, 212, 0.5);
  --neon-pink-rgba-60: rgba(255, 47, 212, 0.6);
  --neon-pink-rgba-90: rgba(255, 47, 212, 0.9);
  --neon-aqua-rgba-08: rgba(0, 255, 255, 0.08);
  --neon-aqua-rgba-10: rgba(0, 255, 255, 0.1);
  --neon-aqua-rgba-20: rgba(0, 255, 255, 0.2);
  --neon-red: #FF3B30;
  --neon-red-rgba-0: rgba(255, 59, 48, 0);
  --neon-red-rgba-10: rgba(255, 59, 48, 0.1);
  --neon-red-rgba-15: rgba(255, 59, 48, 0.15);
  --neon-red-rgba-20: rgba(255, 59, 48, 0.2);
  --neon-red-rgba-30: rgba(255, 59, 48, 0.3);
  --neon-red-rgba-40: rgba(255, 59, 48, 0.4);
  --neon-red-rgba-50: rgba(255, 59, 48, 0.5);
  --neon-red-rgba-60: rgba(255, 59, 48, 0.6);
  --neon-red-rgba-70: rgba(255, 59, 48, 0.7);
  --neon-red-rgba-80: rgba(255, 59, 48, 0.8);
  --neon-red-rgba-100: rgba(255, 59, 48, 1);
  --neon-magenta: #FF006E;
  --text-primary-rgba-02: rgba(255, 255, 255, 0.02);
  --text-primary-rgba-03: rgba(255, 255, 255, 0.03);
  --text-primary-rgba-05: rgba(255, 255, 255, 0.05);
  --text-primary-rgba-08: rgba(255, 255, 255, 0.08);
  --text-primary-rgba-10: rgba(255, 255, 255, 0.1);
  --text-primary-rgba-20: rgba(255, 255, 255, 0.2);
  --text-primary-rgba-30: rgba(255, 255, 255, 0.3);
  --text-primary-rgba-40: rgba(255, 255, 255, 0.4);
  --text-primary-rgba-80: rgba(255, 255, 255, 0.8);
  --text-muted-rgba-10: rgba(160, 160, 160, 0.1);
  --text-muted-rgba-15: rgba(160, 160, 160, 0.15);
  --text-muted-rgba-20: rgba(160, 160, 160, 0.2);
  --text-muted-rgba-30: rgba(160, 160, 160, 0.3);
  --bg-dark-rgba-60: rgba(11, 0, 20, 0.6);
  --bg-dark-rgba-80: rgba(11, 0, 20, 0.8);
  --bg-dark-rgba-95: rgba(11, 0, 20, 0.95);
  --bg-dark-rgba-98: rgba(11, 0, 20, 0.98);
  --bg-dark-tertiary-rgba-50: rgba(45, 27, 78, 0.5);
  --bg-dark-tertiary-rgba-80: rgba(45, 27, 78, 0.8);
  --neon-green-rgba-15: rgba(57, 255, 20, 0.15);
  --neon-green-rgba-30: rgba(57, 255, 20, 0.3);
  --neon-yellow-rgba-15: rgba(255, 214, 0, 0.15);
  --neon-yellow-rgba-30: rgba(255, 214, 0, 0.3);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index - UNIFIED with nsm-shared for plugin compatibility */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 9999;
  --z-modal: 10000;
  --z-popover: 10050;
  --z-tooltip: 10060;
  --z-toast: 10100;
  --z-max: 99999;
}

/* ==========================================================================
   2.0 - Reset & Base Styles (SCOPED to prevent WP admin conflicts)
   ========================================================================== */

/* Scoped reset - only applies within NSM theme pages */
.nsm-theme-scope,
.nsm-theme-scope *,
.nsm-theme-scope *::before,
.nsm-theme-scope *::after,
body.nsm-idol-live-theme,
body.nsm-idol-live-theme *,
body.nsm-idol-live-theme *::before,
body.nsm-idol-live-theme *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Body styles - only apply to frontend, not admin */
body:not(.wp-admin) {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ==========================================================================
   3.0 - Typography
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

h5 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

h6 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--neon-aqua);
  text-decoration: none;
  transition: all var(--transition-fast);
}

a:hover {
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
}

/* Neon Text Effect */
.neon-text {
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
  animation: neon-flicker 3s infinite alternate;
}

.neon-text-aqua {
  color: var(--neon-aqua);
  text-shadow: var(--glow-aqua);
}

/* ==========================================================================
   4.0 - Layout & Grid
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-fluid {
  width: 100%;
  padding: 0 var(--spacing-md);
}

/* ==========================================================================
   5.0 - Components
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: var(--glow-pink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(255, 47, 212, 0.8), 0 0 60px rgba(255, 47, 212, 0.5);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: var(--text-primary);
  box-shadow: var(--glow-aqua);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(0, 255, 255, 0.5);
}

/* Cards */
.card {
  background: rgba(26, 11, 46, 0.8);
  border: 1px solid rgba(255, 47, 212, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink), var(--shadow-card);
}

/* ==========================================================================
   6.0 - Animations & Effects
   ========================================================================== */

@keyframes neon-flicker {

  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 47, 212, 0.8),
      0 0 20px rgba(255, 47, 212, 0.6),
      0 0 30px rgba(255, 47, 212, 0.4);
  }

  50% {
    text-shadow: 0 0 20px rgba(255, 47, 212, 1),
      0 0 40px rgba(255, 47, 212, 0.8),
      0 0 60px rgba(255, 47, 212, 0.6);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

/* ==========================================================================
   7.0 - Responsive Design (Mobile-First Optimized)
   ========================================================================== */

/* Mobile Base - Touch-Friendly */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    /* Touch-friendly minimum tap targets */
    --touch-target-min: 44px;
    --touch-target-comfortable: 48px;
  }

  html {
    /* Prevent zoom on input focus */
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Smooth scrolling for iOS */
    -webkit-overflow-scrolling: touch;
  }

  body {
    /* Prevent horizontal scroll */
    overflow-x: hidden;
    /* Better touch scrolling */
    overscroll-behavior-y: contain;
  }

  .container {
    padding: 0 var(--spacing-sm);
    /* Safe areas for notched devices */
    padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
    padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: var(--touch-target-comfortable);
    padding: 14px 24px;
    /* Prevent tap highlight on iOS */
    -webkit-tap-highlight-color: var(--bg-dark-rgba-00, color-mix(in srgb, var(--bg-dark) 100%, var(--text-primary) 0%));
  }

  /* Better tap targets for links */
  a {
    /* Extend tap area */
    padding: 8px 4px;
    margin: -8px -4px;
    -webkit-tap-highlight-color: var(--neon-pink-rgba-20);
  }

  /* Prevent text selection on interactive elements */
  button,
  .btn,
  .card {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* Small phones */
@media (max-width: 375px) {
  :root {
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
  }

  html {
    font-size: 14px;
  }
}

/* ==========================================================================
   8.0 - Dark Mode (Always Active)
   ========================================================================== */

/* Theme is designed for dark mode by default */

/* ==========================================================================
   9.0 - Mobile Micro-Interactions & Gen Z Enhancements
   ========================================================================== */

/* Swipe-friendly horizontal scroll containers */
.scroll-snap-container {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: var(--spacing-sm);
}

.scroll-snap-container::-webkit-scrollbar {
  display: none;
}

.scroll-snap-item {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Pulse animation for CTAs - TikTok style */
@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 47, 212, 0.6);
  }

  50% {
    box-shadow: 0 0 40px rgba(255, 47, 212, 0.9), 0 0 60px rgba(255, 47, 212, 0.4);
  }
}

.btn-primary.pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Shake animation for attention */
@keyframes shake-attention {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-2px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(2px);
  }
}

.shake-on-hover:hover {
  animation: shake-attention 0.5s ease-in-out;
}

/* Bounce-in for elements entering viewport */
@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  50% {
    transform: scale(1.05) translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Live indicator - TikTok style */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-primary);
}

.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-radius: 50%;
  animation: live-pulse 1s ease-in-out infinite;
}

@keyframes live-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Trending badge */
.trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #FF3B30, #FF9500);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--bg-dark);
  text-transform: uppercase;
}

/* Floating action button - Mobile */
@media (max-width: 768px) {
  .floating-cta {
    position: fixed;
    bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-fixed);
    display: flex;
    gap: var(--spacing-sm);
    padding: 12px 20px;
    background: var(--bg-dark-rgba-95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--neon-pink-rgba-30);
    border-radius: var(--radius-full);
    box-shadow: 0 10px 40px var(--shadow-card);
  }

  .floating-cta .btn {
    min-width: auto;
    padding: 10px 16px;
    font-size: 0.875rem;
  }
}

/* Story-style circular avatars */
.story-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-aqua));
}

.story-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-dark);
}

/* Quick stats counter - Compact */
.quick-stat {
  text-align: center;
  padding: 12px;
}

.quick-stat-number {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  /* Standard property for compatibility */
  -webkit-text-fill-color: var(--text-primary-rgba-00, color-mix(in srgb, var(--text-primary) 0%, var(--bg-dark) 100%));
  line-height: 1;
}

.quick-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Emoji reactions - TikTok style */
.emoji-reaction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.25rem;
    background: var(--text-primary-rgba-10);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.emoji-reaction:hover {
  transform: scale(1.2);
    background: var(--text-primary-rgba-20);
}

.emoji-reaction:active {
  transform: scale(0.9);
}

/* ==========================================================================
   10.0 - Performance Optimizations
   ========================================================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-snap-container {
    scroll-snap-type: none;
  }
}

/* GPU acceleration for animations */
.gpu-accelerated {
  will-change: transform;
  transform: translateZ(0);
}

/* Content visibility for performance */
.content-visibility-auto {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* ==========================================================================
   11.0 - Apple Design Bottom Navigation (Glassmorphism)
   ========================================================================== */

.nsm-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .nsm-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 85px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-dark-rgba-60);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    backdrop-filter: blur(25px) saturate(180%);
    border-top: 1px solid var(--neon-pink-rgba-20);
    z-index: 1040;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 30px var(--shadow-rgba-30, var(--bg-dark-rgba-80));
  }

  .nsm-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary-rgba-60);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .nsm-bottom-nav .nav-item i {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
  }

  .nsm-bottom-nav .nav-item.active {
    color: var(--neon-pink);
  }

  .nsm-bottom-nav .nav-item.active i {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px var(--neon-pink-rgba-80));
  }

  /* Center Action Button */
  .nsm-bottom-nav .nav-item-center {
    position: relative;
    top: -15px;
  }

  .nsm-bottom-nav .center-btn {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px var(--neon-pink-rgba-50);
    border: 3px solid var(--bg-dark);
    margin-bottom: 2px;
  }

  .nsm-bottom-nav .center-btn i {
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    margin-bottom: 0;
  }

  .nsm-bottom-nav .nav-item-center span {
    color: var(--text-primary);
    margin-top: 4px;
  }
}
