/* =============================================================================
   components.css
   Shared UI components used across multiple pages.
   ============================================================================= */

/* ── Status badges ─────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}
.status-completed { background-color: #d4edda; color: #155724; }
.status-active    { background-color: #d4edda; color: #155724; }
.status-pending   { background-color: #fff3cd; color: #856404; }
.status-failed    { background-color: #f8d7da; color: #721c24; }
.status-expired   { background-color: #f8d7da; color: #721c24; }
.status-refunded  { background-color: #e2e3e5; color: #383d41; }
.status-disputed  { background-color: #f5c6cb; color: #721c24; }
.status-inactive  { background-color: #fff3cd; color: #856404; }

/* ── Generic loading indicator ─────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 20px;
  display: none;
}

/* ── Transaction item row ───────────────────────────────────────────────────── */
.transaction-item {
  border-bottom: 1px solid #eee;
  padding: 15px 0;
}

/* ── Form components ────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}
.form-control[readonly],
.form-control[disabled] {
  background: #f8f9fa;
  cursor: not-allowed;
}
textarea.form-control { resize: vertical; }

/* ── Alert boxes ────────────────────────────────────────────────────────────── */
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}
.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 16px;
}

/* ── Utility buttons ────────────────────────────────────────────────────────── */
.btn {
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s;
  display: inline-block;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background-color: #007bff;
  color: white;
}
.btn-primary:hover {
  background-color: #0056b3;
  color: white;
}
.btn-secondary {
  background-color: #6c757d;
  color: white;
}
.btn-secondary:hover {
  background-color: #5a6268;
  color: white;
}
.btn-danger {
  background-color: #dc3545;
  color: white;
}
.btn-danger:hover {
  background-color: #c82333;
  color: white;
}
.btn-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

/* ── Modal overlay ──────────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 50%;
  max-width: 500px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.modal-header h3 { margin: 0; color: #dc3545; }
.modal-body  { margin-bottom: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close:hover { color: #000; }

/* ── Skeleton loader ────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
  display: inline-block;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Back navigation ────────────────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: #007bff;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.back-button {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  background-color: #f0f0f0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}
.back-button:hover { background-color: #e0e0e0; }

/* ── Gift membership promo banner ───────────────────────────────────────────── */
.gift-promo {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px auto;
  max-width: 700px;
  background: #f5f3eb;
  border: 1px solid #c8c49a;
  border-radius: 8px;
  padding: 18px 20px;
}
.gift-promo i {
  font-size: 2rem;
  color: #66643A;
  flex-shrink: 0;
}
.gift-promo div { flex: 1; }
.gift-promo div strong { display: block; margin-bottom: 4px; }
.gift-promo div p { margin: 0; font-size: .9rem; color: #555; }

@media (max-width: 768px) {
  .gift-promo { flex-direction: column; text-align: center; }
}
