:root {
  --bg: #0f172a;
  --card: #111827;
  --border: #1f2933;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
}

h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  background: linear-gradient(
    135deg,
    #38bdf8,
    #6366f1
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 28px 0 6px 24px;
}

h2 {
  font-size: 24px;        
  color: #7fc8ff;                
  margin-bottom: 14px;
}

p {
  font-size: 16px;        
  color: #ffffff;
  margin-bottom: 14px;
  margin-left: 20px;
}

.license-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#licenseStatus {
  order: -1;
}

#userId {
  margin-left: auto;
}

/* MODE badge */
#licenseStatus {
  order: -1;               
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #1e293b, #020617);
  color: #7dd3fc;
  border: 1px solid rgba(56,189,248,0.35);
  box-shadow:
    0 0 0 1px rgba(56,189,248,0.15),
    0 0 12px rgba(56,189,248,0.25);
  white-space: nowrap;
}


.license-row input,
.license-row button {
  width: auto;
}

#licenseStatus {
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

section {
  margin-left: 24px;
  margin-right: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 24px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 24px;
  margin-bottom: 14px;
  margin-top: 24px;
}

label { 
  display: block; 
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.demo {
  background: #1e293b;
  color: var(--muted);
}

.badge.pro {
  background: var(--success);
  color: #022c22;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}

button {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #020617;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow:
    0 0 0 rgba(56, 189, 248, 0.0);
}

button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.6),
    0 0 24px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: scale(0.97);
  box-shadow:
    0 0 8px rgba(56, 189, 248, 0.8);
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #020617;
}

button.danger:hover {
  box-shadow:
    0 0 12px rgba(239, 68, 68, 0.6),
    0 0 24px rgba(249, 115, 22, 0.4);
}

