/* PlayBox Management Platform - Light Theme Styles (Based on PlayBox Logo) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --border-color: #e2e8f0;
  --brand-pink: #db2777;
  --brand-magenta: #be185d;
  --brand-fuchsia: #c026d3;
  --brand-cyan: #06b6d4;
  --brand-purple: #9333ea;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #f8fafc !important;
  color: #0f172a !important;
  min-height: 100vh;
  overflow-x: hidden;
}

code, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar - Light Theme */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glassmorphism / Clean Cards in Light Theme */
.glass-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  color: #0f172a !important;
}

.glass-card-hover {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card-hover:hover {
  border-color: #fbcfe8 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(219, 39, 119, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Navigation Tabs */
.tab-btn {
  color: #475569 !important;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.15s ease;
}
.tab-btn:hover {
  color: #db2777 !important;
  background-color: #fdf2f8 !important;
}
.tab-btn.active-tab {
  color: #be185d !important;
  background-color: #fdf2f8 !important;
  font-weight: 800;
  border: 1px solid #fbcfe8 !important;
  box-shadow: 0 1px 2px 0 rgba(190, 24, 93, 0.08);
}

/* Status Indicators */
.pulse-dot-red {
  position: relative;
}
.pulse-dot-red::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #f43f5e;
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.pulse-dot-green {
  position: relative;
}
.pulse-dot-green::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Backdrop */
.modal-backdrop {
  background-color: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(6px);
}

.modal-backdrop .glass-card {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Loading Spinners */
.spinner {
  border: 3px solid rgba(219, 39, 119, 0.15);
  border-top-color: #db2777;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Gradients based on logo */
.gradient-brand {
  background: linear-gradient(135deg, #be185d 0%, #db2777 50%, #c026d3 100%);
}

.gradient-brand-subtle {
  background: linear-gradient(135deg, #fdf2f8 0%, #fae8ff 50%, #ecfeff 100%);
}

.gradient-text-pink {
  background: linear-gradient(135deg, #db2777 0%, #c026d3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Chart Canvas container */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 260px;
}

/* Store rank badge */
.rank-badge-gold {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e !important;
  border: 1px solid #fcd34d !important;
}
.rank-badge-silver {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.rank-badge-bronze {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  color: #9a3412 !important;
  border: 1px solid #fdba74 !important;
}

/* Light Theme Overrides for Form Controls and legacy dark utility classes */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="month"], select, textarea {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
input:focus, select:focus, textarea:focus {
  background-color: #ffffff !important;
  border-color: #db2777 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.15) !important;
}

/* Table light theme */
thead, thead.bg-slate-900\/80 {
  background-color: #f8fafc !important;
  color: #64748b !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
tbody tr:hover {
  background-color: #fdf2f8 !important;
}
tbody td {
  color: #1e293b;
}

/* Light Theme Overrides for Form Controls and legacy dark utility classes */
.border-slate-800, .border-slate-800\/80, .border-slate-800\/60, .border-slate-700 {
  border-color: #e2e8f0 !important;
}

/* Secondary buttons / dark buttons contrast fix in light mode */
button.bg-slate-800, button.bg-slate-900,
.btn-secondary {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
button.bg-slate-800:hover, button.bg-slate-900:hover,
.btn-secondary:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
button.bg-slate-800 i, button.bg-slate-800 svg,
button.bg-slate-900 i, button.bg-slate-900 svg,
.btn-secondary i, .btn-secondary svg {
  color: #475569 !important;
}
button.bg-slate-800:hover i, button.bg-slate-800:hover svg,
button.bg-slate-900:hover i, button.bg-slate-900:hover svg,
.btn-secondary:hover i, .btn-secondary:hover svg {
  color: #0f172a !important;
}

/* Keep button text white on colored action buttons */
button.bg-emerald-600, button.bg-emerald-500,
button.bg-pink-600, button.bg-pink-500,
button.bg-purple-600, button.bg-purple-500,
button.bg-rose-600, button.bg-rose-500,
button.bg-amber-600, button.bg-amber-500,
button[class*="bg-gradient"] {
  color: #ffffff !important;
}
button.bg-emerald-600 i, button.bg-emerald-600 svg,
button.bg-pink-600 i, button.bg-pink-600 svg,
button.bg-purple-600 i, button.bg-purple-600 svg,
button[class*="bg-gradient"] i, button[class*="bg-gradient"] svg {
  color: #ffffff !important;
}

/* Filter Buttons (Matches Reference Image 2) */
.filter-btn {
  padding: 0.375rem 0.875rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8125rem !important;
  line-height: 1.25rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: all 0.15s ease-in-out !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #334155 !important;
}
.filter-btn:hover {
  background-color: #fdf2f8 !important;
  border-color: #fbcfe8 !important;
  color: #db2777 !important;
}
.filter-btn.active {
  background-color: #db2777 !important;
  border-color: #db2777 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px 0 rgba(219, 39, 119, 0.28) !important;
}

/* Circular Rank Badges (Matches Reference Image 3) */
.rank-circle-1 {
  background-color: #f59e0b !important;
  color: #ffffff !important;
}
.rank-circle-2 {
  background-color: #64748b !important;
  color: #ffffff !important;
}
.rank-circle-3 {
  background-color: #b45309 !important;
  color: #ffffff !important;
}
.rank-circle-other {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

/* Rank Values (Matches Reference Image 3) */
.rank-val-1 {
  color: #d97706 !important;
}
.rank-val-2 {
  color: #334155 !important;
}
.rank-val-3 {
  color: #b45309 !important;
}
.rank-val-other {
  color: #0f172a !important;
}

/* ==========================================================================
   Collapsible Sidebar Navigation & Mobile Drawer
   ========================================================================== */
#app-sidebar {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 1023px) {
  #app-sidebar {
    transform: translateX(-100%);
  }
  #app-sidebar.mobile-open {
    transform: translateX(0) !important;
  }
}

@media (min-width: 1024px) {
  #app-sidebar.sidebar-collapsed {
    width: 4.75rem !important; /* ~76px */
  }
  #app-sidebar.sidebar-collapsed .sidebar-text {
    display: none !important;
  }
  #app-sidebar.sidebar-collapsed .sidebar-badge {
    display: none !important;
  }
  #app-sidebar.sidebar-collapsed .sidebar-item {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  #app-sidebar.sidebar-collapsed .sidebar-item > div {
    justify-content: center !important;
  }
  #app-sidebar.sidebar-collapsed .sidebar-header {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  #app-sidebar.sidebar-collapsed .sidebar-footer {
    justify-content: center !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* ==========================================================================
   Global API Loading Overlay Panel
   ========================================================================== */
#global-api-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.15s ease;
}

#global-api-loading.hidden {
  display: none !important;
}

.pb-loading-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 1rem;
  padding: 1rem 1.4rem;
  min-width: 180px;
  max-width: 90vw;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(219, 39, 119, 0.08);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pb-loading-ring {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 3px solid #fce7f3;
  border-top-color: #db2777;
  border-right-color: #9333ea;
  animation: pb-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes pb-spin {
  to {
    transform: rotate(360deg);
  }
}

.pb-loading-text-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pb-loading-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

