/**
 * ProCFX Ultra Modern Trading Terminal Stylesheet
 * High Frequency Forex, CFD & Crypto Trading UI
 */

:root {
  --procfx-trade-bg: #020712;
  --procfx-trade-card: rgba(7, 27, 53, 0.85);
  --procfx-trade-card-solid: #071b35;
  --procfx-trade-card-alt: rgba(3, 13, 28, 0.8);
  --procfx-trade-border: rgba(255, 255, 255, 0.08);
  --procfx-trade-border-active: rgba(0, 191, 255, 0.4);
  --procfx-green: #10b981;
  --procfx-green-glow: rgba(16, 185, 129, 0.3);
  --procfx-red: #ef4444;
  --procfx-red-glow: rgba(239, 68, 68, 0.3);
  --procfx-cyan: #00BFFF;
  --procfx-cyan-glow: rgba(0, 191, 255, 0.3);
}

/* Base Terminal Section */
.trading-section {
  background: var(--procfx-trade-bg) !important;
  min-height: calc(100vh - 70px);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.trading-section .custom--container {
  max-width: 1760px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Glassmorphism Card Utility */
.procfx-card {
  background: var(--procfx-trade-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

/* -------------------------------------------------------------
   1. TOP PAIR TICKER HEADER BAR
------------------------------------------------------------- */
.procfx-ticker-bar {
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  padding: 12px 18px;
  backdrop-filter: blur(14px);
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.procfx-pair-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(8, 102, 217, 0.3), rgba(0, 191, 255, 0.2));
  border: 1px solid var(--procfx-cyan);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.procfx-pair-avatar img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
}

.procfx-pair-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}

/* Pulsing Live Indicator */
.pulse-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--procfx-green);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-live 1.8s infinite;
  margin-right: 6px;
}

.pulse-indicator.closed {
  background-color: #f59e0b;
  box-shadow: 0 0 0 rgba(245, 158, 11, 0.7);
  animation: none;
}

@keyframes pulse-live {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.procfx-ticker-price {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: -0.5px;
  transition: color 0.3s ease, transform 0.2s ease;
}

.procfx-ticker-price.up {
  color: var(--procfx-green) !important;
}

.procfx-ticker-price.down {
  color: var(--procfx-red) !important;
}

.procfx-stat-box {
  display: flex;
  flex-direction: column;
}

.procfx-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.procfx-stat-value {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* -------------------------------------------------------------
   2. TRADING CHART PANEL
------------------------------------------------------------- */
.trading-chart-wrapper {
  background: var(--procfx-trade-card-solid);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  position: relative;
}

.trading-chart {
  height: 540px !important;
  min-height: 540px !important;
  background: #07172b !important;
}

@media (max-width: 991px) {
  .trading-chart {
    height: 420px !important;
    min-height: 420px !important;
  }
}

/* -------------------------------------------------------------
   3. ORDER PLACEMENT PANEL (BUY & SELL FORMS)
------------------------------------------------------------- */
.procfx-order-panel {
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Segmented Order Types Control */
.procfx-order-tabs {
  display: flex;
  background: rgba(3, 13, 28, 0.7);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--procfx-trade-border);
  margin-bottom: 14px;
}

.procfx-order-tab-btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.procfx-order-tab-btn:hover {
  color: #ffffff;
}

.procfx-order-tab-btn.active {
  background: rgba(8, 102, 217, 0.35);
  color: var(--procfx-cyan);
  box-shadow: 0 2px 8px rgba(0, 191, 255, 0.2);
  border: 1px solid rgba(0, 191, 255, 0.3);
}

/* Order Form Container */
.procfx-order-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 767px) {
  .procfx-order-forms-grid {
    grid-template-columns: 1fr;
  }
}

.procfx-order-side-card {
  background: rgba(3, 13, 28, 0.5);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 10px;
  padding: 14px;
  position: relative;
}

.procfx-order-side-card.buy-side {
  border-top: 2px solid var(--procfx-green);
}

.procfx-order-side-card.sell-side {
  border-top: 2px solid var(--procfx-red);
}

.procfx-wallet-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 10px;
}

.procfx-wallet-info .balance-value {
  color: #ffffff;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

/* Modern Input Groups */
.procfx-trade-input-group {
  position: relative;
  margin-bottom: 10px;
}

.procfx-trade-input-group .input-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}

.procfx-trade-input-group .input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  pointer-events: none;
  z-index: 2;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.procfx-trade-input {
  width: 100%;
  background: rgba(3, 13, 28, 0.85) !important;
  border: 1px solid var(--procfx-trade-border) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  font-family: ui-monospace, SFMono-Regular, monospace !important;
  padding: 8px 50px 8px 65px !important;
  transition: all 0.2s ease !important;
  text-align: right !important;
}

.procfx-trade-input:focus {
  border-color: var(--procfx-cyan) !important;
  box-shadow: 0 0 0 2px rgba(0, 191, 255, 0.15) !important;
  outline: none !important;
}

/* Percentage Pill Quick Selectors */
.procfx-percentage-pills {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.procfx-pct-pill {
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  user-select: none;
}

.procfx-pct-pill:hover,
.procfx-pct-pill.active {
  background: rgba(8, 102, 217, 0.3);
  color: var(--procfx-cyan);
  border-color: var(--procfx-cyan);
}

/* Solid Glowing Trade Execution Buttons */
.procfx-btn-buy {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.procfx-btn-buy:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
  transform: translateY(-1px);
}

.procfx-btn-sell {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.procfx-btn-sell:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5) !important;
  transform: translateY(-1px);
}

