/* public/css/components/modals.css */

/* ===========================
   TAGS & BADGES
=========================== */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}
.trade-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.04em;
  margin-left: 8px;
}

.tag-separator {
  display: inline-block;
  margin: 0 2px;
}
.tag-spot {
  color: var(--spot-c);
  border: 1px solid rgba(79, 195, 247, 0.65);
  background: rgba(79, 195, 247, 0.1);
}
.tag-futures {
  color: var(--fut-c);
  border: 1px solid rgba(255, 202, 40, 0.65);
  background: rgba(255, 202, 40, 0.1);
}

.tag-api-on {
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.1);
}
.tag-api-off {
  color: #ff5252;
  border: 1px solid rgba(255, 82, 82, 0.4);
  background: rgba(255, 82, 82, 0.1);
  opacity: 0.9;
}

.ls-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 9px;
  margin-left: 10px;
  width: 40px;
}
.ls-chip.long {
  color: var(--long-green);
  background: rgba(0, 230, 118, 0.18);
  border: 1px solid rgba(0, 230, 118, 0.55);
}
.ls-chip.short {
  color: var(--short-red);
  background: rgba(255, 23, 68, 0.18);
  border: 1px solid rgba(255, 23, 68, 0.55);
}

/* Badges Animados */
.new-badge-wrap,
.new-badge-mini-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f10303;
}
.new-badge {
  background-color: #2ebd85;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}
.new-badge-mini {
  background: rgba(41, 182, 246, 0.18);
  color: #29b6f6;
  border: 1px solid rgba(41, 182, 246, 0.28);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.removing-badge {
  background-color: #ff9800;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
  margin-left: 6px;
  text-transform: uppercase;
}

/* Fire Icon Animation */
.fire-icon {
  width: 0.95em;
  height: 0.95em;
  display: inline-block;
  animation: fire-flicker 1.15s infinite ease-in-out;
}
@keyframes fire-flicker {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(-0.6px) rotate(2deg) scale(1.06);
    opacity: 0.96;
  }
}

/* ===========================
   MODAIS (BASE)
=========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: var(--z-modal);
}
.modal-content {
  width: min(1300px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #222;
}
.close-modal {
  cursor: pointer;
  font-size: 24px;
  opacity: 0.8;
}
.close-modal:hover {
  opacity: 1;
}

/* ===========================
   MODAL DE LOG (ESPECÍFICO)
=========================== */
.log-container {
  margin-top: 10px;
  max-height: 60vh;
  overflow-y: auto;
}
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.log-table th,
.log-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #1a1a1a;
}
.log-table th {
  text-align: left;
  color: #888;
}

.log-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  color: #888;
}
.sniper-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #29b6f6;
  animation: spin 0.8s ease-in-out infinite;
  margin-bottom: 12px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Filtros do Log */
.log-minprofit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.log-minprofit input {
  width: 78px;
  background: linear-gradient(180deg, #050505, #000);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}
.time-select {
  background: linear-gradient(180deg, #151515, #090909);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ddd;
  padding: 6px 10px;
  border-radius: 8px;
  height: 32px;
  cursor: pointer;
}
#logDirSelect {
  min-width: 250px;
}

/* Dropdown de API no Log */
#logApiDropdownBtn {
  min-width: 120px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  padding: 0 8px;
}
#logApiDropdownMenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #1a1a1a;
  border: 1px solid #444;
  padding: 8px;
  z-index: var(--z-dropdown);
  display: none;
  margin-top: 4px;
}

/* ===========================
   MODAL DE SETTINGS (STRATEGY)
=========================== */
.strategy-settings-modal {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 340px;
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 18px;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
}
.strategy-settings-modal::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: #0f0f0f;
  border-left: 1px solid #333;
  border-top: 1px solid #333;
  transform: rotate(45deg);
}
.modal-inner-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  border-bottom: 1px solid #222;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 10px;
}
.ss-row label {
  font-size: 10px;
  color: #777;
  font-weight: bold;
}
.ss-row input {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  padding: 6px;
  border-radius: 6px;
}

/* ===========================
   TOOLTIPS
=========================== */
/* Valid Pairs (Internal) */
.vp-prices {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}
.vp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}
.vp-ico {
  width: 14px;
  height: 14px;
  opacity: 0.9;
}

/* O Tooltip Flutuante do VP */
.vp-tooltip {
  min-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 12, 0.96);
  color: rgba(255, 255, 255, 0.92);
  z-index: var(--z-tooltip);
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(var(--vp-tt-x, -999px), var(--vp-tt-y, -999px), 0);
  transition: opacity 0.12s;
}
.vp-tooltip.is-open {
  opacity: 1;
  visibility: visible;
}

.vp-tip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.vp-tip-row {
  display: flex;
  justify-content: space-between;
}
.vp-tip-k {
  opacity: 0.68;
}
.vp-tip-v {
  font-weight: 600;
  text-align: right;
}

/* Global Tooltip (data-tooltip) */
#global-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  background: rgba(12, 12, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f0f0f0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-family: "Roboto Mono", monospace;
  white-space: pre;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
#global-tooltip.is-visible {
  opacity: 1;
}

.exchange-dropdown-menu {
  display: none;
  top: 100%;
  left: 0;
  right: auto;
  width: auto;
  min-width: 300px;
  padding: 15px;
  z-index: var(--z-modal);
}

.exchange-dropdown-menu::before {
  right: auto;
  left: 18px;
}

.exchange-dropdown-head {
  margin-bottom: 10px;
  font-weight: bold;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exchange-dropdown-checkall {
  font-size: 11px;
  cursor: pointer;
  color: #fff;
}

.exchange-dropdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.exchange-dropdown-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.exchange-type-label {
  font-size: 10px;
  font-weight: bold;
}

.exchange-type-label-spot {
  color: #4caf50;
}

.exchange-type-label-futures {
  color: #ff9800;
}

.inv-log-modal-content {
  max-width: 600px;
}

.inv-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 20px;
}

.inv-filter-label {
  font-size: 12px;
  color: #ccc;
}

.inv-filter-input {
  width: 60px;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid #444;
  background: #222;
  color: #fff;
}

.log-modal-content {
  overflow: visible;
}

.modal-title-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.select-min-w-120 {
  min-width: 120px;
}

.log-api-container {
  position: relative;
  display: inline-block;
  margin-right: 10px;
}

.log-api-dropdown-btn {
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0 8px;
  height: 30px;
}

.log-api-dropdown-menu {
  display: none;
  min-width: 200px;
}

.log-api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
}

.log-auto-refresh-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
  color: #ccc;
  margin-left: 5px;
  background: #222;
  padding: 0 8px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #444;
}

.log-modal-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.log-lock-btn {
  cursor: pointer;
  margin-right: 15px;
  font-size: 18px;
  user-select: none;
}

.close-modal-no-margin {
  margin-left: 0;
}
