/* trade_motion.css - Elite 21st.dev Skeleton Loaders & WebGL Container Queries */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
  --wib-brand: #C6E310;
  --wib-bear: #FF004D;
  --bg-deep: #0B0B0B;
  --glass-bg: rgba(11, 11, 11, 0.65);
  --glass-border: rgba(198, 227, 16, 0.15);
}

.trade-resources-container {
  display: grid;
  grid-template-columns: var(--sidebar-width, 320px) 1fr;
  grid-template-rows: 60vh 1fr;
  gap: 16px;
  height: 100%;
  width: 100%;
  padding: 16px;
  container-type: inline-size;
  container-name: tradeMatrix;
  font-family: 'Inter', sans-serif;
  color: #fff;
  background: var(--bg-deep);
  box-sizing: border-box;
}

@container tradeMatrix (max-width: 900px) {
  .trade-resources-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 50vh 40vh;
    overflow-y: auto;
  }
}

/* Glassmorphism Skeleton Loader */
.gl-skeleton-wrapper {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-deep);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

.gl-skeleton-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
}

.21st-loader {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: radial-gradient(circle at center, rgba(198, 227, 16, 0.05), transparent 70%);
  box-shadow: inset 0 0 20px rgba(198, 227, 16, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 2s infinite ease-in-out;
}

.21st-loader::after {
  content: '';
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--wib-brand);
  filter: blur(8px);
  animation: orbit 1.5s linear infinite;
}

/* Topography SVG Fallback */
.map-fallback {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><rect width="100%" height="100%" fill="%230B0B0B"/><path d="M10,50 Q100,10 150,70 T300,50" stroke="rgba(255,255,255,0.05)" fill="none" stroke-width="2"/></svg>');
  background-size: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.map-fallback.active {
  opacity: 1;
}

/* Hover Physics Tooltip */
.geo-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-deep);
  border: 1px solid var(--wib-brand);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 15px rgba(198, 227, 16, 0.2);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  color: #E2E8F0;
  z-index: 1000;
  opacity: 0;
  transform: translate(-50%, -100%) scale(0.95) translateY(-10px);
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
}

.geo-tooltip.visible {
  opacity: 1;
  transform: translate(-50%, -100%) scale(1) translateY(-15px);
}

.geo-tooltip-title {
  font-weight: 700;
  color: var(--wib-brand);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.geo-tooltip-metric {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.geo-tooltip-val {
  font-family: 'SF Mono', monospace;
  color: #fff;
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: inset 0 0 20px rgba(198, 227, 16, 0.05); }
  50% { box-shadow: inset 0 0 40px rgba(198, 227, 16, 0.2); }
}
@keyframes orbit {
  from { transform: rotate(0deg) translateX(40px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

@keyframes flash-bullish {
  0% { color: var(--wib-brand); text-shadow: 0 0 10px var(--wib-brand); }
  100% { color: inherit; text-shadow: none; }
}

@keyframes flash-bearish {
  0% { color: var(--wib-bear); text-shadow: 0 0 10px var(--wib-bear); }
  100% { color: inherit; text-shadow: none; }
}

.wib-flash-bull { animation: flash-bullish 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.wib-flash-bear { animation: flash-bearish 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

.flash-value {
  display: inline-block;
  font-family: 'SF Mono', ui-monospace, monospace;
  font-weight: 600;
  line-height: center;
}

/* Layout Wrappers */
.map-panel {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  background: var(--bg-deep);
}

.chart-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
  padding: 12px;
}

@container tradeMatrix (min-width: 901px) {
  .chart-panel {
    grid-column: 2;
  }
}

.sidebar-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(15, 15, 15, 0.8);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

@container tradeMatrix (max-width: 900px) {
  .sidebar-panel {
    grid-row: 1;
  }
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: border-color 0.2s;
}
.sidebar-item:hover {
  border-left-color: var(--wib-brand);
  background: rgba(255,255,255,0.05);
}

#map-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
}
