/* ==================== SANDBOX TRADING DASHBOARD ==================== */
/* Binance-Inspired Pro Dashboard with Dark Theme & Gold Accents */

:root {
  --bg-primary: #0f0f23;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #16213e;
  --glass-bg: rgba(26, 26, 46, 0.6);
  --accent-gold: #f0ad4e;
  --accent-primary: #3861fb;
  --accent-success: #05b26c;
  --accent-danger: #f6465d;
  --accent-warning: #f0ad4e;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1a9;
  --text-muted: #71717a;
  --border-color: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==================== HEADER & NAVIGATION ==================== */
.header {
  background: linear-gradient(135deg, rgba(15, 15, 35, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(56, 97, 251, 0.3);
}

.brand > div:last-child {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--accent-gold);
}

.nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(240, 173, 78, 0.1);
  color: var(--accent-gold);
}

/* ==================== TRANSPARENCY BADGE ==================== */
.sandbox-badge {
  background: rgba(240, 173, 78, 0.15);
  color: var(--accent-gold);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid var(--accent-gold);
  margin-right: 12px;
}

/* ==================== CONTAINER & LAYOUT ==================== */
.container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.widget-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.widget-span-2 {
  grid-column: span 2;
}

@media (max-width: 1200px) {
  .widget-span-2 {
    grid-column: span 1;
  }
}

/* ==================== CARDS & WIDGETS ==================== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(240, 173, 78, 0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(56, 97, 251, 0.15);
  color: var(--accent-primary);
  font-weight: 600;
}

/* ==================== STAT DISPLAYS ==================== */
.stat-box {
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}

.stat-change {
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.stat-change.positive {
  color: var(--accent-success);
}

.stat-change.negative {
  color: var(--accent-danger);
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #2d4ac8 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 97, 251, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 97, 251, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #d89b3f 100%);
  color: #0f0f23;
  font-weight: 700;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(240, 173, 78, 0.3);
}

.btn-success {
  background: var(--accent-success);
  color: #fff;
}

.btn-success:hover {
  background: #049d5c;
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #e03450;
}

.btn-secondary {
  background: rgba(240, 173, 78, 0.1);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.btn-secondary:hover {
  background: rgba(240, 173, 78, 0.2);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(240, 173, 78, 0.1);
  background: rgba(30, 30, 50, 0.7);
}

.input::placeholder {
  color: var(--text-muted);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1a9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 18px;
  padding-right: 32px;
}

/* ==================== PRICE TICKER ==================== */
.ticker {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
}

.ticker-item {
  flex-shrink: 0;
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  min-width: 140px;
  text-align: center;
  transition: all 0.3s ease;
}

.ticker-item:hover {
  border-color: var(--accent-gold);
  background: rgba(240, 173, 78, 0.05);
}

.ticker-symbol {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
}

.ticker-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 6px 0;
  font-family: 'Courier New', monospace;
}

.ticker-change {
  font-size: 12px;
  font-weight: 600;
}

.ticker-change.positive {
  color: var(--accent-success);
}

.ticker-change.negative {
  color: var(--accent-danger);
}

/* ==================== CHART CONTAINER ==================== */
.chart-container {
  background: rgba(30, 30, 50, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container canvas {
  max-height: 300px;
  width: 100% !important;
}

/* ==================== ORDER BOOK ==================== */
.order-book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.order-book-side {
  font-size: 12px;
}

.order-book-header {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.order-book-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  align-items: center;
}

.order-book-price {
  color: var(--text-primary);
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.order-book-size {
  color: var(--text-secondary);
  text-align: right;
}

.buy-price {
  color: var(--accent-success);
}

.sell-price {
  color: var(--accent-danger);
}

/* ==================== POSITIONS & HOLDINGS ==================== */
.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.positions-table thead {
  border-bottom: 1px solid var(--border-color);
}

.positions-table th {
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 10px 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.positions-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.positions-table tr:hover {
  background: rgba(240, 173, 78, 0.05);
}

.symbol-cell {
  font-weight: 700;
  color: var(--accent-gold);
}

.pnl-positive {
  color: var(--accent-success);
  font-weight: 600;
}

.pnl-negative {
  color: var(--accent-danger);
  font-weight: 600;
}

/* ==================== SENTIMENT GAUGE ==================== */
.sentiment-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sentiment-meter {
  background: rgba(30, 30, 50, 0.5);
  border-radius: 8px;
  padding: 12px;
}

.sentiment-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
}

.sentiment-bar {
  width: 100%;
  height: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.sentiment-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-danger), var(--accent-success));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  transition: width 0.3s ease;
}

/* ==================== PORTFOLIO PIE ==================== */
.portfolio-pie {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  position: relative;
}

.pie-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 12px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==================== ANIMATIONS ==================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(240, 173, 78, 0.3);
  }
  50% {
    box-shadow: 0 0 16px rgba(240, 173, 78, 0.5);
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.pulse {
  animation: pulse 2s infinite;
}

.glow-accent {
  animation: glow 3s ease-in-out infinite;
}

.animate-in {
  animation: slide-in 0.3s ease-out;
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ==================== STATUS INDICATORS ==================== */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.active {
  background: var(--accent-success);
  animation: pulse 2s infinite;
}

.status-dot.inactive {
  background: var(--accent-danger);
}

.status-dot.warning {
  background: var(--accent-warning);
  animation: pulse 1.5s infinite;
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 100%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 40%;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(15, 15, 35, 0.95);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 9999;
  animation: slide-in 0.3s ease-out;
  max-width: 400px;
}

.toast.success {
  border-left: 3px solid var(--accent-success);
}

.toast.error {
  border-left: 3px solid var(--accent-danger);
}

.toast.warning {
  border-left: 3px solid var(--accent-warning);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .widget-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .container {
    padding: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 12px;
  }

  .ticker {
    gap: 8px;
  }

  .ticker-item {
    min-width: 120px;
  }

  .order-book {
    grid-template-columns: 1fr;
  }
}

/* ==================== SANDBOX/QA INDICATORS ==================== */
.qa-indicator {
  background: rgba(240, 173, 78, 0.1);
  border: 1px solid var(--accent-gold);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 12px;
}

.mock-label {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
