
/* =========================================
   CRYPTO TRADING PLATFORM
   Main Stylesheet
   Full UI + Binance Symbol Picker
========================================= */

/* =========================================
   1. GLOBAL THEME
========================================= */

:root {
  color-scheme: dark;

  --bg-main: #10141d;
  --bg-panel: #171e2a;
  --bg-sidebar: #141a25;
  --bg-toolbar: #171d29;

  --border: #293548;

  --text-main: #e6eaf2;
  --text-secondary: #8190a5;

  --accent: #70b7ff;
  --green: #00c087;
  --red: #f6465d;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-main);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;

  background: var(--bg-main);
  color: var(--text-main);

  font-family: Arial, "Microsoft JhengHei", sans-serif;
}

/* =========================================
   2. TOP HEADER
========================================= */

.topbar {
  height: 62px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 22px;

  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.status {
  color: var(--text-secondary);
  font-size: 12px;
}

.status-dot {
  display: inline-block;

  width: 8px;
  height: 8px;

  margin-right: 6px;

  border-radius: 50%;
  background: #e6a23c;
}

/* =========================================
   3. MAIN LAYOUT
========================================= */

.layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);

  min-height: calc(100vh - 62px);
}

/* =========================================
   4. SIDEBAR
========================================= */

.sidebar {
  background: var(--bg-sidebar);

  border-right: 1px solid var(--border);

  padding: 20px 14px;
}

.section-title {
  color: var(--text-secondary);

  font-size: 11px;
  letter-spacing: 1px;

  margin: 20px 10px 10px;
}

.nav-item {
  padding: 12px 11px;
  margin: 5px 0;

  border-radius: 6px;

  color: #b8c3d4;
  font-size: 14px;

  cursor: pointer;

  transition: background 0.2s;
}

.nav-item:hover {
  background: #202b3b;
}

.nav-item.active {
  background: #24344b;
  color: var(--accent);
}

.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================
   5. MAIN CONTENT
========================================= */

.main {
  min-width: 0;
  padding: 20px;
}

/* =========================================
   6. TOOLBAR
========================================= */

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 10px;
  margin-bottom: 18px;
}

.symbol {
  font-size: 21px;
  font-weight: bold;
  margin-right: 10px;
}

.market-tag {
  display: inline-block;

  font-size: 10px;

  color: var(--accent);
  background: #20334a;

  padding: 4px 6px;

  border-radius: 4px;
  vertical-align: middle;
}

/* =========================================
   7. SELECT & BUTTON
========================================= */

select,
button {
  background: #1b2432;

  color: #dce5f2;

  border: 1px solid #354256;
  border-radius: 5px;

  padding: 9px 12px;

  font: inherit;
}

select {
  cursor: pointer;
}

button {
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

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

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========================================
   8. SYMBOL PICKER
   Binance USDT Perpetual Symbol Selector
========================================= */

.symbol-picker {
  position: relative;

  display: inline-flex;
  align-items: center;

  z-index: 20;
}

.symbol-picker-button {
  display: flex;
  align-items: center;

  gap: 9px;

  min-height: 40px;
  padding: 7px 10px;

  background: #1b2432;

  border: 1px solid #354256;
  border-radius: 6px;

  color: var(--text-main);

  font-size: 17px;
  font-weight: bold;
}

.symbol-picker-button:hover,
.symbol-picker-button[aria-expanded="true"] {
  border-color: var(--accent);
  background: #202d40;
}

.symbol-picker-arrow {
  color: var(--text-secondary);

  font-size: 10px;
  margin-left: 3px;
}

/* =========================================
   9. SYMBOL PICKER DROPDOWN
========================================= */

.symbol-picker-panel {
  position: absolute;

  top: calc(100% + 9px);
  left: 0;

  width: 320px;
  max-width: calc(100vw - 30px);
  max-height: 440px;

  display: flex;
  flex-direction: column;

  background: #171e2a;

  border: 1px solid #354256;
  border-radius: 9px;

  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);

  overflow: hidden;

  z-index: 100;
}

.symbol-search-header {
  padding: 14px 14px 10px;

  color: var(--text-main);

  font-size: 13px;
  font-weight: bold;

  border-bottom: 1px solid var(--border);
}

.symbol-search-input {
  width: calc(100% - 24px);

  margin: 12px;
  padding: 11px 12px;

  background: #101722;

  border: 1px solid #354256;
  border-radius: 6px;

  color: var(--text-main);
  font-size: 13px;

  outline: none;
}

.symbol-search-input:focus {
  border-color: var(--accent);
}

.symbol-search-input::placeholder {
  color: #64738a;
}

.symbol-list-status {
  padding: 8px 13px;

  color: var(--text-secondary);

  font-size: 11px;
  line-height: 1.5;
}

.symbol-results {
  flex: 1;
  min-height: 0;

  overflow-y: auto;

  padding: 4px 7px 9px;
}

