/**
 * UnitPay Stylesheet
 */

/* 全局样式 */
body {
  background-color: #f8f9fa;
  color: #212529;
}

/* 消息提示样式 */
.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  animation: fadeIn 0.5s;
  transition: opacity 0.5s;
}

.info-message {
  background-color: #d1ecf1;
  color: #0c5460;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  animation: fadeIn 0.5s;
  transition: opacity 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 卡片样式 */
.card {
  margin-bottom: 1.5rem;
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  font-weight: 500;
}

/* 按钮样式 */
.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-success {
  background-color: #198754;
  border-color: #198754;
}

/* 列表样式 */
.list-group-item {
  border-left: none;
  border-right: none;
  padding: 1rem;
}

/* 状态标签样式 */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
}

/* 表单样式 */
.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 钱包地址显示样式 */
.text-truncate {
  max-width: 150px;
  display: inline-block;
  vertical-align: middle;
}

/* 模态框样式 */
.modal-content {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 导航标签样式 */
.nav-tabs .nav-link.active {
  font-weight: 500;
  color: #0d6efd;
  border-bottom: 2px solid #0d6efd;
}

.nav-tabs .nav-link {
  color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* LP选择和费率相关样式 */
.form-range {
  height: 1.5rem;
}

.fee-rate-container {
  margin-bottom: 1.5rem;
}

#lp-selection-container {
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 0.25rem;
}

#lp-selection-container.active {
  background-color: rgba(0, 123, 255, 0.05);
}

/* 支付表单样式增强 */
#payment-form {
  padding: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

#payment-form.d-none {
  opacity: 0;
  transform: translateY(-10px);
}

#payment-form:not(.d-none) {
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 处理遮罩样式 */
#processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#processing-overlay.d-none {
  display: none;
}

.processing-content {
  background-color: white;
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.processing-spinner {
  width: 3rem;
  height: 3rem;
  border: 0.25rem solid #f3f3f3;
  border-top: 0.25rem solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 确保Toasts是可见的 */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
}

.toast {
  background-color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
  #payment-form {
    padding: 0.5rem;
  }

  .processing-content {
    padding: 1.5rem;
    width: 90%;
    max-width: 360px;
  }
}

/* LP选择相关 */
.highlight-field {
  background-color: rgba(255, 248, 220, 0.5);
  border-left: 3px solid #ffc107;
  padding-left: 10px;
  transition: all 0.3s ease;
}

.highlight-field label {
  color: #d68102;
  font-weight: 500;
}

.highlight-field small {
  color: #d68102;
}

/* Wrap long content in status history table in user detail modal */
.modal.fade.show .modal-body table {
  table-layout: fixed;
  width: 100%;
}
.modal.fade.show .modal-body table td {
  word-break: break-word;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Adjust column widths in user detail modal's status history table */
.modal.fade.show .modal-body table th:nth-child(1),
.modal.fade.show .modal-body table td:nth-child(1) {
  width: 20%;
}
.modal.fade.show .modal-body table th:nth-child(2),
.modal.fade.show .modal-body table td:nth-child(2) {
  width: 20%;
}
.modal.fade.show .modal-body table th:nth-child(3),
.modal.fade.show .modal-body table td:nth-child(3) {
  width: 60%;
}