/* Namespace all styles to the plugin */
.team-trader * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

.team-trader body,
.team-trader {
  background: #f9fafb; /* light background */
  color: #111827; /* dark text for contrast */
  padding-bottom: 40px;
}

/* Header */
.team-trader .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border-bottom: 1px solid #d1d5db;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.team-trader .logo {
  font-size: 22px;
  font-weight: bold;
  color: #3b82f6; /* primary color accent */
}

.team-trader .user-panel button {
  background: #3b82f6; /* primary color */
  border: none;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  margin-left: 10px;
  cursor: pointer;
  font-weight: bold;
}

/* Dashboard Tabs */
.team-trader .dashboard-tabs {
  display: flex;
  overflow-x: auto;
  background: #e5e7eb; /* light gray tabs background */
}

.team-trader .dashboard-tabs button {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  color: #111827;
  cursor: pointer;
  font-weight: 500;
}

.team-trader .dashboard-tabs button.active {
  border-bottom: 3px solid #3b82f6; /* primary color accent */
}

/* Budget Panel */
.team-trader .budget-panel {
  display: flex;
  gap: 10px;
  padding: 12px;
  flex-wrap: wrap;
}

.team-trader .budget-card {
  background: #ffffff;
  padding: 14px;
  border-radius: 8px;
  text-align: center;
  flex: 1 1 30%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.team-trader .budget-card span {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.team-trader .budget-card strong {
  font-size: 18px;
  color: #3b82f6;
}

/* Metrics Grid */
.team-trader .metrics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.team-trader .metric {
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  flex: 1 1 45%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Trade Controls */
.team-trader .trade-controls {
  display: flex;
  gap: 10px;
  padding: 12px;
  flex-wrap: wrap;
}

.team-trader .primary-btn {
  background: #3b82f6;
  border: none;
  padding: 12px 16px;
  color: #ffffff;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

/* Table */
.team-trader .table-container {
  overflow-x: auto;
  padding: 12px;
}

.team-trader table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.team-trader th,
.team-trader td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.team-trader .profit {
  color: #22c55e; /* green */
}

.team-trader .loss {
  color: #ef4444; /* red */
}

/* Modals */
.team-trader .modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow-y: auto; /* allow scroll */
  padding: 20px;
}

.team-trader .modal.active {
  display: flex;
}

.team-trader .modal-content {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh; /* ensure modal does not exceed screen height */
  overflow-y: auto; /* scrollable content */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Modal Inputs */
.team-trader .modal input,
.team-trader .modal textarea,
.team-trader .modal select {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
}

.team-trader .modal button {
  margin-top: 8px;
}

/* Responsive Metrics */
@media (min-width: 768px) {
  .team-trader .metric { flex: 1 1 30%; }
}

@media (min-width: 1024px) {
  .team-trader .metric { flex: 1 1 22%; }
}