button.primary {
  background: var(--accent);
  color: #fff9bb;
  border: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background:
    linear-gradient(180deg, #020617, #020617),
    linear-gradient(135deg, transparent 50%, var(--muted) 50%),
    linear-gradient(225deg, transparent 50%, var(--muted) 50%);
  background-repeat: no-repeat;
  background-size:
    100% 100%,
    6px 6px,
    6px 6px;
  background-position:
    0 0,
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 42px 10px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

select:hover {
  border-color: var(--accent);
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select option {
  background: #020617;
  color: var(--text);
}

input {
  background: linear-gradient(180deg, #020617, #020617);
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 10px;

  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  width: 120px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

input:hover {
  border-color: #334155;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

input:focus-visible {
  transform: translateY(-1px);
}

input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

input.success {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

/* ===== Bar Chart Container – Dark Analytics Style ===== */
.chart-box {
  position: relative;
  background:
    radial-gradient(
      circle at top left,
      rgba(56, 189, 248, 0.08),
      transparent 60%
    ),
    linear-gradient(180deg, #020617, #020617);

  border: 1px solid #1e293b;
  border-radius: 14px;

  padding: 14px 16px 16px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 8px 24px rgba(2, 6, 23, 0.8);

  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Hover elevation (subtle, pro) */
.chart-box:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgb(255, 255, 255),
    0 14px 40px rgba(2, 6, 23, 0.95);
}

/* Chart title */
.chart-box h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #7dd3fc;
  margin-bottom: 10px;
}

/* Select above bar charts */
.chart-box select {
  width: 40%;
  margin-bottom: 12px;
}

/* Scroll area under bars */
.chart-scroll {
  position: relative;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.6),
    rgba(2, 6, 23, 0.6)
  );

  border-radius: 10px;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Fade edges (gives depth to bar area) */
.chart-scroll::before,
.chart-scroll::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  pointer-events: none;
  z-index: 2;
}

.chart-scroll::before {
  top: 0;
  background: linear-gradient(180deg, #020617, transparent);
}

.chart-scroll::after {
  bottom: 0;
  background: linear-gradient(0deg, #020617, transparent);
}

/* Canvas styling */
.chart-box canvas {
  background: transparent;
  border-radius: 8px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-scroll {
  height: 410px;    
  overflow: hidden;
}

/* ===== Pro Trading Table ===== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}

/* Header */
thead th {
  background: linear-gradient(180deg, #020617, #020617);
  color: #c7d2fe;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

/* Body cells */
tbody td {
  padding: 12px 10px;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

/* Zebra rows (very subtle) */
tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.015);
}

/* Hover row */
tbody tr:hover {
  background: rgba(56,189,248,0.08);
  transition: background 0.2s ease;
}

/* First column (index) */
tbody td:first-child {
  color: #94a3b8;
  font-weight: 500;
}

/* Balance column emphasis */
tbody td:nth-child(7) {
  font-weight: 600;
  color: #e5e7eb;
}

/* Profit & Risk */
tbody td:nth-child(9) {
  color: #e5e7eb;
  font-weight: 600;
}

tbody td:nth-child(8) {
  color: #e5e7eb;
}

/* Result badges (text-based) */
tbody td:nth-child(10) {
  font-weight: 600;
}

tbody td:nth-child(10):contains("Stop") {
  color: #ef4444;
}

/* Reason muted */
tbody td:nth-child(11) {
  color: var(--muted);
  font-size: 12px;
}

/* Action buttons */
td button {
  background: transparent;
  border: 1px solid var(--border);
  color: #c7d2fe;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

td button:hover {
  background: rgba(99,102,241,0.15);
  border-color: #6366f1;
  color: #ffffff;
}

/* Delete button */
td button:last-child:hover {
  background: rgba(239,68,68,0.2);
  border-color: #ef4444;
  color: #fff;
}

/* Mobile friendly */
@media (max-width: 900px) {
  table {
    font-size: 12px;
  }

  thead th {
    padding: 10px 8px;
  }

  tbody td {
    padding: 10px 8px;
  }
}

.trade-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

#addTrade {
  margin-left: auto;
}

/* ===== Center Alignment – Pro Table ===== */

table thead th,
table tbody td {
  text-align: center;
  vertical-align: middle;
}

/* Vertical & Horizontal Grid Lines */
thead th,
tbody td {
  border-right: 1px solid rgba(255,255,255,0.06);
}

thead th:last-child,
tbody td:last-child {
  border-right: none;
}

tbody tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

table {
  border: 1px solid rgba(56,189,248,0.35);
}

table thead th:last-child,
table tbody td:last-child {
  width: 120px;
  text-align: center;
}

tbody tr:nth-child(even) {
  background: rgba(56,189,248,0.035);
}


/* ===== Overall Performance – Distinct Pro Style ===== */

.overall-table {
  max-width: 520px;
  margin-top: 10px;
}

.overall-table td:first-child {
  text-align: left;
  padding-left: 16px;

  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #c7d2fe;
}

.overall-table td:last-child {
  text-align: center;

  font-size: 13px;
  font-weight: 800;
  color: #e5e7eb;
}

.overall-table tr {
  height: 48px;
}

.overall-table tr:hover {
  background: rgba(56,189,248,0.06);
}

h1 + p {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;

  color: #9ca3af;

  margin-left: 26px;
  margin-bottom: 22px;

  position: relative;
}
h1 + p::after {
  content: "";
  display: block;
  width: 64px;
  height: 2px;
  margin-top: 10px;

  background: linear-gradient(
    90deg,
    #38bdf8,
    transparent
  );
  border-radius: 2px;
}

.balance-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance-row input {
  max-width: 220px;
}

.balance-actions {
  margin-left: auto;   
  display: flex;
  gap: 12px;
}

#tradesTable .td-reason {
  color: #e5e7eb;
  font-size: 13px;
}

.info-btn {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.info-btn:hover {
  background: #222222;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #05001d;
  color: #ddd;
  width: 420px;
  max-width: 90%;
  border-radius: 8px;
  border: 1px solid #0b0062;
  padding: 16px;
  font-size: 13px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}

.close-btn:hover {
  color: #fff;
}

.license-section h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
}

.license-section ul {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
}

.license-section li {
  margin-bottom: 4px;
}

.license-section li.disabled {
  color: #ff6363;
}

.license-section li.enabled {
  color: #ffffff;
}

.limit {
  font-size: 12px;
  color: #69a2ff;
}

.unlimit {
  font-size: 12px;
  color: #69a2ff;
}

hr {
  border: none;
  border-top: 1px solid #333;
  margin: 12px 0;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #000721;   
  
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;

  padding-right: 36px;

  color: #eee;
  border: 1px solid #595198;
  border-radius: 6px;
}

.secondary-btn {
  background: linear-gradient(135deg, #00053a, #0003a1);
  color: #a0c1ff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow:
    0 0 0 rgba(255, 255, 255, 0);
}
