/**
 * ==========================================
 * 🔥 ADVANCED ORDER TYPES - CSS
 * Feature 13.3 - Pro Trading
 * ==========================================
 * 
 * Styles for:
 * - Trailing Stop
 * - Market on Close (MOC)
 * - Iceberg
 * - VWAP
 * - OCO (One-Cancels-Other)
 */

/* ==========================================
   Order Type Tabs - Two-row layout for Pro
   ========================================== */
.order-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Pro Order Section Divider */
.order-type-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  margin: 6px 0 2px;
}

.order-type-divider::before,
.order-type-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e0e0e0);
}

.order-type-divider-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-color, #f59e0b);
  white-space: nowrap;
}

/* Pro badge on tabs */
.order-type-tab .pro-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-color, #f59e0b);
  margin-left: 4px;
  vertical-align: top;
}

/* ==========================================
   Trailing Stop Fields
   ========================================== */
.trailing-stop-group {
  display: none;
}

.trailing-stop-group.visible {
  display: block;
}

.trailing-input-wrapper {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.trailing-input-wrapper .price-input-wrapper {
  flex: 1;
}

.trailing-type-select {
  width: 80px;
  padding: 10px 8px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  background: var(--card-bg, #fff);
  color: var(--text-color, #333);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.trailing-type-select:focus {
  outline: none;
  border-color: var(--primary-color, #2563eb);
}

.trailing-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--info-bg, #eff6ff);
  border-radius: 6px;
  font-size: 12px;
  color: var(--info-color, #3b82f6);
}

.trailing-info svg {
  flex-shrink: 0;
}

/* ==========================================
   MOC (Market on Close) Info
   ========================================== */
.moc-info-group {
  display: none;
}

.moc-info-group.visible {
  display: block;
}

.moc-info-card {
  padding: 12px;
  background: var(--info-bg, #eff6ff);
  border: 1px solid var(--info-border, #bfdbfe);
  border-radius: 8px;
  margin-bottom: 4px;
}

.moc-info-card .moc-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-color, #333);
  margin-bottom: 4px;
}

.moc-info-card .moc-desc {
  font-size: 12px;
  color: var(--text-muted, #666);
  line-height: 1.5;
}

.moc-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--warning-bg, #fffbeb);
  border: 1px solid var(--warning-border, #fde68a);
  border-radius: 6px;
  font-size: 12px;
  color: var(--warning-color, #d97706);
}

.moc-warning svg {
  flex-shrink: 0;
}

/* ==========================================
   Iceberg Order Fields
   ========================================== */
.iceberg-group {
  display: none;
}

.iceberg-group.visible {
  display: block;
}

.iceberg-qty-wrapper {
  display: flex;
  gap: 10px;
}

.iceberg-qty-wrapper .form-group {
  flex: 1;
  margin-bottom: 0;
}

.iceberg-qty-wrapper .form-label {
  font-size: 12px;
}

.iceberg-progress {
  margin-top: 8px;
}

.iceberg-progress-bar {
  height: 6px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 3px;
  overflow: hidden;
}

.iceberg-progress-fill {
  height: 100%;
  background: var(--primary-color, #2563eb);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.iceberg-progress-label {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted, #666);
}

.iceberg-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--info-bg, #eff6ff);
  border-radius: 6px;
  font-size: 12px;
  color: var(--info-color, #3b82f6);
}

/* ==========================================
   OCO (One-Cancels-Other) Fields
   ========================================== */
.oco-group {
  display: none;
}

.oco-group.visible {
  display: block;
}

.oco-pair-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oco-leg {
  padding: 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  background: var(--card-bg, #fff);
}

.oco-leg-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.oco-leg-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.oco-leg-badge.take-profit {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.oco-leg-badge.stop-loss {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.oco-leg-label {
  font-size: 12px;
  color: var(--text-muted, #666);
}

.oco-leg .price-input-wrapper {
  margin-top: 4px;
}

.oco-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted, #999);
  font-size: 11px;
  font-weight: 500;
}

.oco-connector-line {
  flex: 1;
  height: 1px;
  background: var(--border-color, #ddd);
}

.oco-info {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--info-bg, #eff6ff);
  border-radius: 6px;
  font-size: 12px;
  color: var(--info-color, #3b82f6);
  line-height: 1.5;
}

.oco-info svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================
   Order Type Badges (for Orders page)
   ========================================== */
.oms-badge.trailing_stop {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.oms-badge.moc {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.oms-badge.iceberg {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.oms-badge.oco {
  background: rgba(236, 72, 153, 0.1);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

/* ==========================================
   Order Card: Advanced Type Extra Info
   ========================================== */
.oms-order-advanced-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color, #e5e7eb);
}

.oms-advanced-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-muted, #666);
}

.oms-advanced-tag svg {
  width: 12px;
  height: 12px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 480px) {
  .trailing-input-wrapper {
    flex-direction: column;
  }
  
  .trailing-type-select {
    width: 100%;
  }
  
  .iceberg-qty-wrapper {
    flex-direction: column;
  }
  
  .oco-pair-container {
    gap: 8px;
  }
  
  .oco-leg {
    padding: 10px;
  }
}
