/* ==========================================================================
   G QRIS - Design System & Modern Aesthetics
   ========================================================================== */

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

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

  /* Color Palette */
  --bg-main: #0B0F19;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-surface: #1E293B;
  --bg-glass: rgba(17, 24, 39, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.5);

  /* Brand Colors (Emerald & Deep Indigo / Cyan Tech) */
  --brand-50: #ECFDF5;
  --brand-100: #D1FAE5;
  --brand-300: #6EE7B7;
  --brand-500: #10B981;
  --brand-600: #059669;
  --brand-700: #047857;

  --accent-blue: #3B82F6;
  --accent-indigo: #6366F1;
  --accent-purple: #8B5CF6;

  /* Functional Colors */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #0EA5E9;
  --info-bg: rgba(14, 165, 233, 0.12);

  /* Text Colors */
  --text-main: #F9FAFB;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px -5px rgba(16, 185, 129, 0.25);
  --shadow-blue-glow: 0 0 30px -5px rgba(99, 102, 241, 0.25);
}

/* Light Theme Variables for Pay / Docs if preferred */
.theme-light {
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-surface: #E2E8F0;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-color: #E2E8F0;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Base resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

code, pre {
  font-family: var(--font-mono);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-700);
}

/* Layout Utilities */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero-grid-bg {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
  background-size: 32px 32px, 100% 100%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-emerald {
  background: var(--success-bg);
  color: var(--brand-300);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-blue {
  background: var(--info-bg);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.25);
}
.badge-amber {
  background: var(--warning-bg);
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.badge-red {
  background: var(--danger-bg);
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.25);
}
.badge-slate {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online {
  background-color: var(--brand-500);
  box-shadow: 0 0 8px var(--brand-500);
}
.status-dot.warning {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}
.status-dot.offline {
  background-color: var(--text-dim);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.65rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger {
  background: var(--danger-bg);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: 0.75rem;
}

/* Form inputs */
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.95rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.65rem;
  color: var(--text-main);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-500);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.card-hover:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  transition: all 0.25s ease;
}
.card-glow {
  box-shadow: var(--shadow-glow);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Glassmorphism */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
}

/* Gradient Texts */
.text-gradient-emerald {
  background: linear-gradient(135deg, #34D399 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-cyan {
  background: linear-gradient(135deg, #67E8F9 0%, #3B82F6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: #1E293B;
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-main);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left: 4px solid var(--brand-500); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--accent-blue); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-box {
  transform: scale(1);
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Table styles */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: 0.85rem;
  border: 1px solid var(--border-color);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.data-table th {
  background: rgba(15, 23, 42, 0.75);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* QR Card Styling */
.qr-frame {
  background: #FFFFFF;
  border-radius: 1.25rem;
  padding: 1.25rem;
  display: inline-block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 4px solid #1E293B;
  position: relative;
}
.qr-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.45); }
}
.animate-glow {
  animation: pulseGlow 2.5s infinite;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
