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

:root {
  /* Colors */
  --bg-primary: #0a0b10;
  --bg-secondary: #12131a;
  --bg-tertiary: #1b1c26;
  
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(18, 19, 26, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Poppins', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
}

/* Glassmorphism Classes */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.15);
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
}

/* Utility Layouts */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Inputs & Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Header/Nav Styles for Dashboard & Shop */
.navbar {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  height: 70px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--border-color);
}

/* --- Theme Transitions & Light Mode Support --- */
body, 
.glass-card, 
.sidebar-navigation, 
.topbar, 
.table-container,
.stat-card-premium,
.checkout-modal {
  transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              color 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.no-transition,
.no-transition * {
  transition: none !important;
}

/* Light Theme Variables */
:root[data-theme="light"],
html[data-theme="light"],
html.light-theme,
body.light-theme,
[data-theme="light"] {
  --bg-primary: #f8fafc; /* Slate 50 */
  --bg-secondary: #ffffff; /* Pure White */
  --bg-tertiary: #f1f5f9; /* Slate 100 */
  
  --text-primary: #0f172a; /* Slate 900 */
  --text-secondary: #334155; /* Slate 700 */
  --text-muted: #64748b; /* Slate 500 */
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.12);
  
  --border-color: #e2e8f0; /* Slate 200 */
  --glass-bg: #ffffff;
  --glass-border: #e2e8f0;
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  /* Agent Portal System Colors in Light Mode */
  --agent-dark-bg: #f8fafc;
  --agent-dark-surface: #ffffff;
  --agent-dark-card: #ffffff;
  --agent-dark-border: #e2e8f0;
  --agent-dark-text: #0f172a;
  --agent-dark-muted: #64748b;
  --agent-cyan: #0891b2;
}

/* Global Light Theme Component Overrides */
[data-theme="light"] body,
body.light-theme {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

[data-theme="light"] .form-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="url"],
[data-theme="light"] input[type="email"],
[data-theme="light"] select,
[data-theme="light"] textarea,
body.light-theme .form-input,
body.light-theme select {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] select:focus,
body.light-theme .form-input:focus {
  background-color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

[data-theme="light"] .glass-card,
[data-theme="light"] .card,
[data-theme="light"] .card.glass,
[data-theme="light"] .metric-card,
body.light-theme .glass-card,
body.light-theme .card,
body.light-theme .card.glass,
body.light-theme .metric-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

[data-theme="light"] .sidebar,
[data-theme="light"] .sidebar-navigation,
[data-theme="light"] aside,
body.light-theme .sidebar,
body.light-theme .sidebar-navigation {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .topbar,
[data-theme="light"] header.topbar,
[data-theme="light"] .dashboard-topbar,
body.light-theme .topbar,
body.light-theme header.topbar {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] .table-container,
[data-theme="light"] table,
body.light-theme .table-container {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] th,
body.light-theme th {
  background-color: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] td,
body.light-theme td {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] tr:hover td,
body.light-theme tr:hover td {
  background-color: #f8fafc !important;
}

[data-theme="light"] h1, [data-theme="light"] h2, [data-theme="light"] h3, 
[data-theme="light"] h4, [data-theme="light"] h5, [data-theme="light"] h6,
body.light-theme h1, body.light-theme h2, body.light-theme h3, 
body.light-theme h4, body.light-theme h5, body.light-theme h6 {
  color: #0f172a !important;
}

[data-theme="light"] .user-name,
body.light-theme .user-name {
  color: #0f172a !important;
}

[data-theme="light"] .user-role,
body.light-theme .user-role {
  color: #64748b !important;
}

[data-theme="light"] .nav-item,
body.light-theme .nav-item {
  color: #475569;
}

[data-theme="light"] .nav-item:hover,
body.light-theme .nav-item:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .nav-item.active,
body.light-theme .nav-item.active {
  color: #ffffff !important;
  font-weight: 700 !important;
}

[data-theme="light"] .nav-item.active i,
body.light-theme .nav-item.active i,
[data-theme="light"] .nav-item.active span,
body.light-theme .nav-item.active span {
  color: #ffffff !important;
}

[data-theme="light"] .badge-success,
body.light-theme .badge-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="light"] .badge-warning,
body.light-theme .badge-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #d97706 !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="light"] .badge-danger,
body.light-theme .badge-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="light"] .modal-overlay,
body.light-theme .modal-overlay {
  background: rgba(15, 23, 42, 0.6) !important;
}

