/* ============================================
   INSTITUTIONAL FX DASHBOARD - PREMIUM DESIGN
   ============================================ */

/* Typography - Tabular numerals for price alignment */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --liquidity-green: #10b981;
  --liquidity-red: #ef4444;
  --liquidity-amber: #f59e0b;
  --info-blue: #3b82f6;
  --bg-card: rgba(15, 23, 42, 0.6);
  --bg-card-hover: rgba(15, 23, 42, 0.85);
  --border-subtle: rgba(71, 85, 105, 0.25);
  --border-active: rgba(59, 130, 246, 0.4);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

/* Grid Layout - Responsive institutional grid */
.fractal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 0;
}

/* Card Container - Glassmorphism with depth */
.fractal-card {
  position: relative;
  background: linear-gradient(135deg, rgb(50 63 96 / 70%) 0%, rgba(30, 41, 59, 0.5) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.fractal-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(59, 130, 246, 0.1);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.7) 100%);
}

/* Top accent line - subtle institutional touch */
.fractal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    var(--liquidity-green) 0%, 
    var(--info-blue) 50%, 
    var(--liquidity-red) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fractal-card:hover::before {
  opacity: 0.6;
}

/* ============================================
   HERO SECTION - Pair name + Current price
   ============================================ */

.fx-card-hero {
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid rgba(71, 85, 105, 0.15);
}

.fx-pair-name {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-vol-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

.fx-vol-badge.high {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.fx-vol-badge.low {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.fx-beta-badge {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 2px;
  margin-left: 6px;
  background: rgba(251, 191, 36, 0.1);
  color: rgba(251, 191, 36, 0.7);
  opacity: 0.8;
}

.fx-regime-badge {
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 2px;
  margin-left: 6px;
  opacity: 0.7;
}

.fx-regime-badge.trend {
  background: rgba(59, 130, 246, 0.1);
  color: rgba(59, 130, 246, 0.8);
}

.fx-regime-badge.range {
  background: rgba(139, 92, 246, 0.1);
  color: rgba(139, 92, 246, 0.8);
}

.fx-regime-badge.compressed {
  background: rgba(245, 158, 11, 0.1);
  color: rgba(245, 158, 11, 0.8);
}

.fx-price-container {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.fx-current-price {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-liquidity-bias {
  font-size: 18px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.fx-liquidity-bias.bullish {
  color: var(--liquidity-green);
}

.fx-liquidity-bias.bearish {
  color: var(--liquidity-red);
}

.fx-liquidity-bias.neutral {
  color: var(--text-muted);
}

.fractal-card:hover .fx-liquidity-bias {
  opacity: 0.7;
}

.fx-price-delta {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.fx-delta-icon {
  font-size: 12px;
  opacity: 0.8;
}

.fx-delta-value {
  font-weight: 500;
}

.fx-price-delta.positive {
  color: var(--liquidity-green);
}

.fx-price-delta.negative {
  color: var(--liquidity-red);
}

.fx-price-delta.neutral {
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   LIQUIDITY TARGETS - Primary focus area
   ============================================ */

.fx-liquidity-targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: linear-gradient(90deg, 
    rgba(16, 185, 129, 0.05) 0%, 
    rgba(71, 85, 105, 0.1) 50%, 
    rgba(239, 68, 68, 0.05) 100%);
  padding: 0;
}

.fx-liquidity-block {
  padding: 16px;
  background: rgba(15, 23, 42, 0.4);
  position: relative;
  transition: all 0.3s ease;
}

.fx-liquidity-block:not(.empty) {
  animation: liquidity-pulse 4s ease-in-out infinite;
}

@keyframes liquidity-pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.15);
  }
}

.fx-liquidity-block:hover {
  background: rgba(15, 23, 42, 0.6);
}

.fx-liquidity-block.high {
  border-left: 3px solid var(--liquidity-green);
}

.fx-liquidity-block.low {
  border-left: 3px solid var(--liquidity-red);
}

.fx-liquidity-block.non-fx {
  border-left-color: var(--liquidity-amber);
  opacity: 0.95;
}

.fx-liquidity-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fx-liq-icon {
  font-size: 11px;
  opacity: 0.7;
}

.fx-liquidity-price {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.fx-liquidity-distance {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}

.fx-pip-prefix {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.6;
}

.fx-pip-value {
  font-weight: 700;
}

.fx-liquidity-distance.high {
  color: var(--liquidity-green);
}

.fx-liquidity-distance.low {
  color: var(--liquidity-red);
}

/* ============================================
   SECONDARY LEVELS - Collapsible chips
   ============================================ */

.fx-secondary-levels {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(71, 85, 105, 0.1);
}

.fx-levels-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s ease;
}

.fx-levels-header:hover {
  color: var(--text-secondary);
}

.fx-levels-toggle {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.fx-levels-header.collapsed .fx-levels-toggle {
  transform: rotate(0deg);
}

.fx-levels-header:not(.collapsed) .fx-levels-toggle {
  transform: rotate(90deg);
}

.fx-levels-grid {
  display: grid;
  gap: 6px;
}

.fx-levels-grid::-webkit-scrollbar {
  width: 4px;
}

.fx-levels-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.fx-levels-grid::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 2px;
}

.fx-levels-grid.collapsed {
  display: none;
}

.fx-level-chip {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-size: 12px;
  transition: all 0.2s ease;
}

.fx-level-chip.high {
  border-left-color: var(--liquidity-green);
}

.fx-level-chip.low {
  border-left-color: var(--liquidity-red);
}

.fx-level-chip.active {
  background: rgba(59, 130, 246, 0.08);
  border-left-width: 3px;
  animation: subtle-pulse 3s ease-in-out infinite;
}

@keyframes subtle-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
  }
  50% {
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
  }
}

.fx-level-chip.broken {
  opacity: 0.45;
  background: rgba(107, 114, 128, 0.08);
  border-left-color: rgba(107, 114, 128, 0.3);
  border-left-width: 1px;
}

.fx-level-chip.broken .fx-level-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 400;
}

.fx-level-price {
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  text-align: left;
}

.fx-level-distance {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: right;
}

.fx-level-chip.active .fx-level-distance {
  color: var(--info-blue);
  font-weight: 700;
}

.fx-broken-collapse {
  padding: 6px 10px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  font-style: italic;
}

.fx-level-status {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 2px;
  text-align: center;
}

.fx-level-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--liquidity-green);
}

