/*
Theme Name: MathAcademy
Theme URI: https://maths-and-co.fr
Description: Plateforme d'apprentissage des mathématiques
Version: 5.1
Author: MathAcademy
Text Domain: mathacademy
*/

:root {
  /* Palette principale — douce et variée */
  --blue:       #4A6FA5;
  --blue-dark:  #2D4A6B;
  --blue-light: #6B9ED4;

  --green:      #5B8A6F;
  --green-dark: #3D6B54;

  --amber:      #C4913A;
  --amber-dark: #9E6E1F;

  --mauve:      #9B6B9E;
  --mauve-dark: #7A4E7D;

  --text:       #374151;
  --text-light: #6B7280;
  --dark:       #1F2937;
  --border:     #E5E7EB;
  --light:      #F9FAFB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  overflow-x: hidden;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  margin-bottom: 1rem;
  font-weight: 700;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== ANIMATIONS ==================== */

/* Entrées (une seule fois, pas en boucle) */
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-35px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(35px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

/* Fond hero — très lent, discret */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Float décoratif — lent */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* Pulse très léger — uniquement carte featured */
@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(74, 111, 165, 0.15); }
  50%       { box-shadow: 0 12px 32px rgba(74, 111, 165, 0.28); }
}

/* ==================== NAVBAR ==================== */

.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  animation: slideInDown 0.6s ease-out;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.3s ease;
}

.nav-menu a:hover { color: var(--blue); }
.nav-menu a:hover::after { width: 100%; }

.auth-buttons { display: flex; gap: 1rem; }

/* ==================== BUTTONS ==================== */

.btn {
  padding: 0.6rem 1.6rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(74, 111, 165, 0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: white;
  border-color: transparent;
}

/* ==================== HERO ==================== */

.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 50%, #5B7FA8 100%);
  background-size: 300% 300%;
  animation: gradientShift 14s ease infinite;
  color: white;
  padding: 6rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero h1 { color: white; font-size: 3.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: 0.95; margin-bottom: 1.5rem; }

/* ==================== CARDS ==================== */

.course-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.4s ease;
  animation: fadeInScale 0.7s ease-out both;
}

.course-card:hover {
  box-shadow: 0 12px 32px rgba(74, 111, 165, 0.15);
  transform: translateY(-6px);
}

.course-header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: white;
  padding: 2rem;
}

.course-body { padding: 1.5rem; }
.course-title { color: var(--dark); font-size: 1.4rem; margin-bottom: 0.5rem; }
.course-description { color: var(--text-light); margin-bottom: 1rem; font-size: 0.95rem; }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

/* ==================== FEATURE BOX ==================== */

.feature-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  transition: all 0.4s ease;
  animation: fadeInScale 0.7s ease-out both;
}

.feature-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(74, 111, 165, 0.12);
}

.feature-icon {
  display: inline-block;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  transition: transform 0.4s ease;
}

.feature-box:hover .feature-icon { transform: scale(1.18); }

/* ==================== TESTIMONIALS ==================== */

.testimonial-card {
  animation: fadeInScale 0.7s ease-out both;
  transition: all 0.35s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 30px rgba(74, 111, 165, 0.12);
}

/* ==================== PRICING ==================== */

.pricing-card {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  border: 2px solid var(--border);
  text-align: center;
  transition: all 0.4s ease;
  animation: fadeInScale 0.8s ease-out both;
}

.pricing-card:hover {
  border-color: var(--blue);
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(74, 111, 165, 0.15);
}

.pricing-card.featured {
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(74, 111, 165, 0.15);
  animation: subtlePulse 6s ease-in-out infinite;
}

.price { font-size: 2.5rem; color: var(--blue); font-weight: 700; margin: 1rem 0; }

.features { list-style: none; margin: 2rem 0; text-align: left; }
.features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.features li:before {
  content: "✓";
  color: var(--green);
  font-weight: bold;
  margin-right: 0.75rem;
}

/* ==================== FOOTER ==================== */

.footer {
  background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
  color: #D1D5DB;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 { color: white; margin-bottom: 1rem; }
.footer-section a { color: #9CA3AF; display: block; margin-bottom: 0.5rem; }
.footer-section a:hover { color: var(--blue-light); }

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  color: #6B7280;
}

/* ==================== INPUTS ==================== */

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Navbar */
  .nav-menu { display: none; }

  /* Hero */
  .hero { padding: 4rem 0; }
  .hero h1 { font-size: 2.2rem; }

  /* Grids */
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
  }

  /* Désactiver les hover-lifts sur mobile/touch */
  .course-card:hover,
  .feature-box:hover,
  .testimonial-card:hover,
  .pricing-card:hover { transform: none; box-shadow: none; }

  /* Feature box */
  .feature-box { padding: 1.6rem; }

  /* Pricing */
  .pricing-card { padding: 1.5rem; }
  .price { font-size: 2rem; }

  /* Footer */
  .footer-content { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer { padding: 2rem 0 1rem; margin-top: 2rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .hero h1 { font-size: 1.9rem; }
  .courses-grid { gap: 1rem; }
  .feature-box { padding: 1.25rem; }
  .pricing-card { padding: 1.25rem; }
  .btn { padding: 0.55rem 1.2rem; font-size: 0.92rem; }
}


/* ==================== ACCESSIBILITY ==================== */

/* Focus ring for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}
*:focus:not(:focus-visible) { outline: none; }

/* FAQ toggle: + rotates to × when open */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details summary > span:last-child {
  display: inline-block;
  transition: transform 0.25s ease;
  line-height: 1;
}
details[open] summary > span:last-child {
  transform: rotate(45deg);
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1ms !important;
  }
}
