/* public/css/style.css */

:root {
  --bg-color: #050505;
  --card-bg: #111;
  --text-main: #e0e0e0;
  --bingx-blue: #29b6f6;
  --mexc-red: #ff5252;
  --long-green: #00e676;
  --short-red: #ff1744;
  --border-color: #222;
  --gold-star: #ffca28;

  /* Layout Sizes */
  --filters-h: 74px;
  --col-ticker-min: 360px;
  --col-ticker-max: 360px;
  --col-strategy-min: 620px;
  --col-strategy-max: none;

  /* Colors */
  --spot-c: #4fc3f7;
  --fut-c: #ffca28;

  /* Layers */
  --z-base: 1;
  --z-sticky: 20;
  --z-row-hover: 10;
  --z-dropdown: 60;
  --z-tooltip: 120;
  --z-modal: 1000;
}

/* Reset Básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  background: radial-gradient(circle at top, #101010, #050505 70%);
  color: var(--text-main);
  font-family: "Segoe UI", "Roboto", sans-serif;
  margin: 0;
  font-size: 13px;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  justify-content: center;
}

.dashboard-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 5px;
  width: 100%;
  max-width: 1600px;
  min-width: 1100px;
  margin: 0 auto;
}

/* --- HEADER --- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.title-section h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: 2px;
  font-weight: 900;
  color: #fff;
}

.title-pro-tag {
  font-size: 12px;
  color: #666;
}

.header-meta-row {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 8px;
}

.updated-time-value {
  color: #fff;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #8a8a8a;
  letter-spacing: 0.4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.update-mode-control {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: #111;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.65);
}

.update-mode-label {
  padding: 0 7px;
  color: #666;
  font-family: monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.update-mode-option {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #777;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.update-mode-option:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.update-mode-option.is-active {
  color: #02100a;
  background: linear-gradient(180deg, #39d98a, #1fbf70);
}

.logout-btn {
  margin-left: 20px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #222;
  color: #eee;
  cursor: pointer;
  transition: 0.15s;
}

.logout-btn:hover {
  border-color: #666;
  color: #fff;
}

.update-info {
  font-size: 10px;
  color: #666;
  font-weight: bold;
  margin-top: 2px;
  font-family: monospace;
}

.search-box input {
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 14px;
  width: 250px;
  outline: none;
  text-transform: uppercase;
  font-weight: bold;
  transition: border 0.3s;
}
.search-box input:focus {
  border-color: var(--bingx-blue);
}

/* --- USER DISPLAY --- */
.user-display {
  margin-left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
/* (Styles das tags de user ficam aqui ou no modal.css? Vamos manter aqui pois é do header) */
.user-display .tag {
  margin-left: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.6px;
}
.user-display .tag-user {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.user-display .tag-level-vip {
  color: #50a0ff;
  border: 1px solid rgba(80, 160, 255, 0.4);
  background: rgba(80, 160, 255, 0.15);
}
.user-display .tag-level-master,
.user-display .tag-level-MASTER {
  color: var(--fut-c);
  border: 1px solid rgba(255, 202, 40, 0.65);
  background: rgba(255, 202, 40, 0.12);
}
.user-display .tag-admin {
  cursor: pointer;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.user-display .tag-admin:hover {
  filter: brightness(1.15);
}

/* --- WRAPPER DA TABELA --- */
.table-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: linear-gradient(180deg, #111, #070707);
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.8);
}

/* --- BARRA DE FILTROS --- */
.table-filters {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: linear-gradient(180deg, #111, #080808);
  padding: 10px 20px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modern-filter-bar {
  display: flex;
  gap: 15px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.filter-group-relative {
  position: relative;
}

.filter-group-push-right {
  margin-left: auto;
}

.filter-group label {
  font-size: 9px;
  font-weight: bold;
  color: #777;
  letter-spacing: 0.5px;
}
.filter-group input:not([type="checkbox"]) {
  background: linear-gradient(180deg, #050505, #000);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  outline: none;
  width: 110px;
  transition: all 0.2s;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
}
.filter-group input:not([type="checkbox"]):focus {
  border-color: var(--bingx-blue);
  background: #02060a;
}

.filter-divider {
  width: 1px;
  height: 32px;
  background: #222;
  margin: 0 5px;
}

/* Select de Ordenação */
#sortSelect {
  background: linear-gradient(180deg, #151515, #090909);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ccc;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  outline: none;
  height: 30px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

/* Estilo global para a lista de opções de todos os Selects (Dropdowns) */
select option {
  background: #111;
  color: #eee;
}
/* Botões de Filtro */
.filter-btn {
  background: linear-gradient(180deg, #151515, #090909);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #aaa;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  height: 30px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  transition: 0.15s;
}
.filter-btn:hover {
  background: linear-gradient(180deg, #1e1e1e, #101010);
  color: #fff;
}
.filter-btn.filter-active {
  background: linear-gradient(180deg, #39d98a, #18a85e);
  color: #001b0c;
  border-color: #39d98a;
}
.exchange-filter-btn {
  min-width: 210px;
  justify-content: space-between;
}

.filter-caret {
  font-size: 10px;
}

.checkbox-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  color: #ccc;
  background: #1a1a1a;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #333;
  transition: all 0.2s;
}

.checkbox-btn:hover {
  border-color: #555;
  color: #fff;
}

.checkbox-btn input[type="checkbox"],
.exchange-option input[type="checkbox"] {
  accent-color: #22c55e;
}

.checkbox-btn input:checked + span,
.exchange-option input:checked + span {
  color: #22c55e;
  font-weight: bold;
}

.input-w-80 {
  width: 80px;
}

.input-w-60 {
  width: 60px;
}

.input-w-50 {
  width: 50px;
}

.select-w-70 {
  width: 70px;
}

.select-w-110 {
  width: 110px;
}

.input-search {
  width: 7ch;
  min-width: 0 !important;
  max-width: max-content;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  padding-left: 6px;
  padding-right: 6px;
}

.input-money {
  width: 15ch;
  min-width: 0 !important;
  max-width: max-content;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  padding-left: 6px;
  padding-right: 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.filter-group input.input-percent,
input.input-percent {
  /* Largura (Width) */
  width: 8ch !important;
  min-width: 8ch !important;
  max-width: 8ch !important;
  flex: 0 0 8ch !important;
  /* Altura Fixa (Height) - Isso impede que ele vire um quadrado */
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  /* Espaçamento interno: 0 em cima/embaixo, 4px nas laterais */
  box-sizing: border-box;
  padding: 0 4px !important;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.select-window {
  width: 11ch;
  min-width: 0 !important;
  max-width: max-content;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  padding-left: 6px;
  padding-right: 6px;
}

.select-sort {
  width: 20ch;
  min-width: 0 !important;
  max-width: max-content;
  flex: 0 0 auto !important;
  box-sizing: border-box;
  padding-left: 6px;
  padding-right: 6px;
}

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

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

.filter-btn.reset {
  background: #111;
  border-color: #222;
  color: #666;
  width: 100%;
}
.filter-btn.reset:hover {
  background: #cc3333;
  border-color: #ff5252;
  color: #fff;
}

/* Responsivo Mobile Simples */
@media (max-width: 768px) {
  body {
    overflow: auto;
  }
  .modern-filter-bar {
    flex-wrap: wrap;
  }
  .dashboard-container .table-wrapper {
    overflow: auto;
  }
}

/* =========================================
   SKELETON LOADER (CARREGAMENTO INICIAL)
   ========================================= */
.skeleton-row {
  display: flex;
  padding: 15px 20px;
  border-bottom: 1px solid #1a1a1a;
  gap: 20px;
}

.skeleton-box {
  background: linear-gradient(90deg, #222 25%, #333 50%, #222 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-col-1 {
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-col-2 {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
