/* ============================================
   WeChat AI Chat - Modals, Settings, Transfer, AI Config
   ============================================ */

.modal {
  background: var(--wx-bg-white);
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.2s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal .modal-header {
  padding: 16px 20px 12px;
  text-align: center;
  position: relative;
}

.modal .modal-header .modal-title {
  font-size: 17px;
  font-weight: 600;
}

.modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 16px;
}

.modal .modal-footer {
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--wx-border-light);
}

.ai-config-page {
  flex: 1;
  overflow-y: auto;
  background: var(--wx-bg);
}

.ai-config-page .config-section {
  background: var(--wx-bg-white);
  margin-bottom: 8px;
}

.ai-config-page .provider-tabs {
  display: flex;
  background: var(--wx-bg-white);
  padding: 8px 12px;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--wx-border-light);
}

.ai-config-page .provider-tab {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 13px;
  background: var(--wx-bg-light);
  color: var(--wx-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--wx-transition-fast);
  flex-shrink: 0;
}

.ai-config-page .provider-tab.active {
  background: var(--wx-green);
  color: white;
}

.ai-config-page .provider-tab.agnes {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.ai-config-page .form-group {
  padding: 12px 16px;
}

.ai-config-page .form-label {
  font-size: 13px;
  color: var(--wx-text-secondary);
  margin-bottom: 6px;
  display: block;
}

.ai-config-page .form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--wx-bg-light);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  transition: all var(--wx-transition-fast);
}

.ai-config-page .form-input:focus {
  background: var(--wx-bg-white);
  border-color: var(--wx-green);
}

.model-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--wx-border-light);
  border-radius: 6px;
  margin-top: 8px;
}

.model-list .model-item {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--wx-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-list .model-item.selected {
  background: var(--wx-green-bg);
  color: var(--wx-green);
}

.persona-page {
  flex: 1;
  overflow-y: auto;
  background: var(--wx-bg);
}

.persona-card {
  background: var(--wx-bg-white);
  margin: 0 12px 8px;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all var(--wx-transition-fast);
  border: 2px solid transparent;
}

.persona-card.active {
  border-color: var(--wx-green);
  background: var(--wx-green-bg);
}

.persona-editor {
  background: var(--wx-bg-white);
  padding: 16px;
}

.persona-editor .editor-field {
  margin-bottom: 16px;
}

.persona-editor .editor-label {
  font-size: 13px;
  color: var(--wx-text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.persona-editor .editor-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--wx-bg-light);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
}

.persona-editor .editor-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--wx-bg-light);
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  font-family: inherit;
}

.transfer-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--wx-bg);
}

.transfer-page .transfer-amount-section {
  background: var(--wx-bg-white);
  padding: 24px 16px;
  margin-top: 8px;
}

.transfer-page .amount-input-row {
  display: flex;
  align-items: baseline;
  border-bottom: 1px solid var(--wx-border-light);
  padding-bottom: 12px;
}

.transfer-page .amount-symbol {
  font-size: 32px;
  font-weight: 300;
  color: var(--wx-text);
  margin-right: 8px;
}

.transfer-page .amount-input {
  flex: 1;
  font-size: 36px;
  font-weight: 300;
  border: none;
  outline: none;
  background: transparent;
  min-width: 0;
}

.transfer-page .quick-amounts {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.transfer-page .quick-amount {
  padding: 6px 14px;
  background: var(--wx-bg-light);
  border-radius: 16px;
  font-size: 13px;
  color: var(--wx-text-secondary);
  cursor: pointer;
  transition: all var(--wx-transition-fast);
}

.transfer-msg {
  background: linear-gradient(135deg, #FA5151, #E64340);
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 200px;
  max-width: 260px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.transfer-msg::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.redpacket-msg {
  background: linear-gradient(135deg, #FA5151, #E64340);
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 180px;
  max-width: 240px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.data-management {
  padding: 16px;
}

.data-management .storage-info {
  background: var(--wx-bg-white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

body.dark-mode {
  --wx-bg: #191919;
  --wx-bg-light: #202020;
  --wx-bg-white: #2C2C2C;
  --wx-bg-chat: #191919;
  --wx-text: #E8E8E8;
  --wx-text-secondary: #999;
  --wx-text-tertiary: #666;
  --wx-border: #3A3A3A;
  --wx-border-light: #2A2A2A;
  --wx-bubble-other: #2C2C2C;
  --wx-bubble-self: #07C160;
  --wx-bg-hover: #333;
}