.symbol-result-item {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 11px 10px;
  margin-bottom: 2px;

  background: transparent;

  border: 1px solid transparent;
  border-radius: 5px;

  color: var(--text-main);

  text-align: left;
  cursor: pointer;
}

.symbol-result-item:hover {
  background: #24344b;
  border-color: #354b66;
}

.symbol-result-item.active {
  background: #20334a;
  border-color: #42658a;
}

.symbol-result-name {
  font-size: 13px;
  font-weight: bold;
}

.symbol-result-base {
  color: var(--text-secondary);
  font-size: 11px;
}

.symbol-empty {
  padding: 20px 12px;

  color: var(--text-secondary);

  font-size: 12px;
  text-align: center;
}

/* Symbol Picker Scrollbar */

.symbol-results::-webkit-scrollbar {
  width: 6px;
}

.symbol-results::-webkit-scrollbar-track {
  background: #141a25;
}

.symbol-results::-webkit-scrollbar-thumb {
  background: #354256;
  border-radius: 5px;
}

/* =========================================
   10. CHART PANEL
========================================= */

.chart-panel {
  position: relative;

  width: 100%;
  height: 500px;
  min-height: 430px;

  overflow: hidden;

  background: var(--bg-panel);

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

  padding: 0;

  text-align: left;
}

.price-chart {
  position: relative;

  width: 100%;
  height: 100%;

  min-width: 0;
  min-height: 430px;

  overflow: hidden;
}

.chart-status {
  position: absolute;

  z-index: 5;

  top: 12px;
  left: 12px;

  display: inline-block;

  padding: 8px 12px;

  background: rgba(15, 20, 30, 0.9);

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

  color: #e6a23c;

  font-size: 12px;

  pointer-events: none;
}

.chart-placeholder {
  color: var(--text-secondary);
  line-height: 2;
}

.chart-icon {
  color: var(--accent);
  font-size: 42px;
  margin-bottom: 12px;
}

.chart-placeholder strong {
  display: block;

  color: #dce5f2;

  font-size: 20px;
  margin-bottom: 8px;
}

.chart-placeholder p {
  margin: 8px 0;
}

.chart-description {
  font-size: 12px;
}

/* =========================================
   11. BOTTOM INFORMATION PANELS
========================================= */

.bottom-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 14px;
  margin-top: 16px;
}

.info-panel {
  background: var(--bg-panel);

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

  padding: 17px;

  min-height: 110px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 12px;
}

.info-panel h3 {
  margin: 0;

  font-size: 14px;
  color: #cbd6e5;
}

.info-panel p {
  margin: 0;

  color: #77869c;
  font-size: 12px;
}

.panel-tag {
  color: #77869c;

  font-size: 9px;
  letter-spacing: 0.5px;
}

/* =========================================
   12. NAVIGATION CONTENT
========================================= */

.navigation-view {
  min-height: 430px;

  padding: 32px;

  background: var(--bg-panel);

  border: 1px solid var(--border);
  border-radius: 9px;
}

.navigation-view h2 {
  margin: 0 0 16px;

  color: var(--text-main);
  font-size: 22px;
}

.navigation-view p {
  color: var(--text-secondary);

  font-size: 14px;
  line-height: 1.8;
}

.navigation-status {
  display: inline-block;

  margin-top: 20px;
  padding: 9px 13px;

  border: 1px solid #66512d;
  border-radius: 5px;

  background: #29251d;
  color: #e6a23c;

  font-size: 12px;
}

/* =========================================
   13. HIDDEN ELEMENTS
========================================= */

[hidden] {
  display: none !important;
}

/* =========================================
   14. TABLET & MOBILE
========================================= */

@media (max-width: 800px) {

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

  .sidebar {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .chart-panel {
    height: 400px;
    min-height: 350px;
  }

  .price-chart {
    min-height: 350px;
  }

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

  .toolbar {
    gap: 7px;
  }

  .symbol {
    width: 100%;
  }

  .symbol-picker {
    width: 100%;
  }

  .symbol-picker-button {
    width: 100%;
    justify-content: flex-start;
  }

  .symbol-picker-panel {
    width: 100%;
    max-width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }

  .navigation-view {
    min-height: 350px;
    padding: 20px;
  }
}

/* =========================================
   15. SMALL MOBILE
========================================= */

@media (max-width: 400px) {

  .brand {
    font-size: 16px;
  }

  select,
  button {
    padding: 8px;
    font-size: 12px;
  }

  .symbol-picker-button {
    font-size: 15px;
  }

  .symbol-picker-panel {
    max-height: 380px;
  }
}

/* =========================================
   16. FOOTER
========================================= */

.footer {
  display: flex;
  justify-content: space-between;

  margin-top: 25px;
  padding: 15px 0;

  border-top: 1px solid var(--border);

  color: #64738a;
  font-size: 10px;
}
