/* DarkPentra CSS Enhancements — Additive only */

/* Price flash animations */
@keyframes flash-green { 0% { background: rgba(16,185,129,0.3); } 100% { background: transparent; } }
@keyframes flash-red { 0% { background: rgba(239,68,68,0.3); } 100% { background: transparent; } }
.price-up { animation: flash-green 0.8s ease-out; }
.price-down { animation: flash-red 0.8s ease-out; }

/* Tabular numbers for prices */
.price, .stat-value, .market-table td, .price-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Skeleton loading states */
.skeleton {
  background: linear-gradient(90deg, rgba(17,17,40,0.7) 25%, rgba(139,92,246,0.08) 50%, rgba(17,17,40,0.7) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  height: 20px;
  margin: 8px 0;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Sidebar active indicator */
.nav-item { position: relative; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: linear-gradient(135deg, #8B5CF6, #06B6D4);
  border-radius: 0 3px 3px 0;
}

/* Agent status pulse */
.agent-status-live { position: relative; }
.agent-status-live::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse-dot 2s infinite;
  box-shadow: 0 0 8px #10B981;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Gradient border hover on cards */
.card {
  position: relative;
  transition: all 0.3s, border-color 0.3s;
}
.card:hover {
  border-color: rgba(139,92,246,0.4);
  box-shadow: 0 0 30px rgba(139,92,246,0.1);
}

/* Feature card icon gradient (landing page) */
.feature-icon i {
  font-size: 2rem;
  background: linear-gradient(135deg, #8B5CF6, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Notification bell */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 8px;
  color: #94A3B8;
  transition: color 0.2s;
}
.notification-bell:hover { color: #8B5CF6; }
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notification-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: #111128;
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
}
.notification-dropdown.open { display: block; }
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(139,92,246,0.2);
  font-weight: 600;
  font-size: 14px;
}
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  color: #94A3B8;
  transition: background 0.2s;
  cursor: pointer;
}
.notif-item:hover { background: rgba(139,92,246,0.08); }
.notif-item .notif-time { font-size: 11px; color: #64748B; margin-top: 4px; }
.notif-empty { padding: 40px 16px; text-align: center; color: #64748B; font-size: 13px; }

/* Export buttons */
.export-buttons { display: flex; gap: 8px; margin-left: auto; }
.export-buttons .btn i { margin-right: 4px; }

/* Treemap Heatmap */
.treemap-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
}
.treemap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
}
.treemap-cell:hover { transform: scale(1.02); z-index: 2; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.treemap-cell .symbol { font-size: 16px; font-weight: 800; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.treemap-cell .change { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9); margin-top: 2px; }
.treemap-cell .mcap { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.treemap-cell:first-child { grid-row: 1 / 3; }
.treemap-up-4 { background: #047857; }
.treemap-up-3 { background: #059669; }
.treemap-up-2 { background: #10B981; }
.treemap-up-1 { background: #34D399; }
.treemap-neutral { background: #374151; }
.treemap-down-1 { background: #F87171; }
.treemap-down-2 { background: #EF4444; }
.treemap-down-3 { background: #DC2626; }
.treemap-down-4 { background: #991B1B; }

@media (max-width: 768px) {
  .treemap-container { grid-template-columns: 1fr 1fr; height: auto; }
  .treemap-cell:first-child { grid-row: auto; grid-column: 1 / 3; min-height: 100px; }
  .treemap-cell { min-height: 70px; }
}

/* Theme toggle button */
.theme-toggle {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(139,92,246,0.2);
  color: #94A3B8;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s;
}
.theme-toggle:hover { background: rgba(139,92,246,0.15); color: #8B5CF6; border-color: #8B5CF6; }

/* Light theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(139, 92, 246, 0.05);
  --border-glass: rgba(139, 92, 246, 0.15);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] body { background: #f8fafc; color: #1e293b; }
[data-theme="light"] body::before { opacity: 0.3; }
[data-theme="light"] .sidebar { background: #ffffff; border-color: rgba(139,92,246,0.1); }
[data-theme="light"] nav { background: rgba(255,255,255,0.95); }
[data-theme="light"] .card,
[data-theme="light"] .stat-card,
[data-theme="light"] .feature-card,
[data-theme="light"] .price-card,
[data-theme="light"] .testimonial,
[data-theme="light"] .faq-item { background: rgba(255,255,255,0.9); border-color: rgba(139,92,246,0.1); }
[data-theme="light"] .nav-item { color: #475569; }
[data-theme="light"] .nav-item.active { color: #8B5CF6; }
[data-theme="light"] .market-table td { border-color: rgba(0,0,0,0.05); color: #1e293b; }
[data-theme="light"] .market-table th { color: #64748b; }
[data-theme="light"] .market-table tr:hover { background: rgba(139,92,246,0.03); }
[data-theme="light"] .notification-dropdown { background: #ffffff; border-color: rgba(139,92,246,0.15); }
[data-theme="light"] .chat-main, [data-theme="light"] .chat-sidebar { background: rgba(255,255,255,0.9); }
[data-theme="light"] .chat-input input { background: rgba(0,0,0,0.03); color: #1e293b; }
