/* ============================================
   Styles pour les pages d'abonnement
   ============================================ */

/* Page de tarification */
.pricing-page {
  padding: 3rem 0;
  min-height: 100vh;
}

.pricing-header {
  text-align: center;
  margin-bottom: 3rem;
}

.pricing-header h1 {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.pricing-header .subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.current-plan-badge {
  margin-top: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.badge-free {
  background-color: #6c757d;
  color: white;
}

.badge-premium {
  background-color: #ffc107;
  color: #333;
}

.badge-coach_pro {
  background-color: #9c27b0;
  color: white;
}

/* Grille de tarification */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

.pricing-card {
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card.current {
  border: 3px solid #28a745;
}

.pricing-card.premium {
  position: relative;
}

.pricing-card.premium::before {
  content: '⭐ Populaire';
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: #ffc107;
  color: #333;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1;
}

.pricing-card-header {
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.pricing-card.premium .pricing-card-header {
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.pricing-card.coach_pro .pricing-card-header {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  color: white;
}

.tier-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tier-name {
  font-size: 1.75rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.tier-price {
  margin-top: 1rem;
}

.tier-price .price {
  font-size: 2.5rem;
  font-weight: bold;
}

.tier-price .period {
  font-size: 1rem;
  color: #666;
}

.pricing-card-body {
  padding: 2rem;
  flex-grow: 1;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.feature-item:hover {
  background-color: #f8f9fa;
}

.feature-item.featured {
  background-color: #e8f5e9;
}

.feature-icon {
  font-size: 1.5rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.feature-text {
  flex-grow: 1;
  line-height: 1.6;
}

.pricing-card-footer {
  padding: 2rem;
  border-top: 1px solid #e9ecef;
}

.btn-block {
  display: block;
  text-align: center;
}

.btn-outline {
  background: transparent;
  border: 2px solid #007bff;
  color: #007bff;
}

.btn-outline:hover {
  background: #007bff;
  color: white;
}

.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Résumé d'utilisation */
.usage-summary {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 3rem;
}

.usage-summary h3 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.usage-item {
  text-align: center;
}

.usage-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.usage-bar {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.usage-progress {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.usage-text {
  font-size: 0.9rem;
  color: #666;
}

/* FAQ */
.pricing-faq {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
}

.pricing-faq h3 {
  text-align: center;
  margin-bottom: 2rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.faq-item h4 {
  color: #333;
  margin-bottom: 0.5rem;
}

.faq-item p {
  color: #666;
  line-height: 1.6;
}

/* Page de gestion */
.manage-subscription-page {
  padding: 3rem 0;
  background-color: #f5f7fa;
  min-height: 100vh;
}

.subscription-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.current-plan-card,
.usage-stats-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.plan-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.plan-icon {
  font-size: 3rem;
  margin-right: 1rem;
}

.plan-info h2 {
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: #28a745;
}

.plan-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.status-active {
  background-color: #d4edda;
  color: #155724;
}

.status-cancelled {
  background-color: #fff3cd;
  color: #856404;
}

.status-expired {
  background-color: #f8d7da;
  color: #721c24;
}

.plan-dates {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e9ecef;
}

.warning-text {
  color: #dc3545;
  font-weight: 600;
}

/* Stats d'utilisation */
.stat-item {
  margin-bottom: 1.5rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-weight: bold;
  color: #667eea;
}

.stat-bar {
  width: 100%;
  height: 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.stat-progress {
  height: 100%;
  background-color: #667eea;
  transition: width 0.3s ease;
}

/* Actions */
.subscription-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

/* Fonctionnalités */
.features-summary {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.feature-badge {
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.feature-badge:hover {
  transform: scale(1.05);
}

.feature-badge.enabled {
  background-color: #d4edda;
  color: #155724;
  border: 2px solid #c3e6cb;
}

.feature-badge.disabled {
  background-color: #f8d7da;
  color: #721c24;
  border: 2px solid #f5c6cb;
  opacity: 0.6;
}

/* Promo upgrade */
.upgrade-promo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.upgrade-promo h3 {
  margin-bottom: 1rem;
}

.upgrade-promo ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  text-align: left;
  display: inline-block;
}

.upgrade-promo li {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Pages de succès et d'annulation */
.success-page,
.cancelled-page {
  padding: 3rem 0;
  background-color: #f5f7fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.success-card,
.cancelled-card {
  background: white;
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #28a745;
  color: white;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.cancelled-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: #dc3545;
  color: white;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-message,
.cancelled-message {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
}

.subscription-details {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 2rem 0;
  text-align: left;
}

.next-steps {
  margin: 2rem 0;
  text-align: left;
}

.next-steps ul {
  list-style: none;
  padding: 0;
}

.next-steps li {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.help-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.help-section h3 {
  margin-bottom: 0.5rem;
}

.help-section p {
  color: #666;
  margin-bottom: 1rem;
}

.link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

/* Badge utilisateur (pour le header) */
.user-subscription-badge {
  display: inline-block;
  margin-left: 0.5rem;
}

.user-subscription-badge .badge {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .pricing-header h1 {
    font-size: 2rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .subscription-actions {
    flex-direction: column;
  }

  .action-buttons {
    flex-direction: column;
  }
  
  /* ============================================
     Notifications Toast Modernes
     ============================================ */
  
  .toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    min-width: 320px;
    max-width: 500px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  .toast-notification.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-100px);
  }
  
  .toast-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
  }
  
  .toast-notification.success .toast-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: successPulse 0.6s ease;
  }
  
  .toast-notification.error .toast-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: errorShake 0.5s ease;
  }
  
  .toast-content {
    flex: 1;
  }
  
  .toast-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: #2d3748;
  }
  
  .toast-message {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.4;
  }
  
  .toast-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f7fafc;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: #a0aec0;
    font-size: 1.2rem;
    font-weight: bold;
  }
  
  .toast-close:hover {
    background: #edf2f7;
    color: #4a5568;
    transform: rotate(90deg);
  }
  
  @keyframes successPulse {
    0% {
      transform: scale(0);
    }
    50% {
      transform: scale(1.1);
    }
    100% {
      transform: scale(1);
    }
  }
  
  @keyframes errorShake {
    0%, 100% {
      transform: translateX(0);
    }
    25% {
      transform: translateX(-5px);
    }
    75% {
      transform: translateX(5px);
    }
  }
  
  /* Responsive pour les notifications */
  @media (max-width: 576px) {
    .toast-notification {
      min-width: calc(100% - 40px);
      left: 20px;
      right: 20px;
      transform: translateX(0) translateY(-100px);
    }
  
    .toast-notification.show {
      transform: translateX(0) translateY(0);
    }
  
    .toast-notification.hide {
      transform: translateX(0) translateY(-100px);
    }
  }

  .btn-block {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .pricing-page,
  .manage-subscription-page {
    padding: 1.5rem 0;
  }

  .pricing-card {
    margin-bottom: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}
