/* ============================================================================
   CORRECTIFS D'ACCESSIBILITÉ - WCAG AA
   ============================================================================
   Ce fichier contient tous les correctifs pour améliorer l'accessibilité
   et garantir un contraste minimum de 4.5:1 pour le texte normal
   et 3:1 pour le texte large (WCAG AA)
   ============================================================================ */

/* ============================================================================
   1. AMÉLIORATION DES CONTRASTES
   ============================================================================ */

/* Variables améliorées pour meilleur contraste */
:root {
  /* Couleurs de texte avec contraste amélioré */
  --text-primary-enhanced: #ffffff; /* Ratio 15:1 sur space-cadet */
  --text-secondary-enhanced: #d4d6e3; /* Ratio 10:1 sur space-cadet */
  --text-muted-enhanced: #b5b7c9; /* Ratio 7:1 sur space-cadet */
}

/* Hero Section - Amélioration des contrastes */
.hero-badge {
  color: var(--text-primary-enhanced);
  background: rgba(0, 142, 150, 0.25); /* Augmentation de l'opacité */
}

.hero-badge span {
  color: var(--text-primary-enhanced);
}

.hero-greeting {
  color: #7ff4f9; /* Cyan plus clair pour meilleur contraste */
}

.hero-description {
  color: var(--text-secondary-enhanced);
}

.stat-label {
  color: var(--text-secondary-enhanced);
}

/* Window Code - Amélioration du contraste */
.window-title {
  color: var(--text-secondary-enhanced);
}

.window-dots span {
  opacity: 1; /* Toujours visible à 100% */
}

.code-line {
  color: var(--text-primary-enhanced);
}

/* Assurer que les lignes de code animées restent visibles */
.code-line {
  opacity: 0;
  animation: code-appear 0.5s ease forwards;
}

@keyframes code-appear {
  to {
    opacity: 1; /* Opacité complète à la fin de l'animation */
  }
}

.code-attr {
  color: #b8aefc; /* Purple plus clair pour meilleur contraste */
}

.code-value {
  color: #f0f1f5; /* Blanc cassé pour excellent contraste */
}

.code-property {
  color: #7ff4f9; /* Cyan clair */
}

.code-bracket {
  color: #d4d6e3;
}

/* Section Numbers - Amélioration du contraste */
.section-number {
  color: #7ff4f9; /* Cyan plus clair */
  background: rgba(0, 142, 150, 0.25); /* Augmentation de l'opacité du fond */
}

/* Links - Amélioration du contraste (minimum 4.5:1) */
a {
  color: #7ff4f9 !important; /* Cyan plus clair pour meilleur contraste */
}

a:hover {
  color: #a8f9fc !important; /* Encore plus clair au hover */
}

a:focus {
  outline: 2px solid #7ff4f9;
  outline-offset: 2px;
}

/* Links spécifiques */
.contact-value a,
.rgpd-consent-text a,
#rgpdModalTrigger {
  color: #7ff4f9 !important;
  text-decoration: underline;
}

.contact-value a:hover,
.rgpd-consent-text a:hover,
#rgpdModalTrigger:hover {
  color: #a8f9fc !important;
}

/* Navigation Links */
.nav-link {
  color: var(--text-primary-enhanced);
}

.nav-link:hover {
  color: #7ff4f9;
}

/* Paragraphes - Amélioration du contraste */
p {
  color: var(--text-secondary-enhanced);
}

/* Headings - Amélioration du contraste */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary-enhanced);
}

/* Labels et textes de formulaire */
label {
  color: var(--text-primary-enhanced);
}

/* Inputs et textareas */
input,
textarea,
select {
  color: var(--text-primary-enhanced);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted-enhanced);
  opacity: 1;
}

/* Buttons */
button {
  color: inherit; /* Hérite de la couleur du parent ou utilise celle définie */
}

/* Small text */
small {
  color: var(--text-secondary-enhanced);
}

/* Divs et spans - S'assurer qu'ils héritent de bonnes couleurs */
div {
  color: inherit;
}

/* Spans contenant du texte doivent avoir un bon contraste */
span:not([class*="icon"]):not([aria-hidden="true"]) {
  color: inherit;
}

/* List items */
li {
  color: inherit;
}

/* Texte générique - S'assurer du contraste minimum */
body * {
  /* Ne pas forcer une couleur, mais s'assurer que le minimum est respecté */
  /* Les éléments sans couleur spécifique héritent de body */
}

/* Texte noir ou très sombre interdit sur fond sombre */
/* Note: min-color-contrast est une propriété future CSS non encore supportée */
/* Nous utilisons des couleurs spécifiques qui garantissent un ratio de contraste de 4.5:1 */

