/* Loyalty Card Container */
.loyalty-card-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
}

/* 3D Card Flip Animation */
.loyalty-card {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 320px;
  margin: 0 auto 40px;
  perspective: 1000px;
  cursor: pointer;
}

.loyalty-card.flipped {
  --rotation: 180deg;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transition: transform 0.6s;
  border-radius: 15px;
  padding: 25px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.card-front {
  background: linear-gradient(135deg, rgb(238, 184, 133) 0%, rgb(146, 72, 3) 100%);
  color: white;
  transform: rotateY(var(--rotation, 0deg));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.card-back {
  background: linear-gradient(135deg, rgb(146, 72, 3) 0%, rgb(238, 184, 133) 100%);
  color: white;
  transform: rotateY(calc(var(--rotation, 0deg) + 180deg));
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 15px;
}

.card-logo {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 2px;
}

.card-title {
  font-size: 20px;
  padding-top: 12px;
  letter-spacing: 1px;
  opacity: 0.9;
}

/* Card Content */
.card-content {
  flex-grow: 1;
  display: flex;
  gap: 20px;
}

/* Member Info */
.member-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 14px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 10px;
}

.info-row .label {
  font-weight: 600;
  opacity: 0.9;
}

.info-row .value {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  text-align: right;
}

/* Card Footer */
.card-footer {
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  padding-top: 15px;
  margin-top: auto;
}

.verification-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.95;
}

.badge-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Card Back */
.qr-code-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.qr-code {
  width: 120px;
  height: 120px;
  background: white;
  padding: 8px;
  border-radius: 8px;
}

.qr-text {
  font-size: 12px;
  margin: 0;
  opacity: 0.9;
}

.back-content {
  text-align: center;
}

.card-info {
  font-size: 11px;
  line-height: 1.6;
  margin-top: 15px;
}

.card-info p {
  margin: 8px 0;
}

.security-note {
  margin-top: 15px;
  opacity: 0.8;
  font-style: italic;
  font-size: 10px;
}

/* Card Info Section */
.card-info-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
}

.card-info-section h2 {
  margin-top: 0;
  color: #333;
  font-size: 28px;
}

.card-info-section > p {
  color: #666;
  margin-bottom: 30px;
  font-size: 16px;
}

/* Card Stats */
.card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: bold;
  color: rgb(238, 184, 133);
  margin-bottom: 5px;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #666;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, rgb(238, 184, 133) 0%, rgb(146, 72, 3) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: white;
  color: rgb(238, 184, 133);
  border: 2px solid rgb(238, 184, 133);
}

.btn-secondary:hover {
  background: rgb(238, 184, 133);
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .loyalty-card {
    height: 280px;
  }

  .card-front,
  .card-back {
    padding: 20px;
  }

  .card-content {
    gap: 15px;
  }

  .member-info {
    font-size: 12px;
  }

  .info-row {
    margin-bottom: 6px;
  }

  .card-stats {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  body {
    background: white;
  }

  .loyalty-card-container {
    margin: 0;
    padding: 0;
  }

  .card-info-section {
    display: none;
  }

  .loyalty-card {
    max-width: 100%;
    height: 320px;
  }
}
