/* @section:terminal - Bloomberg-style terminal grid with TradingView */

/* Terminal Page */
#page-terminal {
  padding: 16px;
  background: #fff;
  min-height: calc(100vh - 60px);
}

/* Terminal Header */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.terminal-header h1 {
  font-size: var(--t-2xl);
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.terminal-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.terminal-add input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: var(--t-md);
  font-weight: 600;
  font-family: inherit;
  text-transform: uppercase;
  width: 120px;
  background: #fff;
  color: #1e293b;
}

.terminal-add input:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.terminal-add input::placeholder {
  color: #94a3b8;
}

.terminal-add button {
  padding: 8px 16px;
  background: #818cf8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: var(--t-md);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.terminal-add button:hover {
  background: #6366f1;
}

/* Terminal Grid */
.terminal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

/* Panel */
.terminal-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 280px;
}

/* Panel Header */
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

/* Drag Handle */
.panel-drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: var(--t-lg);
  letter-spacing: -2px;
  user-select: none;
  padding: 0 4px;
  transition: color 0.15s;
}

.panel-drag-handle:hover {
  color: #64748b;
}

.panel-drag-handle:active {
  cursor: grabbing;
}

/* Sortable States */
.panel-ghost {
  opacity: 0.4;
  background: #e0e7ff;
  border: 2px dashed #818cf8;
}

.panel-chosen {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.panel-drag {
  opacity: 0.9;
}

.panel-ticker {
  font-size: var(--t-md);
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
}

.panel-timeframes {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.tf-btn {
  padding: 3px 8px;
  font-size: var(--t-xs);
  font-weight: 600;
  font-family: inherit;
  color: #64748b;
  background: #e2e8f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.tf-btn:hover {
  background: #cbd5e1;
  color: #475569;
}

.tf-btn.active {
  background: #1e293b;
  color: #fff;
}

.panel-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: var(--t-xl);
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  line-height: 1;
  transition: color 0.15s;
}

.panel-close:hover {
  color: #ef4444;
}

/* TradingView Container */
.panel-tv-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.panel-tv-container .tradingview-widget-container {
  height: 100% !important;
}

.panel-tv-container .tradingview-widget-container__widget {
  height: 100% !important;
}

/* Empty State */
.terminal-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
}

.terminal-empty p {
  font-size: var(--t-lg);
  margin: 0;
}

/* Terminal Status */
.terminal-status {
  font-size: var(--t-sm);
  color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
  .terminal-grid {
    grid-template-columns: 1fr;
  }

  .terminal-panel {
    height: 260px;
  }

  .terminal-add input {
    width: 80px;
  }
}
