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

:root {
  /* Ultra-Modern Fintech Palette */
  --primary: #00f2fe;
  --primary-hover: #4facfe;
  --secondary: #c471ed;
  --background: #050b14;
  --sidebar-bg: rgba(10, 15, 28, 0.85);
  --surface: rgba(16, 25, 43, 0.7);
  --surface-border: rgba(255, 255, 255, 0.05);
  --text-main: #f8fafc;
  --text-muted: #8b9bb4;
  
  /* Status Colors (Neon) */
  --success: #00f260;
  --warning: #f7b733;
  --danger: #fc4a1a;
  --info: #00c6ff;

  /* Glassmorphism */
  --glass-bg: rgba(16, 25, 43, 0.6);
  --glass-border: 1px solid rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  --blur: blur(20px);

  /* Spacing */
  /* Spacing */
  --radius-lg: 32px;
  --radius-md: 24px;
  --radius-sm: 16px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 242, 254, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(196, 113, 237, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; font-weight: 500; color: var(--text-muted); }

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.simple-header {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: var(--glass-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-bottom: 2rem;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.nav-brand h2 {
  margin: 0;
  font-size: inherit;
  line-height: 1;
}

.nav-brand i {
  color: var(--primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  font-size: 0.9rem;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.content-body {
  padding: 2.5rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Glass Card Component */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Inputs */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: rgba(15, 23, 42, 0.8);
}

/* Input Icon */
.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-with-icon .form-control {
  padding-left: 3rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Bento Grid Layout */
.bento-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.bento-item {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 2rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  overflow: hidden;
  position: relative;
}

.bento-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  opacity: 0.5;
}

.bento-overview { grid-column: span 12; }
.bento-profile { grid-column: span 4; display: flex; flex-direction: column; }
.bento-history { grid-column: span 8; }
.bento-charts { grid-column: span 12; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-auto-fit { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

@media (max-width: 1200px) {
  .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
  .bento-charts { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-5 { grid-template-columns: repeat(2, 1fr); }
  
  .bento-profile { grid-column: span 12; }
  .bento-history { grid-column: span 12; }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  
  .simple-header {
    padding: 0.75rem 0;
  }
  
  .header-container {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
  }
  
  .nav-links {
    width: 100%;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
  }
  
  .nav-item {
    flex: 1;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .nav-item span {
    display: none;
  }
  
  .nav-item i {
    font-size: 1.1rem;
    margin: 0;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .nav-actions .btn {
    padding: 0.5rem;
    flex: 1;
  }
  
  .user-badge {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .content-body { padding: 1.5rem 1rem; padding-bottom: 6rem; }
  
  .bento-item {
    padding: 1.25rem 1rem;
    min-width: 0;
    max-width: 100vw;
  }
  
  .table-container {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
  }
  
  .table-container table,
  .table-container tbody,
  .table-container tr,
  .table-container td {
    display: block;
    width: 100%;
  }
  
  .table-container thead {
    display: none;
  }
  
  .table-container tr {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    margin-bottom: 1rem;
    padding: 1rem;
  }
  
  .table-container td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
  }
  
  .table-container td:last-child {
    border-bottom: none;
  }
  
  .table-container td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    margin-right: 1rem;
    flex-shrink: 0;
  }
  
  .table-container td[data-label="Action"] {
    justify-content: center;
    padding-top: 1rem;
  }
  
  .table-container td[data-label="Action"]::before {
    display: none;
  }
  
  .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-5 { grid-template-columns: 1fr; }
  
  .bento-layout { display: flex; flex-direction: column; }
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loading Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  display: inline-block;
  margin-left: 0.5rem;
}

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

/* Footer & Legal Disclaimer */
.app-footer {
  background: rgba(10, 15, 28, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-disclaimer {
  background: rgba(245, 158, 11, 0.05);
  border-left: 4px solid var(--warning);
  padding: 1.5rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.footer-disclaimer h4 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-disclaimer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-credit {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-credit a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-credit a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--text-main);
}

.footer-nav .separator {
  color: rgba(255, 255, 255, 0.2);
}

.footer-copyright {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-nav {
    flex-wrap: wrap;
  }
}

/* Responsive Overview Grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Data Cards */
.stat-card {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(16, 25, 43, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.stat-icon.primary { color: var(--primary); background: rgba(0, 242, 254, 0.1); box-shadow: 0 0 15px rgba(0, 242, 254, 0.2); }
.stat-icon.success { color: var(--success); background: rgba(0, 242, 96, 0.1); box-shadow: 0 0 15px rgba(0, 242, 96, 0.2); }
.stat-icon.warning { color: var(--warning); background: rgba(247, 183, 51, 0.1); box-shadow: 0 0 15px rgba(247, 183, 51, 0.2); }
.stat-icon.info { color: var(--info); background: rgba(0, 198, 255, 0.1); box-shadow: 0 0 15px rgba(0, 198, 255, 0.2); }
.stat-icon.secondary { color: var(--secondary); background: rgba(196, 113, 237, 0.1); box-shadow: 0 0 15px rgba(196, 113, 237, 0.2); }

.stat-details h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-details .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  letter-spacing: -0.5px;
}

.stat-details .unit {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.4);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.6);
  white-space: nowrap;
}

td {
  padding: 1rem;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Consumer Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.info-item {
  background: rgba(15, 23, 42, 0.4);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-value {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
}

/* Charts Container */
.chart-wrapper {
  height: 300px;
  width: 100%;
  position: relative;
}

/* Full screen Loader */
.fullscreen-loader {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--background);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: opacity 0.5s ease;
}

.loader-hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 50px; height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border-bottom: var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand i {
  color: var(--primary);
  -webkit-text-fill-color: var(--primary);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
}

.modal-header h3 {
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
}

.modal-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.modal-detail-row:last-child {
  border-bottom: none;
}

.modal-detail-label {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.modal-detail-value {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.token-highlight {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: 1.5rem;
}

.token-highlight .label {
  font-size: 0.8rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.token-highlight .value {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-main);
}
