:root {
  --primary-color: #3a86ff;
  --primary-light: #4361ee;
  --secondary-color: #ff006e;
  --success-color: #4caf50;
  --error-color: #d90429;
  --warning-color: #ffbe0b;
  --text-color: #212529;
  --light-text: #6c757d;
  --background-color: #f8f9fa;
  --card-background: #ffffff;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --countdown-bg: rgba(255, 0, 110, 0.1);
  --animation-duration: 0.3s;
}

body {
  font-family: "Poppins", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont,
    sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
  margin: 0;
  padding: 0;
  padding-bottom: 7rem;
  font-size: 14px;
}

/* Loading Animation */
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--border-color);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--light-text);
  text-align: center;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Popup Container */
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-out;
}

.popup-content {
  background-color: var(--card-background);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 90%;
  width: 400px;
  animation: slideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.popup-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  text-align: center;
}

.popup-body {
  padding: 1rem 0;
  color: var(--light-text);
  line-height: 1.6;
  flex: 1;
}

.popup-message {
  font-size: 0.9rem;
  color: var(--light-text);
  line-height: 1.6;
}

.popup-message-important {
  font-size: 0.9rem;
  color: var(--error-color);
  line-height: 1.6;
  font-weight: 600;
}

.popup-footer {
  padding: 1rem 0 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 1rem;
  width: 100%;
}

.popup-confirm-btn {
  flex: 1;
  padding: 0.75rem 0;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
}

.popup-confirm-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Header */
.header {
  background-color: var(--card-background);
  box-shadow: 0 2px 4px var(--shadow-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 101;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  height: auto;
  min-height: 70px;
}

.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.7rem;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  height: 100%;
}

.amount-display {
  display: flex;
  align-items: center;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.currency-symbol {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--primary-color);
}

.amount {
  font-size: 2rem;
  font-weight: 600;
  margin-left: 0.05rem;
  color: var(--primary-color);
}

/* Language Selector Container Positioning */
.language-selector-container {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 102;
}

/* 语言选择器下拉菜单容器 */
.language-dropdown {
  position: relative;
  display: inline-block;
  font-family: "Roboto", sans-serif;
  z-index: 100;
}

/* 当前选中的语言显示 */
.selected-language {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--primary-color, #1e88e5);
  border-radius: 20px;
  width: auto;
  min-width: 70px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
  padding: 0 8px;
}

.selected-language:hover {
  background-color: #f5f5f5;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.selected-language:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 语言选项下拉菜单 */
.language-options {
  position: absolute;
  top: 100%;
  left: -20px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-top: 4px;
  padding: 4px;
  list-style: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  min-width: 80px;
}

/* 各语言选项 */
.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
  border-radius: 4px;
  margin-bottom: 4px;
}

.language-option:last-child {
  margin-bottom: 0;
}

.language-option:hover {
  background-color: #f5f5f5;
}

.language-option.active {
  background-color: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}

/* 语言旗帜图标 */
.language-flag {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
}

/* 语言代码样式 */
.language-code {
  font-size: 14px;
  font-weight: 500;
}

/* Countdown */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--error-color);
  padding: 0.4rem 0.6rem;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-right: -5rem;
}

.countdown i {
  font-size: 1.8rem;
  margin-right: 0.4rem;
  line-height: 1;
}

/* Main Content */
.main-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 0.6rem;
  margin-bottom: 110px;
  margin-top: 95px;
}

/* UPI ID Section */
.upi-section {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  min-height: 50px;
  position: relative;
  z-index: 100;
}

.upi-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 0.8rem;
  text-align: center;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.upi-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.upi-id {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: 0.5px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  padding-left: 15px;
}

.copy-btn {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  border-radius: 0.25rem;
  cursor: pointer;
  background-color: var(--primary-color);
  color: white;
  transition: transform var(--animation-duration),
    background-color var(--animation-duration);
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-left: auto;
}

.copy-btn:hover {
  transform: scale(1.1);
  background-color: var(--primary-light);
  color: white;
}

