* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

h1 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

h2 {
  color: #555;
  margin-bottom: 15px;
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

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

/* User Card */
.user-card {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 20px 0;
}

.user-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-bottom: 10px;
  border: 3px solid #667eea;
}

.user-card h3 {
  color: #333;
  font-size: 20px;
}

/* Messages */
.success {
  color: #28a745;
  background: #d4edda;
  padding: 12px;
  border-radius: 8px;
  margin: 15px 0;
  border-left: 4px solid #28a745;
}

.error {
  color: #dc3545;
  background: #f8d7da;
  padding: 12px;
  border-radius: 8px;
  margin: 15px 0;
  border-left: 4px solid #dc3545;
}

.error-page {
  text-align: center;
  padding: 40px 20px;
}

.error-message {
  font-size: 18px;
  margin: 20px 0;
  color: #666;
}

/* Buttons */
button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  margin-top: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: 600;
}

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

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.back-btn {
  background: #6c757d;
}

.logout-btn {
  background: #dc3545;
  width: auto;
  padding: 10px 20px;
  font-size: 14px;
  margin: 0;
}

.logout-btn:hover {
  background: #c82333;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Voucher Cards */
.voucher-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.voucher-card.used {
  opacity: 0.6;
  background: #f8f9fa;
}

.voucher-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.voucher-header h3 {
  color: #333;
  font-size: 18px;
  margin: 0;
  flex: 1;
}

.voucher-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.voucher-status.available {
  background: #d4edda;
  color: #28a745;
}

.voucher-status.used {
  background: #f8d7da;
  color: #dc3545;
}

.voucher-description {
  color: #666;
  margin-bottom: 15px;
  line-height: 1.5;
}

.voucher-discount {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
}

.use-btn {
  margin-top: 10px;
}

.used-date {
  color: #999;
  font-size: 14px;
  text-align: center;
  margin-top: 10px;
}

.no-vouchers {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-size: 16px;
}

/* Voucher Detail Page */
.voucher-detail {
  text-align: center;
}

.description {
  color: #666;
  font-size: 16px;
  margin: 20px 0;
  line-height: 1.6;
}

.discount-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  font-size: 32px;
  font-weight: bold;
  margin: 30px 0;
}

.qr-section {
  margin: 40px 0;
}

.qr-section h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #555;
}

.qr-container {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}

.qr-container img {
  max-width: 250px;
  width: 100%;
  height: auto;
}

.voucher-code-display {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

.voucher-code-display p {
  color: #666;
  margin-bottom: 10px;
  font-size: 14px;
}

.voucher-code-display code {
  font-size: 18px;
  color: #333;
  background: white;
  padding: 12px 20px;
  border-radius: 8px;
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  border: 2px dashed #667eea;
}

.alert {
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.alert-warning {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  color: #856404;
}

/* Shop Panel */
.shop-panel {
  padding: 20px 0;
}

.shop-panel h1 {
  color: #333;
  margin-bottom: 10px;
}

.shop-panel > p {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
}

.form-container {
  margin: 30px 0;
}

.voucher-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 15px;
  transition: border-color 0.3s;
  font-family: 'Courier New', monospace;
}

.voucher-input:focus {
  outline: none;
  border-color: #667eea;
}

.submit-btn {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.message-box {
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
  display: none;
  font-weight: 500;
}

.message-box.success {
  background: #d4edda;
  color: #28a745;
  border-left: 4px solid #28a745;
  display: block;
}

.message-box.error {
  background: #f8d7da;
  color: #dc3545;
  border-left: 4px solid #dc3545;
  display: block;
}

.voucher-result {
  background: #d4edda;
  padding: 25px;
  border-radius: 12px;
  margin-top: 30px;
  border: 2px solid #28a745;
}

.voucher-result h3 {
  color: #28a745;
  margin-bottom: 15px;
  text-align: center;
}

.voucher-result p {
  margin: 10px 0;
  color: #333;
  font-size: 16px;
}

.success-mark {
  text-align: center;
  font-size: 28px;
  color: #28a745;
  margin-top: 15px;
  font-weight: bold;
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 24px;
  }

  .voucher-discount {
    font-size: 20px;
  }

  .discount-badge {
    font-size: 28px;
  }

  .logout-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
