/* public/css/components/table.css */

/* --- TABLE HEADER --- */
.table-header-row {
  height: 30px;
  font-size: 9px;
  background: rgba(20, 20, 20, 0.5);
  display: flex;
}
.header-col {
  display: flex;
  align-items: center;
  height: 40px;
}
.table-header-row .col-ticker {
  justify-content: center;
  text-align: center;
  border-right: 1px solid #1a1a1a;
}
.table-header-row .col-strategies {
  justify-content: center;
  padding: 0 20px;
}

/* Ocultar colunas legadas - Aumentando especificidade para vencer o display:flex padrão */
.table-header-row .col-spark,
.table-header-row .col-actions,
.ticker-row .col-spark,
.ticker-row .col-actions {
  display: none;
}

/* --- TABLE BODY --- */
#tableBody {
  display: flex;
  flex-direction: column;
}

.ticker-row {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(26, 26, 26, 0.9);
  min-height: 96px;
  padding: 10px 20px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.01),
    rgba(0, 0, 0, 0)
  );
  transition:
    background 0.12s,
    transform 0.12s;
}

/* New Row Effect */
.ticker-row.new-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(41, 182, 246, 0.9);
  box-shadow: 0 0 12px rgba(23, 115, 158, 0.35);
}
.ticker-row.new-row:not(.fav-row) {
  background: linear-gradient(
    90deg,
    rgba(41, 182, 246, 0.08),
    rgba(0, 0, 0, 0)
  );
}

.ticker-row:hover {
  z-index: var(--z-row-hover);
  background: linear-gradient(90deg, rgba(1, 250, 105, 0.12), rgba(0, 0, 0, 0));
  box-shadow: 0 0 0 1px rgba(169, 236, 197, 0.2);
  overflow: visible;
}

/* Favorite Row */
.fav-row {
  background: linear-gradient(
    90deg,
    rgba(255, 202, 40, 0.14),
    rgba(0, 0, 0, 0)
  );
  border-left: 3px solid var(--gold-star);
}

/* --- COLUNAS --- */
.col-ticker {
  width: var(--col-ticker-max);
  flex: 0 0 var(--col-ticker-max);
  display: flex;
  flex-direction: column;
  padding-right: 14px;
  padding-top: 6px;
  border-right: 1px solid #1a1a1a;
}

.col-strategies {
  flex: 1;
  min-width: var(--col-strategy-min);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 20px 8px;
}

/* --- TICKER INFO --- */
.ticker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ticker-name {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.star-icon {
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: 0.2s;
}
.star-icon:hover {
  transform: scale(1.2);
  color: #666;
}
.star-icon.star-active {
  color: var(--gold-star);
  text-shadow: 0 0 10px rgba(255, 202, 40, 0.4);
}
/* Volume Rows */
.vol-info {
  margin-top: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ccc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 2px;
}
.vol-val {
  font-family: "Roboto Mono", monospace;
  color: #fff;
  font-weight: bold;
  margin-left: auto;
  font-size: 13px;
}

/* --- ESTRATÉGIAS --- */
.strategy-line {
  display: grid;
  grid-template-columns:
    minmax(340px, 1.7fr) minmax(150px, 0.75fr) minmax(160px, 0.8fr)
    minmax(145px, 0.75fr) auto;
  align-items: center;
  column-gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 6px;
  justify-content: space-between;
}
.strat-winner {
  opacity: 1;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}
.strat-loser {
  display: none;
}

.strat-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.strat-title {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 5px;
}

.exch-col {
  min-width: 0;
  display: inline-flex;
  align-items: center;
}
.exch-col-a {
  justify-content: flex-start;
}

.exch-col-b {
  justify-content: flex-start;
}

.strat-title .arrow {
  justify-self: center;
  margin-left: -2px;
}
.strat-title:hover .exch-name {
  text-decoration: underline;
  filter: brightness(1.15);
}

.exch-name {
  color: var(--ex);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Prices & Results */
.strat-prices {
  font-size: 11px;
  color: #aaa;
  font-family: "Roboto Mono", monospace;
}
.strat-result,
.strat-avgs,
.strat-top10,
.strat-actions-unified {
  padding-left: 15px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  align-self: stretch;
  display: flex;
  align-items: center;
  margin: -2px 0;
}
.strat-result {
  gap: 12px;
  font-family: "Roboto Mono", monospace;
  font-weight: bold;
  font-size: 13px;
  justify-content: center;
  min-width: 0;
}
.strat-avgs {
  gap: 6px;
  font-size: 12px;
  justify-content: center;
  min-width: 0;
}
.strat-top10 {
  flex-direction: column;
  gap: 2px;
  font-family: "Roboto Mono", monospace;
  justify-content: center;
  min-width: 0;
}
.strat-actions-unified {
  justify-content: flex-end;
  min-width: 88px;
  gap: 8px;
  padding-left: 10px;
}

/* Helpers de Texto */
.label-mini {
  font-size: 9px;
  color: #444;
  font-weight: bold;
  margin-right: 3px;
}
.profit-pos {
  color: var(--long-green);
}
.profit-neg {
  color: var(--short-red);
}

/* Buttons in Table */
.btn-unified {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  height: 28px;
  color: #aaa;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
}
.btn-unified:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-unified.active .dot {
  background: var(--long-green);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.55);
}
.btn-unified .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.col-strategies.is-collapsed .strategy-collapsible-item.is-overflow {
  display: none;
}

.strategy-toggle-btn {
  margin-top: 4px;
  align-self: flex-start;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #b9b9b9;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.strategy-toggle-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
}

.strategy-toggle-icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
  transition: transform 0.15s ease;
}

.strategy-toggle-icon.is-open {
  transform: rotate(180deg);
}
