/* =====================================================
   MODERN GAMING THEME - Top Up Store
   Premium UI Design System
   ===================================================== */

/* ============ CSS Variables ============ */
:root {
  /* Primary Colors - Gaming Purple/Violet */
  --primary-50: #f5f3ff;
  --primary-100: #ede9fe;
  --primary-200: #ddd6fe;
  --primary-300: #c4b5fd;
  --primary-400: #a78bfa;
  --primary-500: #8b5cf6;
  --primary-600: #7c3aed;
  --primary-700: #6d28d9;
  --primary-800: #5b21b6;
  --primary-900: #4c1d95;
  
  /* Secondary Colors - Cyan */
  --secondary-400: #22d3ee;
  --secondary-500: #06b6d4;
  --secondary-600: #0891b2;
  
  /* Accent Colors */
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;
  
  /* Background Colors */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252540;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  
  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-card: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.05) 100%);
  --gradient-hero: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(6, 182, 212, 0.1) 50%, rgba(236, 72, 153, 0.1) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow-primary: 0 0 40px rgba(139, 92, 246, 0.3);
  --shadow-glow-secondary: 0 0 40px rgba(6, 182, 212, 0.3);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============ Base Styles ============ */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6, 182, 212, 0.1), transparent),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(236, 72, 153, 0.1), transparent);
  pointer-events: none;
  z-index: -1;
}

/* ============ Typography ============ */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-secondary {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

/* ============ Glass Card ============ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-glow-primary);
}

/* ============ Modern Navigation ============ */
.nav-modern {
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--gradient-primary);
}

/* ============ Modern Buttons ============ */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-500);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ============ Game Cards ============ */
.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  transition: all var(--transition-normal);
  cursor: pointer;
  aspect-ratio: 3/4;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
  transition: opacity var(--transition-normal);
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-glow-primary);
}

.game-card:hover::before {
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.2) 0%, rgba(0, 0, 0, 0.95) 100%);
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.game-card:hover img {
  transform: scale(1.1);
}

.game-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 2;
}

.game-card-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.game-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  background: var(--gradient-secondary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* ============ Product Cards ============ */
.product-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.product-card:hover {
  border-color: var(--primary-500);
  background: var(--bg-card-hover);
}

.product-card:hover::before {
  transform: scaleX(1);
}

.product-card.selected {
  border-color: var(--primary-500);
  background: rgba(139, 92, 246, 0.1);
}

.product-card.selected::before {
  transform: scaleX(1);
}

.product-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.product-card-name {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.product-card-price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-400);
}

.product-card-original-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ============ Payment Method Cards ============ */
.payment-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.payment-card:hover {
  border-color: var(--primary-500);
}

.payment-card.selected {
  border-color: var(--primary-500);
  background: rgba(139, 92, 246, 0.1);
}

.payment-card-icon {
  width: 48px;
  height: 32px;
  object-fit: contain;
}

.payment-card-name {
  flex: 1;
  font-weight: 500;
}

.payment-card-fee {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============ Input Fields ============ */
.input-modern {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.input-modern:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.input-modern::placeholder {
  color: var(--text-muted);
}

.input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-group .input-modern {
  padding-left: 2.75rem;
}

/* ============ Hero Banner ============ */
.hero-banner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 21/9;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 15, 26, 0.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

/* ============ Flash Sale Section ============ */
.flash-sale-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.flash-sale-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.flash-sale-icon {
  color: #fbbf24;
  animation: flash-glow 1.5s ease-in-out infinite;
}

@keyframes flash-glow {
  0%, 100% { 
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6)); 
    transform: scale(1);
  }
  50% { 
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 1)); 
    transform: scale(1.1);
  }
}

.countdown-box {
  display: flex;
  gap: 0.5rem;
}

.countdown-item {
  background: var(--gradient-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  min-width: 40px;
  text-align: center;
}

.countdown-separator {
  display: flex;
  align-items: center;
  font-weight: 700;
}

/* ============ Category Tabs ============ */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.category-tab:hover {
  color: var(--text-primary);
  border-color: var(--primary-500);
}

.category-tab.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

/* ============ Status Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ============ Sidebar Menu ============ */
.sidebar-modern {
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.sidebar-menu-item:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.sidebar-menu-item.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.15);
  border-left: 3px solid var(--primary-500);
}

.sidebar-menu-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar-menu-item:hover .sidebar-menu-icon,
.sidebar-menu-item.active .sidebar-menu-icon {
  opacity: 1;
}

/* ============ Footer Modern ============ */
.footer-modern {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 3rem 0 1.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  max-width: 300px;
}

.footer-title {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  color: var(--primary-400);
}

.footer-link {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer-social-link:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
}

/* ============ Auth Forms ============ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ============ Dashboard Stats ============ */
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.primary {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-400);
}

.stat-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.stat-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-yellow);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ============ Table Modern ============ */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-modern thead {
  background: var(--bg-tertiary);
}

.table-modern th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
}

.table-modern th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.table-modern th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.table-modern td {
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.875rem;
}

.table-modern tbody tr {
  transition: background var(--transition-fast);
}

.table-modern tbody tr:hover {
  background: var(--bg-card-hover);
}

/* ============ Animations ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.5); }
}

.animate-fade-in { animation: fadeIn 0.5s ease forwards; }
.animate-slide-up { animation: slideUp 0.5s ease forwards; }
.animate-slide-down { animation: slideDown 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

.animate-delay-100 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-200 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-300 { animation-delay: 0.3s; opacity: 0; }
.animate-delay-400 { animation-delay: 0.4s; opacity: 0; }
.animate-delay-500 { animation-delay: 0.5s; opacity: 0; }

/* ============ Responsive Utilities ============ */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.25rem;
  }
  
  .hero-banner {
    aspect-ratio: 16/9;
  }
  
  .auth-card {
    padding: 1.5rem;
  }
  
  .stat-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ============ Scrollbar Styling ============ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-600);
}

/* ============ Selection ============ */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}