/* -------------------------------------------------------------
   4. ORDER BOOK PANEL WITH DEPTH BARS
------------------------------------------------------------- */
.procfx-orderbook-card {
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.procfx-orderbook-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--procfx-trade-border);
}

.procfx-orderbook-table-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 6px 12px;
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid var(--procfx-trade-border);
}

.procfx-orderbook-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, monospace;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}

.procfx-orderbook-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.procfx-depth-bar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
}

.procfx-depth-bar.ask {
  background: rgba(239, 68, 68, 0.15);
}

.procfx-depth-bar.bid {
  background: rgba(16, 185, 129, 0.15);
}

.procfx-mid-price-bar {
  padding: 8px 12px;
  background: rgba(3, 13, 28, 0.75);
  border-top: 1px solid var(--procfx-trade-border);
  border-bottom: 1px solid var(--procfx-trade-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* -------------------------------------------------------------
   5. MARKETS WATCHLIST PANEL
------------------------------------------------------------- */
.procfx-markets-card {
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.procfx-markets-search {
  position: relative;
  padding: 10px 14px;
  border-bottom: 1px solid var(--procfx-trade-border);
}

.procfx-markets-search input {
  width: 100%;
  background: rgba(3, 13, 28, 0.8) !important;
  border: 1px solid var(--procfx-trade-border) !important;
  border-radius: 6px !important;
  color: #fff !important;
  font-size: 12px !important;
  padding: 6px 10px 6px 30px !important;
}

.procfx-markets-search i {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 14px;
}

.procfx-pair-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.procfx-pair-item:hover,
.procfx-pair-item.active {
  background: rgba(8, 102, 217, 0.15);
  color: #ffffff;
}

/* -------------------------------------------------------------
   6. ACCOUNT TERMINAL DOCK & OPEN POSITIONS
------------------------------------------------------------- */
.procfx-terminal-positions-card {
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  margin-top: 14px;
}

.procfx-terminal-metrics-bar {
  background: rgba(3, 13, 28, 0.85);
  border-bottom: 1px solid var(--procfx-trade-border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.procfx-term-metric-item {
  display: flex;
  flex-direction: column;
}

.procfx-term-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.5px;
}

.procfx-term-metric-val {
  font-size: 13px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: #ffffff;
}

/* Positions Table */
.procfx-trade-table {
  width: 100%;
  margin-bottom: 0;
  color: #e2e8f0;
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 0;
}

.procfx-trade-table th {
  background: rgba(3, 13, 28, 0.6);
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  border-bottom: 1px solid var(--procfx-trade-border);
  font-weight: 700;
  white-space: nowrap;
}

.procfx-trade-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.procfx-trade-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Side Badges */
.procfx-side-pill-buy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--procfx-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.procfx-side-pill-sell {
  background: rgba(239, 68, 68, 0.15);
  color: var(--procfx-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

/* -------------------------------------------------------------
   7. MOBILE NAVIGATION TABS (< 1200px)
------------------------------------------------------------- */
.procfx-mobile-trade-nav {
  display: none;
  background: var(--procfx-trade-card);
  border: 1px solid var(--procfx-trade-border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

@media (max-width: 1199px) {
  .procfx-mobile-trade-nav {
    display: flex;
    gap: 4px;
  }
}

.procfx-mobile-tab-item {
  flex: 1;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.procfx-mobile-tab-item.active {
  background: rgba(8, 102, 217, 0.35);
  color: var(--procfx-cyan);
  border: 1px solid rgba(0, 191, 255, 0.3);
}

/* Mobile Quick Floating Buy/Sell Dock */
.procfx-mobile-quick-dock {
  display: none;
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: rgba(7, 27, 53, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--procfx-trade-border);
  padding: 10px 16px;
  z-index: 1025;
  gap: 12px;
}

@media (max-width: 991px) {
  .procfx-mobile-quick-dock {
    display: flex;
  }
  .trading-section {
    padding-bottom: calc(135px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* -------------------------------------------------------------
   8. ENHANCED CLOSE POSITION BUTTON & DARK MODAL STYLES
------------------------------------------------------------- */
.procfx-btn-close-action {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 5px 12px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
}

.procfx-btn-close-action:hover,
.procfx-btn-close-action:focus {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55) !important;
  transform: translateY(-1px);
}

.procfx-btn-close-action.is-profit {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

.procfx-btn-close-action.is-profit:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55) !important;
}

/* Institutional Dark Modal */
.procfx-modal-card {
  background: #081225 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 14px !important;
  color: #e2e8f0 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.1) !important;
}

.procfx-modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 16px 20px !important;
}

.procfx-modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #38bdf8;
}

.procfx-modal-body {
  padding: 20px !important;
}

.procfx-close-summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.procfx-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.procfx-summary-row .summary-label {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.procfx-summary-row .summary-value {
  color: #f1f5f9;
}

.procfx-info-badge {
  display: flex;
  align-items: flex-start;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

.procfx-modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 14px 20px !important;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.procfx-btn-modal-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.procfx-btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.procfx-btn-modal-confirm {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.procfx-btn-modal-confirm:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
  transform: translateY(-1px);
}

.procfx-trade-table th:last-child,
.procfx-trade-table td:last-child {
  position: sticky;
  right: 0;
  background: #040d1a;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.procfx-trade-table tr:hover td:last-child {
  background: #061426;
}

