/* ==========================================================================
   KARYENT TRADE - DIVISION STYLESHEET
   Dedicated styling, tokens, maritime grid, and global commerce components
   for the Karyent Trade Division.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TRADE DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  --trade-primary: #0284C7;
  --trade-hover: #38BDF8;
  --trade-surface: rgba(2, 132, 199, 0.08);
  --trade-glow: rgba(2, 132, 199, 0.28);
  --trade-gold: #D97706;
  --trade-gold-hover: #F59E0B;
}

/* --------------------------------------------------------------------------
   2. TRADE MARITIME GRID PATTERN
   -------------------------------------------------------------------------- */
.bg-grid-trade {
  background-size: 36px 36px;
  background-image: 
    linear-gradient(to right, rgba(2, 132, 199, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(2, 132, 199, 0.12) 1px, transparent 1px);
}

/* --------------------------------------------------------------------------
   3. MARITIME LOGISTICS & SHIPPING CORRIDORS
   -------------------------------------------------------------------------- */
.corridor-badge {
  transition: all 0.2s ease-in-out;
}

.corridor-badge:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 0 16px -2px rgba(2, 132, 199, 0.2);
}

/* --------------------------------------------------------------------------
   4. TRADE ACTION BUTTONS
   -------------------------------------------------------------------------- */
.btn-trade-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 55%, #0369A1 100%);
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px -3px rgba(2, 132, 199, 0.45), inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  line-height: 1.25rem;
}

.btn-trade-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}

.btn-trade-primary:hover {
  background: linear-gradient(135deg, #7DD3FC 0%, #38BDF8 55%, #0284C7 100%);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 30px -4px rgba(2, 132, 199, 0.7), 0 0 15px rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
}

.btn-trade-primary:hover::before {
  left: 100%;
}

.btn-trade-primary:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn-trade-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(2, 132, 199, 0.12) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(2, 132, 199, 0.35);
  color: #E2E8F0 !important;
  box-shadow: 0 4px 20px -4px rgba(2, 132, 199, 0.25), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  line-height: 1.25rem;
}

.btn-trade-glass:hover {
  border-color: rgba(56, 189, 248, 0.7);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(2, 132, 199, 0.22) 100%);
  color: #FFFFFF !important;
  box-shadow: 0 8px 25px -4px rgba(56, 189, 248, 0.4), inset 0 1px 2px 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-trade-glass:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn-trade-primary:focus-visible,
.btn-trade-glass:focus-visible {
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   5. TRADE GLASSMORPHISM CARD & PANEL SYSTEM
   -------------------------------------------------------------------------- */
.trade-glass-card {
  position: relative;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.035) 0%, rgba(10, 25, 47, 0.7) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow, border-color;
}

.trade-glass-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  opacity: 0.6;
  transition: opacity 0.3s ease, left 0.3s ease, right 0.3s ease;
  pointer-events: none;
}

.trade-glass-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 24px 48px -12px rgba(2, 132, 199, 0.3), 0 0 25px rgba(56, 189, 248, 0.12), inset 0 1px 2px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.trade-glass-card:hover::before {
  opacity: 1;
  left: 5%;
  right: 5%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.9), transparent);
}

.trade-glass-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 25, 47, 0.85) 0%, rgba(6, 16, 32, 0.95) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.65), inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
}

.trade-glass-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), transparent);
  pointer-events: none;
}

/* Glass Stat Pods */
.trade-glass-stat {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(10, 25, 47, 0.65) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.45), inset 0 1px 1px 0 rgba(255, 255, 255, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow, border-color;
}

.trade-glass-stat:hover {
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 16px 36px -8px rgba(2, 132, 199, 0.35), 0 0 20px rgba(56, 189, 248, 0.15), inset 0 1px 2px 0 rgba(255, 255, 255, 0.18) !important;
  transform: translateY(-4px) !important;
}

