/* ==========================================
   Payment Gateway — Design System
   ========================================== */

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

:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #22222f;
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);

  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;

  --accent-primary: #6c5ce7;
  --accent-primary-glow: rgba(108, 92, 231, 0.3);
  --accent-secondary: #00cec9;
  --accent-green: #00b894;
  --accent-green-glow: rgba(0, 184, 148, 0.3);
  --accent-red: #ff6b6b;
  --accent-red-glow: rgba(255, 107, 107, 0.3);
  --accent-orange: #fdcb6e;
  --accent-orange-glow: rgba(253, 203, 110, 0.3);
  --accent-blue: #74b9ff;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-success: linear-gradient(135deg, #00b894, #55efc4);
  --gradient-danger: linear-gradient(135deg, #e17055, #ff6b6b);
  --gradient-warning: linear-gradient(135deg, #fdcb6e, #ffeaa7);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-primary: 0 0 30px rgba(108, 92, 231, 0.15);
  --shadow-glow-green: 0 0 30px rgba(0, 184, 148, 0.15);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(108, 92, 231, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 206, 201, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   Typography
   ========================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
}

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

/* ==========================================
   Layout
   ========================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ==========================================
   Header / Navbar
   ========================================== */
.navbar {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: white;
  box-shadow: var(--shadow-glow-primary);
}

.navbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.navbar-title span {
  color: var(--accent-primary);
}

.navbar-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-glass);
  border: 1px solid var(--border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green-glow);
}

.status-dot.inactive {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red-glow);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ==========================================
   Stats Grid
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.purple::before { background: var(--gradient-primary); }
.stat-card.green::before { background: var(--gradient-success); }
.stat-card.red::before { background: var(--gradient-danger); }
.stat-card.orange::before { background: var(--gradient-warning); }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.stat-card.purple .stat-value { color: var(--accent-primary); }
.stat-card.green .stat-value { color: var(--accent-green); }
.stat-card.red .stat-value { color: var(--accent-red); }
.stat-card.orange .stat-value { color: var(--accent-orange); }

/* ==========================================
   Create Session Form
   ========================================== */
.create-section {
  margin: 24px 0;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition-normal);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 40px rgba(108, 92, 231, 0.25);
}

.btn-success {
  background: var(--gradient-success);
  color: #0a0a0f;
  box-shadow: var(--shadow-glow-green);
}

.btn-success:hover {
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
}

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

.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

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

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================
   Sessions Table
   ========================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table thead {
  background: rgba(255, 255, 255, 0.03);
}

.table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tr:hover td {
  background: var(--bg-glass-hover);
}

.table .session-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 500;
}

.table .amount {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* ==========================================
   Status Badges
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending {
  background: rgba(253, 203, 110, 0.1);
  color: var(--accent-orange);
  border: 1px solid rgba(253, 203, 110, 0.2);
}

.badge-success {
  background: rgba(0, 184, 148, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0, 184, 148, 0.2);
}

.badge-expired {
  background: rgba(255, 107, 107, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(255, 107, 107, 0.2);
}

/* ==========================================
   Checkout Page
   ========================================== */
.checkout-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.checkout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.checkout-header {
  background: var(--gradient-primary);
  padding: 32px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.checkout-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.checkout-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.checkout-amount {
  font-size: 48px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.checkout-amount .currency {
  font-size: 28px;
  font-weight: 600;
  vertical-align: top;
  margin-right: 2px;
}

.checkout-body {
  padding: 28px;
}

.checkout-timer {
  text-align: center;
  margin-bottom: 24px;
}

.timer-value {
  font-size: 36px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-orange);
}

.timer-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.timer-expired .timer-value {
  color: var(--accent-red);
}

.checkout-info {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.checkout-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checkout-info-row:last-child {
  border-bottom: none;
}

.checkout-info-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.checkout-info-value {
  font-size: 14px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.copy-btn:hover {
  background: var(--accent-primary-glow);
}

.checkout-upi-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: var(--transition-normal);
  margin-bottom: 12px;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.checkout-upi-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-primary-glow);
}

.checkout-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 12px;
}

.checkout-note strong {
  color: var(--accent-orange);
}

/* Success overlay */
.checkout-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.checkout-success-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-green);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  max-width: 380px;
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-glow-green);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.success-checkmark {
  width: 72px;
  height: 72px;
  background: var(--gradient-success);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px var(--accent-green-glow);
}

.expired-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient-danger);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px var(--accent-red-glow);
}

/* ==========================================
   Filters
   ========================================== */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* ==========================================
   Toast Notification
   ========================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastSlide 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.toast.success {
  border-left: 3px solid var(--accent-green);
}

.toast.error {
  border-left: 3px solid var(--accent-red);
}

.toast.info {
  border-left: 3px solid var(--accent-primary);
}

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

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 500;
}

/* ==========================================
   Loading Spinner
   ========================================== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .form-group { min-width: 100%; }
  .navbar .container { padding: 0 16px; }
  .stat-value { font-size: 24px; }
  .table { font-size: 13px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .checkout-amount { font-size: 36px; }
}

/* ==========================================
   Tabs
   ========================================== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-glow-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* ==========================================
   Code Blocks (API Docs)
   ========================================== */
.code-block {
  display: block;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent-green);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0;
}

code.code-block {
  color: var(--accent-blue);
  font-size: 14px;
  padding: 10px 16px;
}

/* ==========================================
   Select Input
   ========================================== */
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}
