/*
 * Style principal de Food Allergy Card
 *
 * Ce fichier définit l’apparence générale du site. Il utilise des couleurs
 * sombres pour mettre en valeur le contenu et assure une mise en page
 * responsive pour tous les appareils. Les variables CSS sont utilisées pour
 * faciliter les ajustements de couleur et de taille.
 */

:root {
  --color-bg: #0a0a23;
  --color-bg-alt: #16163a;
  --color-text: #ffffff;
  --color-primary: #B14D4D;
  --color-accent: #8F3636;
  --color-hero-start: #B14D4D;
  --color-hero-end: #8F3636;
  --nav-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #2a2a2a;
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

/* Main card container */
body > header,
body > main,
body > footer {
  width: 100%;
  max-width: 1280px;
}

body > header {
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

body > main {
  background-color: var(--color-bg);
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

body > footer {
  border-radius: 0 0 1rem 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

header {
  position: relative;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(143, 54, 54, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem 1rem 0 0;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: bold;
}

.brand-icon {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
}

.nav-links li {
  margin-left: 1.5rem;
  position: relative;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-accent);
}

.arrow {
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

/* Dropdown menu */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--color-bg-alt);
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-content li a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--color-text);
  white-space: nowrap;
}

.dropdown-content li a:hover {
  background-color: var(--color-bg);
  color: var(--color-accent);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Hamburger menu button (hidden on desktop) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger {
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--color-text);
  position: relative;
  transition: background-color 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--color-text);
  position: absolute;
  transition: transform 0.3s ease;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

/* Hamburger animation when menu is open */
.menu-toggle.active .hamburger {
  background-color: transparent;
}

.menu-toggle.active .hamburger::before {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .hamburger::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hero section */
.hero {
  width: 100%;
  background: linear-gradient(135deg, var(--color-hero-start) 0%, var(--color-hero-end) 100%);
  background-color: var(--color-hero-start);
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
  min-height: 70vh;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('assets/background-line.png');
  background-repeat: repeat;
  background-size: 300px;
  opacity: 0.15;
  pointer-events: none;
}

.hero-content {
  flex: 1 1 420px;
  max-width: 540px;
  position: relative;
  z-index: 1;
}

.hero-logo {
  max-width: 320px;
  height: auto;
  margin-bottom: 1.5rem;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  line-height: 1.7;
  max-width: 480px;
  color: rgba(255, 255, 255, 0.95);
}

.store-buttons {
  display: flex;
  align-items: center;
}

.store-link img {
  height: 50px;
  margin-right: 1rem;
  display: block;
  transition: transform 0.2s ease;
}

.store-link img:hover {
  transform: scale(1.05);
}

.hero-image {
  flex: 1 1 320px;
  max-width: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Mr. Crunch Section */
.mr-crunch-section {
  background-color: #ffffff;
  padding: 5rem 2rem;
}

.mr-crunch-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.mr-crunch-image {
  flex: 0 1 350px;
}

.mr-crunch-image img {
  width: 100%;
  max-width: 350px;
  height: auto;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
}

.mr-crunch-content {
  flex: 1 1 400px;
  max-width: 500px;
}

.mr-crunch-content h2 {
  font-size: 2.5rem;
  color: var(--color-hero-start);
  margin-bottom: 0.5rem;
}

.mr-crunch-subtitle {
  font-size: 1.3rem;
  color: #666;
  margin-bottom: 2rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  font-size: 1.1rem;
  color: #333;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(177, 77, 77, 0.1);
  border-radius: 50%;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem;
  text-align: center;
  background-color: var(--color-bg-alt);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Generic page content */
.container {
  max-width: 900px;
  margin: 3rem auto 4rem;
  padding: 0 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--color-accent);
}

article p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-form label {
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
  background-color: var(--color-bg-alt);
  color: var(--color-text);
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form button {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.contact-form button:hover {
  background-color: var(--color-primary);
  color: var(--color-bg);
}

.contact-form button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Form feedback messages */
.form-message {
  padding: 1rem 1.5rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.form-message p {
  margin: 0;
}

.form-success {
  background-color: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  body > header {
    border-radius: 0.75rem 0.75rem 0 0;
  }

  body > footer {
    border-radius: 0 0 0.75rem 0.75rem;
  }

  /* Show hamburger menu on mobile */
  .menu-toggle {
    display: block;
  }

  /* Hide nav links by default on mobile */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(143, 54, 54, 0.98);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 1rem 1rem;
  }

  /* Show nav links when menu is active */
  .nav-links.active {
    max-height: 500px;
    opacity: 1;
  }

  .nav-links li {
    margin: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links li a {
    display: block;
    padding: 1rem 1.5rem;
    width: 100%;
  }

  /* Dropdown adjustments for mobile */
  .dropdown-content {
    display: block !important; /* Override desktop display: none */
    position: static;
    box-shadow: none;
    background-color: var(--color-bg);
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .dropdown.active .dropdown-content {
    max-height: 300px;
  }

  .dropdown-content li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  }

  .dropdown-content li a {
    padding-left: 2.5rem;
    font-size: 0.9rem;
  }

  /* Override hover behavior on mobile */
  .dropdown:hover .dropdown-content {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 3rem 1.5rem;
  }

  .hero-logo {
    max-width: 250px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .hero-image {
    max-width: 320px;
  }

  .hero-image img {
    max-height: 400px;
  }

  /* Mr. Crunch mobile */
  .mr-crunch-section {
    padding: 3rem 1.5rem;
  }

  .mr-crunch-container {
    gap: 2rem;
  }

  .mr-crunch-image {
    flex: 0 1 250px;
    order: -1;
  }

  .mr-crunch-image img {
    max-width: 250px;
  }

  .mr-crunch-content h2 {
    font-size: 1.8rem;
    text-align: center;
  }

  .mr-crunch-subtitle {
    text-align: center;
    font-size: 1.1rem;
  }

  .feature-list li {
    font-size: 1rem;
  }
}

/* ------------------------------------------------------------------ */
/* Custom sections for Mr Crunch and screenshots                          */
/* ------------------------------------------------------------------ */

/* Section mettant en avant Mr Crunch, la mascotte de l’application */
.cool-character {
  padding: 4rem 2rem;
  background-color: var(--color-bg-alt);
  text-align: center;
}

.cool-character h2 {
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.character-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character-image {
  width: 180px;
  height: auto;
  border-radius: 50%;
  margin-bottom: 1rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.character-container p {
  max-width: 600px;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Section des captures d’écran avec slider */
.screenshots {
  padding: 4rem 2rem;
  text-align: center;
}

.screenshots h2 {
  color: var(--color-accent);
  margin-bottom: 2rem;
}

.slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.slides {
  display: flex;
  transition: transform 0.6s ease;
}

.slides img {
  width: 100%;
  flex-shrink: 0;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.slider-controls {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.slider-controls button {
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--color-text);
  font-size: 2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.slider-controls button:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

/* ------------------------------------------------------------------ */
/* Language selector                                                   */
/* ------------------------------------------------------------------ */

.lang-selector {
  margin-left: 1rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.current-lang {
  font-size: 0.9rem;
}

.lang-dropdown {
  min-width: 150px;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-option.active {
  color: var(--color-accent);
  background-color: rgba(255, 183, 3, 0.1);
}

/* Mobile language selector adjustments */
@media (max-width: 768px) {
  .lang-selector .dropdown-content,
  .lang-selector .lang-dropdown {
    display: block !important;
    position: static;
    box-shadow: none;
    background-color: var(--color-bg);
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .lang-selector.active .dropdown-content,
  .lang-selector.active .lang-dropdown {
    max-height: 300px;
  }

  .lang-selector:hover .dropdown-content,
  .lang-selector:hover .lang-dropdown {
    display: none;
  }
}
