/* ==========================================================================
   ULTRA-LUXURY 2026 DESIGN SYSTEM - TIKTOK SHOP REVENUE & COMMISSION DASHBOARD
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Obsidian Cyber-Finance Palette (Dark Theme Default) */
  --bg-primary: #080b11;
  --bg-secondary: #0d131f;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(26, 38, 64, 0.9);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-glow: rgba(16, 185, 129, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-heading: #ffffff;

  --input-bg: rgba(15, 23, 42, 0.95);
  --input-border: rgba(255, 255, 255, 0.14);
  --input-text: #f8fafc;

  --subcard-bg: rgba(15, 23, 42, 0.65);
  --subcard-border: rgba(255, 255, 255, 0.07);

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;
  
  --glass-blur: blur(28px);
  --shadow-luxury: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --shadow-emerald: 0 12px 35px -8px rgba(16, 185, 129, 0.45);
}

/* Light Theme Variables (Pristine Apple Silk Pearl) */
body.light-theme {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-card: #e2e8f0;
  --border-card-glow: rgba(16, 185, 129, 0.35);
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-heading: #0f172a;

  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-text: #0f172a;

  --subcard-bg: #f8fafc;
  --subcard-border: #e2e8f0;
  
  --shadow-luxury: 0 12px 30px -6px rgba(0, 0, 0, 0.06), 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  --shadow-emerald: 0 12px 30px -10px rgba(16, 185, 129, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.01em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body:not(.light-theme) {
  background-image: 
    radial-gradient(circle at 10% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

body.light-theme {
  background-image: 
    radial-gradient(circle at 10% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 45%),
    radial-gradient(circle at 90% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 45%);
  background-attachment: fixed;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-emerald);
}

/* Glassmorphism Card Style with 2026 Micro-Interactions */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-luxury);
  border-radius: 1.25rem;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card-interactive {
  cursor: pointer;
}

.glass-card-interactive:hover {
  border-color: var(--border-card-glow);
  transform: translateY(-4px) scale(1.008);
  box-shadow: var(--shadow-emerald);
}

.glass-card-interactive:active {
  transform: translateY(-1px) scale(0.995);
}

/* Active Filter Glow on KPI Card */
.kpi-active-filter {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5), var(--shadow-emerald) !important;
  transform: translateY(-2px);
}

/* Shimmer Border Accent */
.shimmer-glow {
  position: relative;
  overflow: hidden;
}

.shimmer-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 55%
  );
  transform: rotate(35deg);
  animation: shimmerAnim 7s infinite;
  pointer-events: none;
}

@keyframes shimmerAnim {
  0% { transform: translateY(-100%) rotate(35deg); }
  100% { transform: translateY(100%) rotate(35deg); }
}

/* Numbers & Monospace accents */
.font-mono-num {
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* Gradient Texts */
.gradient-text-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .gradient-text-emerald {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-gold {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-cyber {
  background: linear-gradient(135deg, #0891b2 0%, #2563eb 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.status-settled {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
body:not(.light-theme) .status-settled {
  color: #34d399;
}

.status-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
body:not(.light-theme) .status-pending {
  color: #fbbf24;
}

.status-ineligible {
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
body:not(.light-theme) .status-ineligible {
  color: #fb7185;
}

/* Channel Pill */
.channel-live {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
body:not(.light-theme) .channel-live {
  color: #f87171;
}

.channel-video {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
body:not(.light-theme) .channel-video {
  color: #60a5fa;
}

.channel-showcase {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
body:not(.light-theme) .channel-showcase {
  color: #c084fc;
}

/* Quick TikTok Video Button */
.btn-tiktok-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}
.btn-tiktok-link:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Pulse Dot */
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Glowing Buttons with 2026 Micro-Scale */
.btn-luxury {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-weight: 700;
  font-size: 0.8125rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px -2px rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-luxury:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px -2px rgba(16, 185, 129, 0.55);
  filter: brightness(1.08);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  font-weight: 600;
  font-size: 0.8125rem;
  border-radius: 0.875rem;
  background: var(--subcard-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.15);
  border-color: rgba(148, 163, 184, 0.35);
  transform: translateY(-1.5px) scale(1.02);
}

/* Floating Scroll to Top Orb */
.floating-scroll-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 990;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.floating-scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-scroll-top:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.7), 0 0 15px rgba(16, 185, 129, 0.8);
}

.floating-scroll-top:active {
  transform: scale(0.95);
}

/* Interactive Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Light theme support for selects and search inputs */
body.light-theme input[type="text"],
body.light-theme select {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

body.light-theme input[type="text"]::placeholder {
  color: #94a3b8 !important;
}

/* Table Style with Enhanced Hover Effect */
.data-table-container {
  overflow-x: auto;
  border-radius: 1rem;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
}

.data-table th {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-primary);
  transition: all 0.15s ease;
}

/* Row Hover with Left Emerald Glow Indicator */
.data-table tr {
  position: relative;
  transition: background-color 0.15s ease;
}

body.light-theme .data-table tbody tr:hover td {
  background: #f1f5f9;
}

body:not(.light-theme) .data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

.data-table tbody tr:hover td:first-child {
  border-left: 3px solid var(--accent-emerald);
}

/* Modal Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  border-radius: 1.5rem;
  width: 92%;
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-primary);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Light Theme Card Overrides for AI and Simulator */
body.light-theme .ai-card-emerald {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}
body.light-theme .ai-card-emerald p {
  color: #065f46 !important;
}

body.light-theme .ai-card-amber {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}
body.light-theme .ai-card-amber p {
  color: #92400e !important;
}

body.light-theme .ai-card-rose {
  background: #fff1f2 !important;
  border-color: #fecdd3 !important;
}
body.light-theme .ai-card-rose p {
  color: #9f1239 !important;
}

body.light-theme .sub-card-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.light-theme .sub-card-box span {
  color: #1e293b !important;
}

/* Printable / PDF invoice layout */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print {
    display: none !important;
  }
  .glass-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
    color: #000000 !important;
  }
  .gradient-text-emerald, .gradient-text-gold, .gradient-text-cyber {
    -webkit-text-fill-color: #000000 !important;
  }
}
