/* ============================================================
   CRYPTO CHART APP STYLES (Poocoin color theme)
   ============================================================
   Poocoin palette:
     --bg-darkest:  #191B1F  (main background)
     --bg-dark:     #212429  (panels, sidebars)
     --bg-card:     #2C2F36  (cards, header, elevated surfaces)
     --bg-input:    #40444F  (inputs, dropdowns)
     --border:      #2C2F36  (subtle borders)
     --border-lite: #40444F  (stronger borders)
     --text-primary:   #C3C5CB  (body text)
     --text-secondary: #6C7284  (muted/label text)
     --text-bright: #FFFFFF  (headings, prices)
     --accent:      #2172E5  (links, active tabs)
     --green:       #27AE60  (buy, positive)
     --red:         #EB5757  (sell, negative)
     --yellow:      #F3BA2F  (BSC/star accent)
   ============================================================ */

.crypto-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #191B1F;
  color: #C3C5CB;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  overflow: hidden;
}

/* ── Header Bar (Token name + Search) ─────────────────────── */

.crypto-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #212429;
  border-bottom: 1px solid #2C2F36;
  flex-shrink: 0;
}

.crypto-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.crypto-header-left .crypto-token-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.crypto-header-left .crypto-token-name {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crypto-token-pair-label {
  font-size: 12px;
  color: #6C7284;
  white-space: nowrap;
}

.crypto-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.crypto-search-wrapper {
  position: relative;
  width: 220px;
}

.crypto-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  background: #40444F;
  border: 1px solid #2C2F36;
  border-radius: 4px;
  color: #C3C5CB;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.crypto-search-input:focus {
  border-color: #2172E5;
}

.crypto-search-input::placeholder {
  color: #6C7284;
}

.crypto-chain-select {
  padding: 6px 8px;
  background: #40444F;
  border: 1px solid #2C2F36;
  border-radius: 4px;
  color: #C3C5CB;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  min-width: 90px;
}

.crypto-chain-select option {
  background: #2C2F36;
  color: #C3C5CB;
}

.crypto-fav-btn {
  padding: 4px 8px;
  background: none;
  border: none;
  color: #6C7284;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.crypto-fav-btn:hover {
  color: #F3BA2F;
}

.crypto-fav-btn.active {
  color: #F3BA2F;
}

/* ── Search Results Dropdown ────────────────────────────────── */

.crypto-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #2C2F36;
  border: 1px solid #40444F;
  border-top: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  border-radius: 0 0 4px 4px;
}

.crypto-search-results.visible {
  display: block;
}

.crypto-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #40444F;
}

.crypto-search-result-item:hover {
  background: #40444F;
}

.crypto-search-result-item:last-child {
  border-bottom: none;
}

.crypto-result-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #40444F;
  flex-shrink: 0;
}

.crypto-result-info {
  flex: 1;
  min-width: 0;
}

.crypto-result-name {
  font-weight: 600;
  font-size: 13px;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crypto-result-pair {
  font-size: 11px;
  color: #6C7284;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crypto-result-price {
  text-align: right;
  flex-shrink: 0;
}

.crypto-result-price-value {
  font-weight: 600;
  font-size: 13px;
  color: #FFFFFF;
}

.crypto-result-chain {
  font-size: 10px;
  color: #6C7284;
  text-transform: uppercase;
}

/* ── 3-Column Body ─────────────────────────────────────────── */

.crypto-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left Sidebar ──────────────────────────────────────────── */

.crypto-left-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #191B1F;
  border-right: 1px solid #2C2F36;
}

.crypto-left-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: #6C7284;
  font-size: 12px;
  padding: 16px;
  text-align: center;
}

.crypto-price-section {
  padding: 12px 14px;
  border-bottom: 1px solid #2C2F36;
}

.crypto-price {
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.crypto-price-change {
  font-size: 13px;
  font-weight: 600;
}

.crypto-price-change.positive {
  color: #27AE60;
}

.crypto-price-change.negative {
  color: #EB5757;
}

.crypto-left-section {
  padding: 10px 14px;
  border-bottom: 1px solid #2C2F36;
}

.crypto-left-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6C7284;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.crypto-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.crypto-stat-row:last-child {
  margin-bottom: 0;
}

.crypto-stat-label {
  color: #6C7284;
  font-size: 11px;
}

.crypto-stat-value {
  font-weight: 600;
  font-size: 12px;
  color: #C3C5CB;
}

/* ── Left sidebar links ───────────────────────────────────── */

.crypto-left-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crypto-left-link {
  display: block;
  padding: 5px 8px;
  color: #2172E5;
  text-decoration: none;
  font-size: 12px;
  border-radius: 3px;
  transition: background 0.15s;
}

.crypto-left-link:hover {
  background: #2C2F36;
  color: #5090EE;
}

/* ── Center Column (Chart + Transactions) ─────────────────── */

.crypto-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.crypto-chart-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.crypto-chart-container {
  flex: 1;
  min-height: 200px;
  background: #131722;
  position: relative;
  overflow: hidden;
}

.crypto-chart-container iframe {
  width: 100%;
  height: calc(100% + 30px);
  border: none;
}

.crypto-chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6C7284;
  gap: 12px;
}