/* Hero Stats amélioration */
.hero-stat-item {
  background: rgba(0, 142, 150, 0.15);
  border: 1px solid rgba(94, 238, 245, 0.3);
}

.hero-stat-item:hover {
  background: rgba(0, 142, 150, 0.25);
  border-color: rgba(94, 238, 245, 0.5);
}

/* Boutons - Amélioration du contraste */
/* .btn-primary conserve son style original qui est déjà conforme WCAG AA */
/* Le texte cyan #5eeef5 a un excellent contraste sur le fond */

.btn-secondary {
  background: rgba(0, 142, 150, 0.2);
  border: 2px solid #7ff4f9;
  color: #ffffff !important;
}

.btn-secondary:hover {
  background: rgba(0, 142, 150, 0.35);
  border-color: #a8f9fc;
  color: #ffffff !important;
}

.btn-cv {
  color: #ffffff !important;
}

.btn-submit {
  color: #ffffff !important;
}

/* Hamburger menu button */
.hamburger {
  color: var(--text-primary-enhanced);
}

.hamburger-line {
  background: var(--text-primary-enhanced);
}

/* ============================================================================
   2. AMÉLIORATION DE LA VISIBILITÉ DES ÉLÉMENTS AVEC OPACITY
   ============================================================================ */

/* Grid Overlay - Rendre plus visible sans surcharger */
.grid-overlay {
  opacity: 0.08; /* Augmentation légère pour plus de visibilité */
}

/* Éléments décoratifs - Augmentation minimale de l'opacity */
.floating-card {
  opacity: 0.5; /* Au lieu de 0.15-0.3 */
}

.gradient-orb {
  opacity: 0.4; /* Au lieu de 0.3 */
}

/* S'assurer que les éléments avec opacity ne contiennent pas de texte important */
/* Si un élément a du texte ET une opacity < 1, le texte doit être rendu opaque */
.hero-badge span,
.section-number,
.skill-tag,
.project-tag {
  opacity: 1 !important; /* Le texte est toujours 100% opaque */
}

/* ============================================================================
   3. CORRECTIFS SPÉCIFIQUES POUR ÉLÉMENTS PROBLÉMATIQUES
   ============================================================================ */

/* Span dans hero-stats */
.hero-stats span {
  color: var(--text-secondary-enhanced);
}

/* Accents et decorations */
.accent-text,
.logo-dot {
  color: #7ff4f9;
}

/* Quote decoration */
.quote-decoration {
  color: rgba(94, 238, 245, 0.4);
  opacity: 1;
}

/* Timeline items */
.timeline-content h3 {
  color: var(--text-primary-enhanced);
}

.timeline-content p {
  color: var(--text-secondary-enhanced);
}

.timeline-date {
  color: #7ff4f9;
}

/* Contact form */
.contact-form label {
  color: var(--text-primary-enhanced);
}

.contact-form input,
.contact-form textarea {
  color: var(--text-primary-enhanced);
  border-color: rgba(94, 238, 245, 0.3);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted-enhanced);
  opacity: 1;
}

/* Footer */
footer {
  color: var(--text-secondary-enhanced);
}

footer a {
  color: #7ff4f9;
}

footer a:hover {
  color: #a8f9fc;
}

/* ============================================================================
   CORRECTIFS SPÉCIFIQUES POUR CARTES ET SECTIONS
   ============================================================================ */

/* Timeline items */
.timeline-title {
  color: var(--text-primary-enhanced) !important;
}

.timeline-school {
  color: #7ff4f9 !important;
}

.timeline-description {
  color: var(--text-secondary-enhanced) !important;
}

.timeline-date {
  color: #7ff4f9 !important;
}

/* Skill cards */
.skill-card h3 {
  color: var(--text-primary-enhanced) !important;
}

.skill-card p {
  color: var(--text-secondary-enhanced) !important;
}

/* Project cards */
.project-card h3 {
  color: var(--text-primary-enhanced) !important;
}

.project-card p {
  color: var(--text-secondary-enhanced) !important;
}

.project-tag {
  color: var(--text-primary-enhanced) !important;
}

.project-tech span {
  color: var(--text-secondary-enhanced) !important;
}

/* Contact cards */
.contact-card {
  color: var(--text-primary-enhanced) !important;
}

.contact-label {
  color: var(--text-secondary-enhanced) !important;
}

.contact-value {
  color: var(--text-primary-enhanced) !important;
}

.contact-value a {
  color: #7ff4f9 !important;
}

/* Playground cards */
.playground-card h3 {
  color: var(--text-primary-enhanced) !important;
}

.playground-card p {
  color: var(--text-secondary-enhanced) !important;
}

/* Section titles */
.section-title {
  color: var(--text-primary-enhanced) !important;
}