/* QR Code Section */
.qr-section {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  padding: 0.1rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  text-align: center;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.qr-container {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
}

.qr-code {
  padding: 0.9rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px var(--shadow-color);
}

/* Payment Methods Section */
.payment-methods-section {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* 更新现有的payment-methods-title样式 */
.payment-methods-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 0.8rem;
  text-align: center;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-bottom: 1rem;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.payment-method-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: transform var(--animation-duration),
    width var(--animation-duration), height var(--animation-duration);
  padding: 0.25rem;
  will-change: transform, width, height;
}

.payment-method-item:hover {
  transform: translateY(-3px);
}

.payment-method-icon {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  object-fit: contain;
  padding: 0.4rem;
  background-color: white;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.payment-method-name {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.2rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* UTR Input Section */
.utr-section {
  position: fixed;
  bottom: 2rem;
  left: 0;
  width: 100%;
  background-color: var(--card-background);
  padding: 0.4rem 0;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 99;
  animation: utrReminder 8s infinite;
}

@keyframes utrReminder {
  0%,
  50% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
  55% {
    background-color: var(--warning-color);
    transform: translateY(-5px);
  }
  60% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
  65% {
    background-color: var(--warning-color);
    transform: translateY(-5px);
  }
  70% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
  75% {
    background-color: var(--warning-color);
    transform: translateY(-5px);
  }
  80% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
  85% {
    background-color: var(--warning-color);
    transform: translateY(-5px);
  }
  90% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
  95% {
    background-color: var(--warning-color);
    transform: translateY(-5px);
  }
  100% {
    background-color: var(--card-background);
    transform: translateY(0);
  }
}

.utr-title {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  text-align: center;
  color: var(--light-text);
}

.utr-input-group {
  display: flex;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0.7rem;
}

.utr-input {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem 0 0 0.25rem;
  font-size: 0.8rem;
  outline: none;
  width: 100%;
  height: 2.1rem;
}

.utr-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.1rem rgba(58, 134, 255, 0.25);
}

.submit-btn {
  padding: 0.4rem 0.9rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0 0.25rem 0.25rem 0;
  cursor: pointer;
  transition: background-color var(--animation-duration);
  font-weight: 600;
  font-size: 0.85rem;
  height: 2.1rem;
  min-width: 4.5rem;
}

.submit-btn:hover {
  background-color: var(--primary-light);
}

/* Footer */
.footer {
  background-color: var(--card-background);
  padding: 0.4rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
  height: 2rem;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: var(--success-color);
  font-size: 0.8rem;
  font-weight: 500;
  max-width: 480px;
  margin: 0 auto;
}

.security-badge i {
  font-size: 0.8rem;
  margin-right: 0.2rem;
  color: var(--success-color);
  animation: fa-pulse 2s infinite linear;
}

/* 新增SVG盾牌图标样式 */
.security-badge .shield-icon {
  color: var(--primary-color);
  margin-right: 0.3rem;
  animation: shield-pulse 2s infinite linear;
  display: inline-block;
}

/* 重命名动画为shield-pulse */
@keyframes shield-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* 添加FontAwesome动画的备份 */
@keyframes fa-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
}

.toast {
  padding: 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 8px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  animation: slideIn 0.3s ease-in;
}

.toast.hide {
  animation: slideOut 0.3s ease-out;
}

.toast-success {
  background-color: var(--success-color);
  color: white;
}

.toast-error {
  background-color: var(--error-color);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 0;
  }
  to {
    transform: translateX(100%);
    opacity: 1;
  }
}

/* Modal Styles */
.modal-content {
  border-radius: 0.5rem;
  border: none;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.modal-header {
  border-bottom-color: var(--border-color);
  padding: 0.8rem 1rem;
}

.modal-body {
  padding: 1.2rem;
}

.modal-footer {
  border-top-color: var(--border-color);
  padding: 0.8rem 1rem;
}

/* Status Pages Common Styles */
.success-container,
.error-container,
.timeout-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--card-background);
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  text-align: center;
  margin-top: 65px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.success-title,
.error-title,
.timeout-title {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.5rem;
}

.success-message,
.error-message,
.timeout-message {
  margin: 1rem 0 2rem;
  color: var(--light-text);
  max-width: 400px;
  font-size: 0.9rem;
}

.success-title {
  color: var(--success-color);
}

.error-title {
  color: var(--error-color);
}

.timeout-title {
  color: var(--warning-color);
}

/* Return Button Styles */
.return-btn {
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 0.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--animation-duration);
  font-size: 0.9rem;
}

.success-container .return-btn {
  background-color: var(--success-color);
}

.success-container .return-btn:hover {
  background-color: #2a9d00;
}

.error-container .return-btn,
.timeout-container .return-btn {
  background-color: var(--primary-color);
}

.error-container .return-btn:hover,
.timeout-container .return-btn:hover {
  background-color: #2a75e6;
}

/* Quick Pay Apps Section */
.quick-pay-section {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
  box-shadow: 0 2px 4px var(--shadow-color);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.quick-pay-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--light-text);
  margin-bottom: 0.6rem;
  text-align: center;
}

.quick-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.quick-pay-app {
  display: flex;
  align-items: center;
  padding: 0.3rem;
  background-color: #f8f9fa;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.quick-pay-app:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.quick-pay-app-icon {
  width: 1.8rem;
  height: 1.8rem;
  object-fit: contain;
  margin-right: 0.5rem;
}

.quick-pay-app-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
}