.crypto-chart-placeholder-icon {
  font-size: 48px;
  opacity: 0.5;
}

.crypto-chart-placeholder-text {
  font-size: 14px;
}

/* ── Right Sidebar ─────────────────────────────────────────── */

.crypto-right-sidebar {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #212429;
  border-left: 1px solid #2C2F36;
}

.crypto-right-section {
  padding: 12px 14px;
}

.crypto-right-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6C7284;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* ── Favorites ─────────────────────────────────────────────── */

.crypto-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crypto-fav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
}

.crypto-fav-item:hover {
  background: #2C2F36;
}

.crypto-fav-item-name {
  font-weight: 600;
  color: #FFFFFF;
}

.crypto-fav-item-chain {
  color: #6C7284;
  font-size: 10px;
  text-transform: uppercase;
}

.crypto-fav-remove {
  background: none;
  border: none;
  color: #6C7284;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
}

.crypto-fav-remove:hover {
  color: #EB5757;
}

.crypto-no-favorites {
  color: #6C7284;
  font-size: 12px;
  font-style: italic;
}

/* ── Transaction Tabs & Table ─────────────────────────────── */

.crypto-txns {
  flex-shrink: 0;
  max-height: 180px;
  overflow: hidden;
  border-top: 1px solid #2C2F36;
  background: #212429;
  display: flex;
  flex-direction: column;
}

.crypto-txn-tabs {
  display: flex;
  gap: 0;
  background: #2C2F36;
  flex-shrink: 0;
}

.crypto-txn-tab {
  flex: 1;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #6C7284;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.3px;
}

.crypto-txn-tab:hover {
  color: #C3C5CB;
}

.crypto-txn-tab.active {
  color: #2172E5;
  border-bottom-color: #2172E5;
}

.crypto-txns-table-wrap {
  flex: 1;
  overflow-y: auto;
}

.crypto-txns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.crypto-txns-table th {
  padding: 5px 10px;
  text-align: left;
  color: #6C7284;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  background: #191B1F;
  position: sticky;
  top: 0;
  z-index: 1;
}

.crypto-txns-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #2C2F36;
}

.crypto-txns-table tr:hover {
  background: rgba(44, 47, 54, 0.7);
}

.crypto-txn-buy {
  color: #27AE60;
}

.crypto-txn-sell {
  color: #EB5757;
}

.crypto-txn-type {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

/* ── Loading & Error States ─────────────────────────────────── */

.crypto-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  flex-direction: column;
  gap: 12px;
}

.crypto-loading.visible {
  display: flex;
}

.crypto-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #2C2F36;
  border-top-color: #2172E5;
  border-radius: 50%;
  animation: crypto-spin 0.8s linear infinite;
}

@keyframes crypto-spin {
  to { transform: rotate(360deg); }
}

.crypto-error {
  display: none;
  padding: 8px 12px;
  margin: 0;
  background: rgba(235, 87, 87, 0.1);
  border-bottom: 1px solid rgba(235, 87, 87, 0.3);
  color: #EB5757;
  font-size: 12px;
  text-align: center;
  flex-shrink: 0;
}

.crypto-error.visible {
  display: block;
}

/* ── Scrollbar Styling ──────────────────────────────────────── */

.crypto-content ::-webkit-scrollbar {
  width: 5px;
}

.crypto-content ::-webkit-scrollbar-track {
  background: #191B1F;
}

.crypto-content ::-webkit-scrollbar-thumb {
  background: #40444F;
  border-radius: 3px;
}

.crypto-content ::-webkit-scrollbar-thumb:hover {
  background: #565A69;
}

/* ── Theme Adjustments ──────────────────────────────────────── */

.theme-winxp .crypto-search-input,
.theme-winxp .crypto-chain-select {
  border-radius: 2px;
}

.theme-winxp .crypto-search-results {
  border-radius: 0;
}

.theme-winxp .crypto-txn-tab {
  border-radius: 0;
}

/* ── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .crypto-body {
    flex-direction: column;
    overflow-y: auto;
  }

  .crypto-left-sidebar {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #2C2F36;
  }

  .crypto-right-sidebar {
    width: 100%;
    flex-shrink: 0;
    border-left: none;
    border-top: 1px solid #2C2F36;
  }

  .crypto-chart-area {
    min-height: 250px;
  }

  .crypto-search-wrapper {
    width: 140px;
  }

  .crypto-header-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 8px;
  }
}