/* Window content (code window) */
.window-content {
  color: var(--text-primary-enhanced);
}

/* Tech showcase */
.tech-item-front h3 {
  color: var(--text-primary-enhanced) !important;
}

.back-content h4 {
  color: var(--text-primary-enhanced) !important;
}

.back-content p {
  color: var(--text-secondary-enhanced) !important;
}

/* Form elements spécifiques */
.form-group label {
  color: var(--text-primary-enhanced) !important;
}

.contact-form h2 {
  color: var(--text-primary-enhanced) !important;
}

.form-required-note {
  color: var(--text-secondary-enhanced) !important;
}

.rgpd-consent-text {
  color: var(--text-secondary-enhanced) !important;
}

.rgpd-notice small {
  color: var(--text-secondary-enhanced) !important;
}

/* Skill tags */
.skill-tag {
  color: var(--text-primary-enhanced) !important;
  background: rgba(0, 142, 150, 0.2) !important;
  border: 1px solid rgba(94, 238, 245, 0.3) !important;
}

/* Certifications */
.cert-card h4 {
  color: var(--text-primary-enhanced) !important;
}

.cert-card p {
  color: var(--text-secondary-enhanced) !important;
}

/* ============================================================================
   CORRECTIFS POUR ÉLÉMENTS TEXTE DANS DES CONTENEURS SPÉCIAUX
   ============================================================================ */

/* Hero section texts */
.hero-title {
  color: var(--text-primary-enhanced) !important;
}

.hero-subtitle {
  color: var(--text-primary-enhanced) !important;
}

.typing-text {
  color: var(--text-primary-enhanced) !important;
}

/* About section */
.about-text p {
  color: var(--text-secondary-enhanced) !important;
}

/* Stats */
.stat-value {
  color: var(--text-primary-enhanced) !important;
}

/* Technologies list */
.tech-list li {
  color: var(--text-secondary-enhanced) !important;
}

/* Messages and alerts */
.message {
  color: var(--text-primary-enhanced) !important;
}

.alert {
  color: var(--text-primary-enhanced) !important;
}

/* Modal content */
.modal-content {
  color: var(--text-primary-enhanced) !important;
}

.modal-content p {
  color: var(--text-secondary-enhanced) !important;
}

.modal-content h2,
.modal-content h3 {
  color: var(--text-primary-enhanced) !important;
}

/* ============================================================================
   4. FOCUS ET NAVIGATION CLAVIER
   ============================================================================ */

/* Amélioration des indicateurs de focus pour navigation clavier */
*:focus {
  outline: 2px solid #7ff4f9;
  outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #7ff4f9;
  outline-offset: 2px;
}

/* Skip to main content link (accessibilité) */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 1em;
  background-color: #1a1b37;
  color: #ffffff;
  text-decoration: none;
  border: 2px solid #7ff4f9;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
}

/* ============================================================================
   5. ÉTATS HOVER ET ACTIVE AMÉLIORÉS
   ============================================================================ */

/* Boutons avec meilleur feedback visuel */
button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 142, 150, 0.4);
}

button:active,
.btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0, 142, 150, 0.2);
}

/* ============================================================================
   6. RESPONSIVE - MAINTIEN DU CONTRASTE SUR MOBILE
   ============================================================================ */

@media (max-width: 768px) {
  /* S'assurer que les textes restent lisibles sur mobile */
  body {
    font-size: 16px; /* Jamais moins de 16px pour éviter le zoom iOS */
  }

  .hero-badge,
  .section-number,
  .nav-link {
    /* Augmenter légèrement les tailles de police sur mobile */
    font-size: 0.95rem;
  }

  /* Améliorer le contraste des overlays sur mobile */
  .menu-overlay {
    background: rgba(0, 0, 0, 0.85);
  }
}

/* ============================================================================
   7. PRINT STYLES - ACCESSIBILITÉ À L'IMPRESSION
   ============================================================================ */

@media print {
  body {
    background: white;
    color: black;
  }

  a {
    color: #0066cc;
    text-decoration: underline;
  }

  /* Cacher les éléments décoratifs à l'impression */
  .bg-gradient,
  .grid-overlay,
  .gradient-orb,
  .floating-card {
    display: none;
  }
}

/* ============================================================================
   8. HIGH CONTRAST MODE SUPPORT
   ============================================================================ */

/* Support pour le mode contraste élevé Windows */
@media (prefers-contrast: more) {
  :root {
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-accent: #00ffff;
  }

  a,
  button,
  .btn {
    border: 2px solid currentColor;
  }
}

/* ============================================================================
   9. REDUCED MOTION SUPPORT
   ============================================================================ */

/* Respecter la préférence utilisateur pour mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .gradient-orb {
    animation: none;
  }

  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}