[data-theme="light"] .modal-overlay .glass-card,
body.light-theme .modal-overlay .glass-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  color: #0f172a !important;
}

/* Universal Sleek Transparent Scrollbars (Eliminates white tracks and native arrow buttons everywhere) */
* {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent !important;
}

::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

::-webkit-scrollbar-track {
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16) !important;
  border-radius: 10px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 211, 198, 0.5) !important;
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

::-webkit-scrollbar-corner {
  background: transparent !important;
}

/* Light theme subtle scrollbars (Never white track, no native arrows) */
[data-theme="light"] *,
body.light-theme * {
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent !important;
}

[data-theme="light"] ::-webkit-scrollbar-track,
body.light-theme ::-webkit-scrollbar-track {
  background: transparent !important;
}

[data-theme="light"] ::-webkit-scrollbar-thumb,
body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18) !important;
  border-radius: 10px !important;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover,
body.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35) !important;
}

/* Light Theme Button & Method Toggle Visibility */
[data-theme="light"] .method-btn-inactive,
body.light-theme .method-btn-inactive {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .method-btn-inactive span,
[data-theme="light"] .method-btn-inactive i,
body.light-theme .method-btn-inactive span,
body.light-theme .method-btn-inactive i {
  color: #0f172a !important;
}

[data-theme="light"] .btn:not(.btn-primary):not(.method-btn-active):not([style*="background: linear-gradient"]):not([style*="background: #10b981"]):not([style*="background: #ef4444"]):not([style*="background:#10b981"]):not([style*="background:#ef4444"]),
body.light-theme .btn:not(.btn-primary):not(.method-btn-active):not([style*="background: linear-gradient"]):not([style*="background: #10b981"]):not([style*="background: #ef4444"]) {
  color: #0f172a;
}

/* Ensure stat numbers & metrics inside cards are crisp dark in Light Mode */
[data-theme="light"] #dash-total-volume,
[data-theme="light"] #dash-total-merchants,
[data-theme="light"] #dash-total-orders,
[data-theme="light"] #dash-agent-id,
[data-theme="light"] #payout-total-settled,
[data-theme="light"] #prof-merchants-count,
[data-theme="light"] #comm-today-earned,
[data-theme="light"] #comm-total-orders,
body.light-theme #dash-total-volume,
body.light-theme #dash-total-merchants,
body.light-theme #dash-total-orders,
body.light-theme #dash-agent-id,
body.light-theme #payout-total-settled,
body.light-theme #prof-merchants-count,
body.light-theme #comm-today-earned,
body.light-theme #comm-total-orders {
  color: #0f172a !important;
}

[data-theme="light"] .glass-card [style*="color: #ffffff"],
[data-theme="light"] .glass-card [style*="color: #fff"],
[data-theme="light"] .glass-card [style*="color:#ffffff"],
[data-theme="light"] .glass-card [style*="color:#fff"],
body.light-theme .glass-card [style*="color: #ffffff"],
body.light-theme .glass-card [style*="color: #fff"],
body.light-theme .glass-card [style*="color:#ffffff"],
body.light-theme .glass-card [style*="color:#fff"] {
  color: #0f172a !important;
}

/* Shared Notification Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0ed3c6;
  color: #ffffff; /* White text for premium readability */
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  font-size: 20px;
}

