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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1f2937;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-cyan: #06b6d4;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --border-color: #374151;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glassmorphism Cards */
.glass-panel {
  background: rgba(31, 41, 55, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Radar Pulse Animation */
@keyframes radar-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 25px rgba(6, 182, 212, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
  }
}

.radar-glow {
  animation: radar-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

/* Flexy Arrival Blast Animation */
@keyframes blast-in {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(-20px);
  }
  60% {
    transform: scale(1.03) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.flexy-card-blast {
  animation: blast-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Claim Button Shine */
.btn-claim {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

.btn-claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5);
}

.btn-claim:active {
  transform: scale(0.97);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========================================== */
/* Excel-Style Spreadsheet Table Grid (FINTECH DENSE) */
/* ========================================== */
.excel-table-container {
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 10px;
  overflow-x: auto;
  background: #0f172a;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.4);
  -webkit-overflow-scrolling: touch;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.8125rem; /* 13px */
}

.excel-table thead tr {
  background: #090d16;
  border-bottom: 2px solid #10b981;
}

.excel-table th {
  color: #94a3b8;
  font-weight: 700;
  padding: 9px 12px;
  border-left: 1px solid rgba(51, 65, 85, 0.6);
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.excel-table th:last-child {
  border-left: none;
}

.excel-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  border-left: 1px solid rgba(51, 65, 85, 0.4);
  white-space: nowrap;
  vertical-align: middle;
}

.excel-table td:last-child {
  border-left: none;
}

.excel-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.4);
}

.excel-table tbody tr:nth-child(odd) {
  background: rgba(2, 6, 23, 0.6);
}

.excel-table tbody tr:hover {
  background: rgba(16, 185, 129, 0.12);
}

/* Compact Monospace Cells for Excel Grid */
.excel-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 640px) {
  .excel-table th, .excel-table td {
    padding: 7px 9px;
    font-size: 0.75rem;
  }
}

/* Smooth Render & Refresh Transitions (Zero Jitter) */
.fade-in {
  animation: fadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Table Reloading State */
.table-loading {
  opacity: 0.45;
  filter: blur(0.75px);
  pointer-events: none;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

/* Stat Cards Update Visual Feedback */
@keyframes card-update-flash {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 16px 2px rgba(16, 185, 129, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.stat-updated {
  animation: card-update-flash 0.55s ease-out;
}

/* Top Reloading Progress Bar */
#app-reloading-bar {
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-reloading-progress {
  will-change: width;
}

