/**
 * Shared styles for the currency ratio overlay
 * Used across all market pages for currency rate adjustment
 */

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.header-left {
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1a1f26;
  border: 1px solid #2d3748;
  border-radius: 6px;
}

.ratio-input {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ratio-input label {
  font-size: 11px;
  color: #888;
}

.ratio-input input {
  width: 4ch;
  padding: 4px 5px;
  box-sizing: content-box; /* Override border-box so width = content only */
  background: #0f1419;
  border: 1px solid #2d3748;
  border-radius: 4px;
  color: #e4e4e4;
  font-size: 12px;
  text-align: right;
  -moz-appearance: textfield; /* Firefox */
}

/* Hide number input spinners */
.ratio-input input::-webkit-outer-spin-button,
.ratio-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ratio-input input:focus {
  outline: none;
  border-color: #ff6b35;
}

.ratio-input .ratio-unit {
  color: #666;
}

.ratio-divider {
  width: 1px;
  height: 20px;
  background: #2d3748;
  margin: 0 4px;
}

.ratio-refresh {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ratio-refresh:hover {
  background: #2d3748;
  color: #ff6b35;
}

.ratio-refresh:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Cogwheel / settings button */
.ratio-settings {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
}

.ratio-settings:hover {
  background: #2d3748;
  color: #ff6b35;
}

/* Settings modal */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.settings-modal {
  background: #1a1f26;
  border: 1px solid #2d3748;
  border-radius: 8px;
  width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #2d3748;
  color: #e4e4e4;
  font-size: 14px;
  font-weight: 600;
}

.settings-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.settings-modal-close:hover {
  color: #e4e4e4;
}

.settings-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-label {
  font-size: 12px;
  color: #888;
}

.settings-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #2d3748;
  border-radius: 6px;
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  padding: 6px 12px;
  background: #0f1419;
  border: none;
  color: #888;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.toggle-btn:not(:last-child) {
  border-right: 1px solid #2d3748;
}

.toggle-btn.active {
  background: #ff6b35;
  color: #fff;
}

.toggle-btn:hover:not(.active) {
  background: #2d3748;
  color: #e4e4e4;
}

.settings-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e4e4e4;
  cursor: pointer;
}

.settings-checkbox-label input[type="checkbox"] {
  accent-color: #ff6b35;
  width: 16px;
  height: 16px;
}
