body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #570988;
  color: #f3efef;
  overflow-x: hidden;
}

/* Top image stays fine */
.top-right-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: auto;
}

/* Controls area */
.controls_chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 100%;
  overflow-x: auto;
}

.controls_chart .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Hide extra toggles by default */
#optIterRow, #riskParams, #indicatorToggles {
  display: none;
}

/* Buttons */
#runBtn, #tvBtn {
  background-color: silver;
  color: #000;
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  display: inline-block;
  width: auto;
  transition: background-color 0.3s ease;
}

/* Glow effect */
.custom-glow {
  background-color: #28a745 !important;
  color: white !important;
  border: none;
  box-shadow: 0 0 10px #28a74580;
  transition: all 0.3s ease-in-out;
}
.custom-glow:hover {
  background-color: #2ecc71 !important;
  box-shadow: 0 0 20px #2ecc71cc, 0 0 40px #2ecc71cc;
  transform: translateY(-2px) scale(1.02);
}

/* Responsive buttons */
@media (max-width: 768px) {
  #runBtn, #tvBtn {
    width: 100%;
  }
}

/* Chart containers */
#equityChart, #container {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 400px;
  background-color: #131722;
  overflow: hidden;
}

/* Legend */
#container > .legend {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 100;
  pointer-events: none;
}

.fixed-header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: black;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    padding: 10px 20px;
    z-index: 1000;
    gap: 10px;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-center {
    flex: 1;
    justify-content: center;
}

.hamburger {
    display: none;
    font-size: 30px;
    cursor: pointer;
}

/* MOBILE MENU INITIALLY HIDDEN */
.mobile-menu {
    display: none;
}

/* MOBILE BEHAVIOR */
@media (max-width: 768px) {
    .header-center, .header-right {
        display: none;
    }
    .hamburger {
        display: block;
    }
    .mobile-menu {
        display: none;
        flex-direction: column;
        align-items: center;
        background: rgba(0,0,0,0.95);
        position: absolute;
        top: 60px;
        right: 20px;
        padding: 20px;
        border-radius: 8px;
        gap: 15px;
        z-index: 2000;
    }
    .mobile-menu.show {
        display: flex;
    }
    .mobile-menu a, .mobile-menu button, .mobile-menu form {
        width: 100%;
        text-align: center;
    }
}

/* Dashboard flex layout */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  align-items: flex-start; 
}

/* Summary + trades boxes */
.summary, .trades {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 8px;
  flex: 1 1 100%; /* stack on small screens */
}

/* Table style */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
th, td {
  padding: 8px;
  border-bottom: 1px solid #333;
}
th { color: #ffa500; }
.highlight { color: lime; font-weight: bold; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
        align-items: center;
    }

    .dashboard .summary,
    .dashboard .trades {
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
    }

    /* Ensure sidebar stays full width on top */
    .sidebar {
        width: 100%;
    }
}
