/* ============================================
   style.css — Styles personnalisés pour la plateforme de cagnottes
   Complète Tailwind CSS (chargé via CDN)
   ============================================ */

/* Import Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ============================================
   Variables & Reset
   ============================================ */
:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --blue: #3b82f6;
  --blue-dark: #2563eb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

* {
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ============================================
   Barre de progression animée
   ============================================ */
.progress-bar {
  background: var(--gray-200);
  border-radius: 9999px;
  height: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: linear-gradient(90deg, var(--green), #4ade80);
  height: 100%;
  border-radius: 9999px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   Cartes de cagnottes
   ============================================ */
.cagnotte-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.cagnotte-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
}

.cagnotte-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cagnotte-card:hover img {
  transform: scale(1.05);
}

.cagnotte-card .card-image {
  overflow: hidden;
}

/* ============================================
   Boutons de montants prédéfinis
   ============================================ */
.amount-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.amount-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: #f0fdf4;
}

.amount-btn.selected {
  border-color: var(--green);
  background: var(--green);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* ============================================
   Bouton principal CTA
   ============================================ */
.btn-primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Badges de réassurance
   ============================================ */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================
   Flux de dons
   ============================================ */
.don-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100);
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.don-item:last-child {
  border-bottom: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.don-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.don-amount {
  color: var(--green);
  font-weight: 700;
}

.don-message {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-top: 2px;
}

.don-date {
  color: var(--gray-400);
  font-size: 0.75rem;
}

/* ============================================
   Page de confirmation
   ============================================ */
.confirmation-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #4ade80);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ============================================
   Header
   ============================================ */
.site-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--gray-800);
  color: white;
  padding: 40px 0 24px;
}

.site-footer a {
  color: #93c5fd;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: white;
}

/* ============================================
   Cover image (page cagnotte)
   ============================================ */
.cover-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 16px;
}

@media (max-width: 640px) {
  .cover-image {
    height: 200px;
    border-radius: 12px;
  }
}

/* ============================================
   Champ de montant libre
   ============================================ */
.amount-input {
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
  width: 140px;
  transition: border-color 0.2s;
  outline: none;
}

.amount-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* ============================================
   Loader / Spinner
   ============================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Admin
   ============================================ */
.admin-login {
  max-width: 400px;
  margin: 80px auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.admin-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:hover td {
  background: #f0fdf4;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-confirmed {
  background: #dcfce7;
  color: #166534;
}

.status-pending {
  background: #fef9c3;
  color: #854d0e;
}

.status-failed {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================
   Responsive utilities
   ============================================ */
@media (max-width: 640px) {
  .trust-badges {
    gap: 12px;
    font-size: 0.75rem;
  }

  .amount-btn {
    padding: 10px 16px;
    font-size: 1rem;
    min-width: 64px;
  }
}
