/* VARIABLES CSS DARK MODE - TOUJOURS EN PREMIER */
:root {
  /* THÈME CLAIR */
  --bg-primary: #f5f5f5;
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --text-primary: #333;
  --text-secondary: #666;
  --border-accent: #0076bf;
  --hero-bg: #0076bf;
  
  /* GRADIENT HERO */
  --gradient-1: #005f99;
  --gradient-2: #3b82f6;
  --gradient-3: #1d4ed8;
  --shadow: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  /* THÈME SOMBRE */
  --bg-primary: #1a1a1a;
  --bg-secondary: rgba(42, 42, 42, 0.9);
  --text-primary: #e5e7eb;
  --text-secondary: #d1d5db;
  --border-accent: #3b82f6;
  --hero-bg: #0f172a;
  
  /* GRADIENT HERO SOMBRE */
  --gradient-1: #1e40af;
  --gradient-2: #3b82f6;
  --gradient-3: #1d4ed8;
  --shadow: rgba(0,0,0,0.4);
}

/* BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background 0.3s, color 0.3s;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 95%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER FIXE - GRADIENT ANIMÉ PARFAIT */
.hero {
  background: linear-gradient(-45deg, 
    var(--hero-bg), 
    var(--gradient-1) 25%, 
    var(--gradient-2) 50%, 
    var(--gradient-3) 75%, 
    var(--hero-bg) 100%);
  background-size: 400% 400%;
  animation: gradientShift 12s ease-in-out infinite;
  
  color: #fff;
  padding: 30px 20px 20px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  padding-top: 20px; 
  max-width: 1200px;
  margin: 0 auto;
}

/* TITRES */
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  text-transform: uppercase;
  max-width: 85%;
  padding: 0;
}

.hero h2 {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 400;
  margin: 0;
  opacity: 0.95;
}

/* BOUTONS EN ABSOLU EN HAUT */
.buttons-top {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
  align-items: flex-end;
}

/* STYLE COMMUN BOUTON THÈME + HAMBURGER */
.theme-btn,
.hamburger {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
}

/* Hover identique */
.theme-btn:hover,
.hamburger:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* HAMBURGER */
.hamburger {
	display: none;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  width: 22px;
  height: 3px;
  background: white;
  border-radius: 3px;
  transition: 0.3s;
}

.titles { 
display: flex; 
flex-direction: column; 
align-items: flex-start; /* aligne le début verticalement */ 
justify-content: center; 
gap: 8px;
width: 100%;
}
/* Ligne 1 : H1 + bouton sombre */
.row-1,
.row-2 {
  display: flex;
  align-items: center;
  justify-content: space-between; /* titre à gauche, bouton à droite */
  width: 100%;
}

/* On aligne les titres à gauche */
.row-1 h1,
.row-2 h2 {
  margin: 0;
  padding: 0;
}

/* MOBILE */
@media (max-width: 768px) {
  .theme-btn,
  .hamburger {
    width: 45px;
    height: 45px;
  }

.hamburger {
    display:flex;
  }
  /* Empêcher le titre de chevaucher les boutons */
  .titles h1 {
    padding-right: 0;
  }
  
  .hero h1 h2 { padding: 0 10px; }
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* NAVIGATION RESPONSIVE */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
}

.main-nav a {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.main-nav a:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* ANIMATION GRADIENT */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  16% { background-position: 100% 0%; }
  33% { background-position: 100% 100%; }
  50% { background-position: 0% 100%; }
  66% { background-position: 0% 0%; }
  100% { background-position: 0% 50%; }
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    /* Fond identique au bandeau */
    background: var(--hero-bg);

    /* Effet glassmorphism */
    backdrop-filter: blur(20px);

    /* Bords arrondis */
    border-radius: 20px 20px 20px 20px;

    /* Bordure subtile */
    border-top: 1px solid rgba(255,255,255,0.25);

    /* Ombre douce */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);

    padding: 20px;
    margin-top: 5px;

    /* Animation d'ouverture */
    opacity: 0;
    transform: translateY(-15px);
    animation: menuSlideDown 0.4s ease forwards;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: 0.3s;
    color: white;
  }

  .main-nav a:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
  }
  
  .hero {
    padding: 15px 10px;
  }
  .hero-content { padding-top: 10px; }
}

/* Animation d'ouverture */
@keyframes menuSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* LAYOUT 2 COLONNES */
.layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 25px;
  padding: 25px 0 40px;
}