/* Glass Badges */
.trade-glass-badge {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.trade-glass-badge:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(2, 132, 199, 0.16);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

/* --------------------------------------------------------------------------
   6. MARITIME SPEC MANIFEST FLOAT & GLOW
   -------------------------------------------------------------------------- */
@keyframes vesselFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.trade-vessel-float {
  animation: vesselFloat 6s ease-in-out infinite;
}

.trade-vessel-float:hover {
  animation-play-state: paused;
}

/* --------------------------------------------------------------------------
   7. CLEAN 2-WAY EXIM SEGMENT SELECTOR & COMMODITY PILLS
   -------------------------------------------------------------------------- */
.exim-segment-tab {
  background: transparent;
  color: #94A3B8;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.exim-segment-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #F8FAFC;
}

/* Active Export Tab (Emerald / Origin Supply) */
.exim-segment-tab.is-active-export {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.08) 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.3), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.exim-segment-tab.is-active-export .exim-tab-dot {
  background-color: #34D399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.9);
}

.exim-segment-tab.is-active-export .exim-tab-indicator {
  opacity: 1 !important;
  background-color: rgba(52, 211, 153, 0.15) !important;
  color: #6EE7B7 !important;
  border-color: rgba(52, 211, 153, 0.3) !important;
}

/* Active Import Tab (Sky / Cyan Procurement) */
.exim-segment-tab.is-active-import {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.22) 0%, rgba(56, 189, 248, 0.08) 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 4px 20px -2px rgba(2, 132, 199, 0.35), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.exim-segment-tab.is-active-import .exim-tab-dot {
  background-color: #38BDF8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.9);
}

.exim-segment-tab.is-active-import .exim-tab-indicator {
  opacity: 1 !important;
  background-color: rgba(56, 189, 248, 0.15) !important;
  color: #7DD3FC !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
}

/* Legacy & Shared Trade Intent Buttons */
.trade-intent-btn {
  background: transparent;
  color: #94A3B8;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.trade-intent-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #F8FAFC;
}

.trade-intent-btn.active-intent {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(56, 189, 248, 0.12) 100%);
  color: #FFFFFF !important;
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 20px -2px rgba(2, 132, 199, 0.3), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

.trade-intent-btn.is-active-export {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.08) 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.3), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.trade-intent-btn.is-active-import {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(56, 189, 248, 0.12) 100%) !important;
  color: #FFFFFF !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  box-shadow: 0 4px 20px -2px rgba(2, 132, 199, 0.35), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.commodity-tag {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  cursor: pointer;
}

.commodity-tag:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.55) !important;
  color: #38BDF8 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.commodity-tag.is-selected {
  background: rgba(56, 189, 248, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  color: #38BDF8 !important;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.3);
}

/* --------------------------------------------------------------------------
   8. COMMODITY TICKER & MARKET SPREADS RIBBON
   -------------------------------------------------------------------------- */
@keyframes tickerSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.trade-ticker-wrapper {
  overflow: hidden;
  position: relative;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-ticker-track {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  width: max-content !important;
  animation: tickerSlide 45s linear infinite;
}

.trade-ticker-track:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  gap: 0.6rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  transition: all 0.25s ease;
  cursor: pointer;
}

.ticker-item:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  border-right-color: rgba(56, 189, 248, 0.35);
  color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   9. INSTITUTIONAL ASSAY SPEC TABLES
   -------------------------------------------------------------------------- */
.assay-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  margin: 0.1rem -0.6rem;
  border-radius: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.assay-spec-row:hover {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.3);
  padding-left: 0.85rem;
  transform: translateX(4px);
}

.assay-spec-row:last-child {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   10. INDUSTRY-STANDARD EXIM INTAKE FORM & MANIFEST TOKENS
   -------------------------------------------------------------------------- */
.trade-form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.trade-form-input:hover:not(:focus) {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(255, 255, 255, 0.04);
}

.trade-form-input::placeholder {
  color: #64748B;
  font-size: 0.8125rem;
}

.trade-form-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.7);
  background-color: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
}

.trade-form-input.has-error {
  border-color: rgba(244, 63, 94, 0.8) !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2) !important;
}

.trade-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #CBD5E1;
  margin-bottom: 0.45rem;
}

.trade-form-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
}

.trade-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 0.375rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  font-weight: 800;
  background: rgba(2, 132, 199, 0.18);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.trade-manifest-terminal {
  background: linear-gradient(180deg, rgba(8, 18, 36, 0.95) 0%, rgba(4, 11, 22, 0.98) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.7), inset 0 1px 1px 0 rgba(255, 255, 255, 0.12);
}

.manifest-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.45rem 0.5rem;
  margin: 0.05rem -0.5rem;
  border-radius: 0.375rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.manifest-row:hover {
  background: rgba(255, 255, 255, 0.04);
  padding-left: 0.75rem;
}

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

