/* Styles principaux */

/* Variables */
:root {
  --color-primary: rgb(16, 185, 129);
  --color-primary-dark: rgb(5, 150, 105);
  --color-secondary: rgb(59, 130, 246);
  --color-accent: rgb(245, 158, 11);
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  color: #1a1a1a;
}

.hidden-page {
  display: none;
}

/* Hero section */
.hero-bg {
  background: linear-gradient(to right bottom, 
    rgba(16, 185, 129, 0.95), 
    rgba(5, 150, 105, 0.95)
  ), url('../images/LOGO AFAD.jpeg') center/cover;
  background-attachment: fixed;
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

/* Navigation */
.nav-link {
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-secondary:hover {
  background: white;
  color: var(--color-primary);
  transform: translateY(-2px);
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.6s ease-out forwards;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-bg {
    min-height: 60vh;
    background-attachment: scroll;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }
}

/* Utilitaires */
.gradient-text {
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Styles spécifiques pour les sections */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-dark));
  margin: 1rem auto;
  border-radius: 2px;
}

#paypal-button-container {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#paypal-button-container[data-state='loading'],
#paypal-button-container[data-state='error'] {
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.paypal-inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #2563eb;
  font-weight: 600;
}

.paypal-inline-loader::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  border: 2px solid rgba(37, 99, 235, 0.35);
  border-top-color: #2563eb;
  animation: paypal-spin 1s linear infinite;
}

.paypal-inline-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 360px;
  width: 100%;
  border: 1px solid rgba(220, 38, 38, 0.15);
}

body.paypal-modal-open {
  overflow: hidden;
}

.paypal-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.paypal-modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.paypal-modal-panel {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 720px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 40px 80px -24px rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
  outline: none;
}

.paypal-modal-overlay.is-visible .paypal-modal-panel {
  transform: translateY(0) scale(1);
}

.paypal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 0;
}

.paypal-modal-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.paypal-modal-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0070ba, #003087);
  font-size: 1.25rem;
}

.paypal-modal-text h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #0f172a;
  font-weight: 700;
}

.paypal-modal-text p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  color: #475569;
}

.paypal-modal-close {
  border: none;
  background: #f1f5f9;
  border-radius: 9999px;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.paypal-modal-close:hover {
  background: #e2e8f0;
}

.paypal-modal-body {
  padding: 24px 28px 28px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paypal-modal-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 0.95rem;
}

.paypal-modal-status::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  border: 2px solid rgba(37, 99, 235, 0.35);
  border-top-color: #2563eb;
  animation: paypal-spin 1s linear infinite;
}

.paypal-modal-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px dashed rgba(148, 163, 184, 0.5);
}

.paypal-modal-helper {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

.paypal-modal-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.paypal-modal-guarantee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #0f172a;
  font-weight: 600;
}

@keyframes paypal-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .paypal-modal-overlay {
    padding: 16px;
  }

  .paypal-modal-panel {
    max-width: 100%;
    border-radius: 18px;
    max-height: calc(100vh - 32px);
  }

  .paypal-modal-header {
    padding: 20px 20px 0;
  }

  .paypal-modal-body {
    padding: 20px 20px 24px;
  }

  .paypal-modal-footer {
    padding: 16px 20px 20px;
  }
}