/* COLONNE GAUCHE - GLASSMORPHISM */
.sidebar section {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 20px 22px;
  margin-bottom: 18px;
  border-left: 4px solid var(--border-accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] .sidebar section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sidebar section:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

.sidebar h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* COLONNE DROITE - GLASSMORPHISM */
.content section, .profile {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 22px 25px;
  margin-bottom: 20px;
  border-top: 4px solid var(--border-accent);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] .content section,
[data-theme="dark"] .profile {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.content section:hover,
.profile:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
}

.content h3 {
  font-size: 1.15rem;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile {
  border-top: 4px solid var(--border-accent);
}

/* HOVER 3D SUR ITEMS */
.item {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

.item:hover {
  transform: translateY(-8px) rotateX(2deg);
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 20px 40px rgba(0, 118, 191, 0.25);
}

[data-theme="dark"] .item:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35);
}

.item h4 {
  font-size: 1.05rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.tech {
  font-size: 0.85rem;
  color: #00518c;
  font-weight: 500;
}

.content p {
  text-align: justify;
  text-justify: inter-word;
  margin-bottom: 10px;
  line-height: 1.65;
}

.content .item p:not(.meta):not(.tech) {
  text-align: justify;
}

/* LOGOS */
.item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-entreprise {
  width: 60px;
  height: auto;
  object-fit: contain;
  transition: transform 0.3s;
}

.logo-entreprise:hover {
  transform: scale(1.1);
}

.mission {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border-left: 3px solid rgba(0,118,191,0.3);
  border-radius: 0 8px 8px 0;
  transition: all 0.3s;
}

.mission:hover {
  border-left-color: var(--border-accent);
  padding-left: 15px;
}

.mission-logo {
  width: 40px;
  flex-shrink: 0;
}

/* COMPÉTENCES - BARRES ANIMÉES */
.skill {
  margin-bottom: 16px;
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}

.skill:hover {
  transform: translateX(6px);
}

.bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

[data-theme="dark"] .bar {
  background: rgba(255, 255, 255, 0.12);
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, var(--border-accent), #3b82f6);
  border-radius: 6px;
  width: 0;
  animation: fillAnimation 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  box-shadow: 0 0 15px rgba(0,118,191,0.6);
  position: relative;
  overflow: hidden;
}

.fill-90 { animation-delay: 0.2s; }
.fill-80 { animation-delay: 0.4s; }
.fill-70 { animation-delay: 0.6s; }
.fill-60 { animation-delay: 0.8s; }
.fill-50 { animation-delay: 1s; }

@keyframes fillAnimation {
  0% {
    width: 0;
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    width: attr(data-width);
  }
}

.fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255,255,255,0.6), 
    transparent);
  animation: shine 2s 1s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.fill-100 { width: 100%; }
.fill-90 { width: 90%; }
.fill-80 { width: 80%; }
.fill-70 { width: 70%; }
.fill-60 { width: 60%; }
.fill-50 { width: 50%; }

.skill span {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInText 0.8s ease forwards;
}

.skill:nth-child(1) span { animation-delay: 0.5s; }
.skill:nth-child(2) span { animation-delay: 0.7s; }
.skill:nth-child(3) span { animation-delay: 0.9s; }
.skill:nth-child(4) span { animation-delay: 1.1s; }
.skill:nth-child(5) span { animation-delay: 1.3s; }
.skill:nth-child(6) span { animation-delay: 1.5s; }

@keyframes slideInText {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* FORMULAIRE */
#contact {
  margin-top: 15px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.95rem;
  font-weight: 500;
}

.field input,
.field textarea {
  padding: 12px 16px;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--border-accent);
  box-shadow: 0 0 0 4px rgba(0,118,191,0.1);
}

[data-theme="dark"] .field input,
[data-theme="dark"] .field textarea {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.contact-form button {
  align-self: stretch;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--border-accent), #3b82f6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 8px 25px rgba(0,118,191,0.4);
}

.contact-form button:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0,118,191,0.6);
}

/* FOOTER */
.footer {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  text-align: center;
  padding: 20px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 40px;
  border-radius: 12px 12px 0 0;
}

[data-theme="dark"] .footer {
  border-top-color: rgba(255,255,255,0.1);
}

/* SCROLL */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 220px;
}

/* RESPONSIVE GENERAL */
@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  body {
    padding-top: 100px;
  }
  
  .hero {
    padding: 20px 15px;
  }
  
  .hero-content {
    padding: 0 10px;
  }
}

/* Placeholder logo formation interne */
.formation-logo {
  width: 60px;
  height: 45px;
  background: linear-gradient(135deg, var(--border-accent) 0%, rgba(0,118,191,0.7) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,118,191,0.3);
  font-size: 1.6rem;
  transition: all 0.3s;
}

.formation-logo:hover {
  transform: scale(1.1);
}

.formation-logo::before {
  content: "🎓";
}

[data-theme="dark"] .formation-logo {
  background: linear-gradient(135deg, var(--border-accent) 0%, rgba(59,130,246,0.8) 100%);
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}


#sendBtn {
  transition: all 0.3s ease;
}

#sendBtn.sent {
  background: #28a745 !important; /* Vert succès */
  color: white;
  border-color: #28a745;
}

#sendBtn.sent::after {
  content: " ✓";
  font-weight: bold;
}
[data-theme="dark"] .contact-form input,
[data-theme="dark"] .contact-form textarea,
[data-theme="dark"] .contact-form label {
    color: white;
}
[data-theme="dark"] .contact-form input::placeholder,
[data-theme="dark"] .contact-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

