/* Modern UI Styles for the card purchase page */
body {
  background-color: #f8f9fa;
  font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei", "Hiragino Sans GB", sans-serif;
  color: #333;
  transition: background-color 0.3s ease;
}

.card-container {
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  background: #fff;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card-container:hover {
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  background: linear-gradient(135deg, #4a90e2, #357ae8);
  color: white;
}

.card-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.navbar-modern {
  background-color: #fff;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.navbar-modern .navbar-brand {
  font-weight: 700;
  color: #4a90e2;
  transition: color 0.2s ease;
}

.navbar-modern .navbar-brand:hover {
  color: #357ae8;
}

.navbar-modern .nav > li > a {
  color: #505050;
  font-weight: 500;
  padding: 15px 20px;
  transition: all 0.2s ease;
}

.navbar-modern .nav > li > a:hover,
.navbar-modern .nav > li.active > a {
  color: #4a90e2;
  background-color: transparent;
}

.navbar-modern .nav > li > a:focus {
  background-color: transparent;
}

.btn-modern {
  border-radius: 4px;
  border: none;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-modern-primary {
  background: linear-gradient(135deg, #4a90e2, #357ae8);
  color: white;
}

.btn-modern-primary:hover,
.btn-modern-primary:focus {
  background: linear-gradient(135deg, #357ae8, #2a62bc);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
}

.btn-modern-success {
  background: linear-gradient(135deg, #5cb85c, #449d44);
  color: white;
}

.btn-modern-success:hover,
.btn-modern-success:focus {
  background: linear-gradient(135deg, #449d44, #3d8b3d);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(92, 184, 92, 0.4);
}

.btn-modern-danger {
  background: linear-gradient(135deg, #ff803a, #ff5722);
  color: white;
}

.btn-modern-danger:hover,
.btn-modern-danger:focus {
  background: linear-gradient(135deg, #ff5722, #e64a19);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 87, 34, 0.4);
}

/* Form control styles */
.form-control {
  height: 42px;
  box-shadow: none;
  border: 1px solid #e0e0e0;
  padding: 6px 12px;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.input-group-addon {
  border: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  color: #666;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

/* Alert styles */
.alert {
  border-radius: 4px;
  border: none;
  padding: 15px;
  margin-bottom: 20px;
  animation: fadeIn 0.5s;
}

.alert-info {
  background-color: #e8f4fd;
  color: #31708f;
  border-left: 4px solid #5bc0de;
}

.alert-warning {
  background-color: #fff8e1;
  color: #8a6d3b;
  border-left: 4px solid #f0ad4e;
}

.alert-success {
  background-color: #edf7ed;
  color: #3c763d;
  border-left: 4px solid #5cb85c;
}

/* Shopping cart indicator */
.border-t {
  border-top: 1px solid #eee;
  padding-top: 15px;
  margin-top: 15px;
}

/* Quantity selector */
.quantity-selector .btn {
  height: 42px;
  padding: 0 12px;
  line-height: 42px;
  border-radius: 0;
}

.quantity-selector input {
  text-align: center;
  font-weight: 500;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 0;
  margin-top: 30px;
  color: #777;
  transition: all 0.3s ease;
}

.footer p {
  margin: 5px 0;
}

.footer a {
  color: #4a90e2;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #357ae8;
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card-header,
  .card-body {
    padding: 15px;
  }
  
  .form-group {
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .card-header h3 {
    font-size: 16px;
  }
  
  .btn-modern {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* Button animations */
.btn-pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

/* Form effects */
.form-group.focused::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, #4a90e2, #357ae8);
  animation: formFocus 0.3s forwards;
  transform: scaleX(0);
}

@keyframes formFocus {
  to { transform: scaleX(1); }
}

/* Custom control elements */
.onclick {
  cursor: pointer;
  transition: all 0.2s ease;
}

.onclick:hover {
  color: #4a90e2;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1; 
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 现代化支付弹窗样式 */
.modern-pay-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;
  overflow: auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modern-pay-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  width: 320px;
  max-width: 90%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: fadeInUp 0.4s;
}

.modern-pay-header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #4a90e2, #357ae8);
  color: white;
  border-bottom: 1px solid #eee;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.modern-pay-close {
  position: absolute;
  right: 15px;
  top: 15px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 20px;
  transition: 0.3s;
}

.modern-pay-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.modern-pay-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modern-pay-price {
  text-align: center;
  font-size: 26px;
  margin: 0 0 15px;
  font-weight: bold;
  color: #333;
}

.modern-pay-methods {
  padding: 10px 0;
}

.modern-pay-divider {
  border-top: 1px solid #eee;
  margin: 15px 0;
}

.modern-pay-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  text-align: left;
  transition: all 0.3s;
  outline: none;
  cursor: pointer;
  overflow: hidden;
}

.modern-pay-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-pay-btn img {
  height: 20px;
  width: auto !important;
  margin-right: 10px;
  vertical-align: middle;
  display: inline-block;
}

.modern-pay-btn span {
  vertical-align: middle;
}

.modern-pay-btn-alipay {
  background: #00a0e9;
  color: white;
}

.modern-pay-btn-wxpay {
  background: #09bb07;
  color: white;
}

.modern-pay-btn-qqpay {
  background: #12b7f5;
  color: white;
}

.modern-pay-btn-rmb {
  background: #ff9700;
  color: white;
}

.modern-pay-btn-cancel {
  background: #f5f5f5;
  color: #666;
  text-align: center;
}

.modern-pay-btn-cancel:hover {
  background: #e5e5e5;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* 购物车效果 */
#alert_cart {
  transition: all 0.3s ease;
}

#alert_cart:hover {
  background-color: #f8f9fa;
}

/* 表单聚焦动效 */
.form-control:focus + .input-group-addon {
  border-color: #4a90e2;
}