.fx-level-status.broken {
  background: rgba(107, 114, 128, 0.1);
  color: rgba(107, 114, 128, 0.7);
  font-weight: 500;
}

/* ============================================
   FOOTER META - Volatility & timestamp
   ============================================ */

.fx-card-footer {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(71, 85, 105, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.fx-volatility-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.fx-volatility-hint .icon {
  font-size: 12px;
}

.fx-last-update {
  font-size: 9px;
  opacity: 0.7;
}



/* ============================================
   SPARKLINE - Subtle price history
   ============================================ */

.fx-sparkline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  opacity: 0.08;
  pointer-events: none;
}

.fx-sparkline svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
  .fractal-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .fractal-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .fx-current-price {
    font-size: 28px;
  }
  
  .fx-liquidity-price {
    font-size: 18px;
  }
  
  .fx-card-hero {
    padding: 16px 16px 12px 16px;
  }
  
  .fx-liquidity-block {
    padding: 12px;
  }
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.fx-card-loading {
  opacity: 0.5;
  pointer-events: none;
}

.fx-card-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.1) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.fractal-card:focus {
  outline: 2px solid var(--info-blue);
  outline-offset: 2px;
}

.fx-levels-header:focus {
  outline: 1px solid var(--info-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .fractal-card,
  .fx-liquidity-block,
  .fx-level-chip,
  .fx-levels-toggle {
    transition: none;
  }
  
  .fx-level-chip.active,
  .fx-liquidity-block:not(.empty) {
    animation: none;
  }
  
  .fx-card-loading::after {
    animation: none;
  }
}
