/* style.css - Custom Styling from CertainStats globals.css */

:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #121318;
  --bg-panel: rgba(18, 19, 24, 0.7);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.15);

  --text-primary: #ffffff;
  --text-secondary: #9496a1;
  --text-muted: #5e606a;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.4);

  --status-online: #10b981;
  --status-offline: #ef4444;
  --status-warning: #f59e0b;

  --glass-bg: rgba(18, 19, 24, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);

  --bar-bg: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;

  --spec-indigo-bg: rgba(99, 102, 241, 0.12);
  --spec-indigo-border: rgba(99, 102, 241, 0.25);
  --spec-indigo-color: #818cf8;

  --spec-green-bg: rgba(16, 185, 129, 0.12);
  --spec-green-border: rgba(16, 185, 129, 0.25);
  --spec-green-color: #34d399;

  --spec-blue-bg: rgba(14, 165, 233, 0.12);
  --spec-blue-border: rgba(14, 165, 233, 0.25);
  --spec-blue-color: #38bdf8;

  --spec-amber-bg: rgba(245, 158, 11, 0.12);
  --spec-amber-border: rgba(245, 158, 11, 0.25);
  --spec-amber-color: #fbbf24;
}

[data-theme='light'] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-panel: rgba(255, 255, 255, 0.8);
  --border-color: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-glow: rgba(99, 102, 241, 0.15);

  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.05);

  --bar-bg: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

  --spec-indigo-bg: rgba(79, 70, 229, 0.08);
  --spec-indigo-border: rgba(79, 70, 229, 0.2);
  --spec-indigo-color: #4f46e5;

  --spec-green-bg: rgba(16, 185, 129, 0.08);
  --spec-green-border: rgba(16, 185, 129, 0.2);
  --spec-green-color: #10b981;

  --spec-blue-bg: rgba(14, 165, 233, 0.08);
  --spec-blue-border: rgba(14, 165, 233, 0.2);
  --spec-blue-color: #0284c7;

  --spec-amber-bg: rgba(217, 119, 6, 0.08);
  --spec-amber-border: rgba(217, 119, 6, 0.2);
  --spec-amber-color: #d97706;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 10% 40%, rgba(99, 102, 241, 0.04), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.03), transparent 30%);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Precise transitions on specific elements (avoiding SVG charts/tooltips) */
body,
main,
.card,
.spec-tile,
.odometer-tile,
button,
.status-pill,
.progress-bar {
  transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
}

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

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

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

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

/* Base Elements */
a {
  color: inherit;
  text-decoration: none;
}

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

/* Layout Utilities */
.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.flex-1 { flex: 1; }

/* Text Utilities */
.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.text-2xl { font-size: 32px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }

.font-sans { font-family: var(--font-sans); }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

/* Components */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: var(--transition-normal);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 13px;
  transition: var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
}

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

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes pulse-glow-micro {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
    box-shadow: 0 0 10px currentColor;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
}

/* Sleek Revamped Agent Details Styles */
.detail-hero {
  background: radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.08) 0%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.01) 100%), var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 100%);
}

.spec-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  width: 100%;
}

.spec-tile {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
}

.spec-tile:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.spec-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spec-tile-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spec-tile-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.spec-tile-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.spec-tile-value.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: -0.2px;
}

/* Odometer Modern Panel */
.odometer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  width: 100%;
}

.odometer-tile {
  background: rgba(255, 255, 255, 0.025);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.2s ease;
}

.odometer-tile:hover {
  background: rgba(255, 255, 255, 0.05);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.22);
}

.odometer-label-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.odometer-values {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Modern Status Tag */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--status-online);
}

.status-pill.offline {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--status-offline);
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-pill.online .status-dot-pulse {
  animation: pulse-glow-micro 2s infinite;
}

/* Demo banner styles */
.demo-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--status-warning);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.demo-banner button {
  background: var(--status-warning);
  color: #000;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  transition: opacity var(--transition-fast);
}

.demo-banner button:hover {
  opacity: 0.9;
}

/* Grid Charts */
.grid-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 16px;
  width: 100%;
}

@media (max-width: 768px) {
  .grid-charts {
    grid-template-columns: 1fr;
  }
  .spec-tile-grid {
    grid-template-columns: 1fr;
  }
  .odometer-grid {
    grid-template-columns: 1fr;
  }
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* Custom time picker styles matching CertainStats detail page */
.time-picker-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}

.time-picker-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 260px;
  border-radius: 16px;
  padding: 16px;
  z-index: 100;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-range-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.time-range-option {
  padding: 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  text-align: center;
  background: var(--bar-bg);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.time-range-option.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.time-range-option:hover {
  transform: scale(1.05);
}

/* Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spinner {
  animation: spin 1s linear infinite;
}

/* Force live grid into 6 columns on desktops */
#live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  width: 100%;
}

@media (min-width: 1024px) {
  #live-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
}

/* Custom ApexCharts overrides to match CertainStats premium dark/light tooltips */
.apexcharts-canvas {
  background: transparent !important;
}
.apexcharts-tooltip {
  background: var(--bg-panel) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px !important;
  box-shadow: var(--card-shadow) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
}
.apexcharts-tooltip-title {
  background: rgba(0, 0, 0, 0.2) !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  font-weight: 700 !important;
}
.apexcharts-tooltip-text {
  color: var(--text-primary) !important;
}
.apexcharts-tooltip-series-group {
  background: transparent !important;
}
.apexcharts-xaxistooltip, .apexcharts-yaxistooltip {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 4px !important;
}

