/*
 * Thème portfolio — style maquette : bleu foncé (header/hero) + bleu vif + blanc
 */

/* ========== Variables ========== */
:root {
  --section-padding-y: 4rem;
  --section-padding-y-mobile: 2.5rem;
  --container-padding-x: 1.5rem;
  --hero-min-height: 100vh;
  --hero-min-height-mobile: 85vh;
  --portfolio-dark: #0f172a;
  --portfolio-dark-soft: #1e293b;
  --portfolio-accent: #2563eb;
}

/* ========== Mode portfolio (light) : header + hero bleu foncé, sections blanches ========== */
body:not(.dark) #profileHeader {
  background: var(--portfolio-dark) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body:not(.dark) #profileHeader .navbar-brand {
  color: #fff !important;
}

body:not(.dark) #profileHeader .navbar-brand::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--portfolio-accent);
  margin-right: 0.5rem;
  vertical-align: middle;
}

body:not(.dark) #profileHeader .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

body:not(.dark) #profileHeader .nav-link:hover {
  color: #fff !important;
}

body:not(.dark) .showHeaderOnTop {
  background: var(--portfolio-dark) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
}

body:not(.dark) #profileHeader .navbar-toggler,
body:not(.dark) #profileHeader .navbar-toggler svg {
  color: #fff !important;
}

body:not(.dark) #profileHeader #theme-toggle {
  color: #fff !important;
  background: transparent !important;
}

/* Hero fond bleu foncé (light mode) */
body:not(.dark) #hero {
  background: var(--portfolio-dark) !important;
  color: #fff !important;
}

body:not(.dark) #hero::before {
  background: linear-gradient(135deg, var(--portfolio-dark) 0%, var(--portfolio-dark-soft) 100%);
  opacity: 1;
}

body:not(.dark) #hero h2,
body:not(.dark) #hero .subtitle,
body:not(.dark) #hero .hero-content {
  color: #fff !important;
}

body:not(.dark) #hero .hero-badge {
  color: var(--portfolio-accent) !important;
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: rgba(37, 99, 235, 0.5) !important;
}

body:not(.dark) #hero a.btn:not(.social-icon) {
  background: var(--portfolio-accent) !important;
  color: #fff !important;
}

body:not(.dark) #hero a.btn.social-icon {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

body:not(.dark) #hero a.btn.social-icon:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: #fff !important;
}

body:not(.dark) #hero .image img {
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4) !important;
}

/* Sections fond blanc (light mode) */
body:not(.dark) #about,
body:not(.dark) #experience,
body:not(.dark) #education,
body:not(.dark) #projects,
body:not(.dark) #achievements,
body:not(.dark) #contact {
  background: #fff !important;
}

body:not(.dark) #content {
  background: #fff !important;
}

body:not(.dark) html,
body:not(.dark) body {
  background: #fff !important;
}

/* Cartes en mode portfolio : ombre bleutée */
body:not(.dark) #experience .experience-container {
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.08) !important;
  border-color: rgba(37, 99, 235, 0.12) !important;
}

body:not(.dark) #experience .experience-container:hover {
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.12) !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
}

body:not(.dark) #education .card:hover,
body:not(.dark) #achievements .card:hover {
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.1) !important;
}

/* Titres de section avec ■ bleu (light mode) */
body:not(.dark) #about h3::before,
body:not(.dark) #experience h3::before,
body:not(.dark) #education .container > h3::before,
body:not(.dark) #projects h3::before,
body:not(.dark) #achievements h3::before,
body:not(.dark) #contact h3::before {
  content: "■ ";
  color: var(--portfolio-accent);
  position: static;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}

body:not(.dark) #about h3::after,
body:not(.dark) #experience h3::after,
body:not(.dark) #education .container > h3::after,
body:not(.dark) #projects h3::after,
body:not(.dark) #achievements h3::after,
body:not(.dark) #contact h3::after {
  display: none;
}

/* ========== Typography ========== */
.primary-font, #primary-font, .navbar-brand {
  font-family: "Plus Jakarta Sans", "Alata", sans-serif !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body, .secondary-font, #secondary-font {
  font-family: "Plus Jakarta Sans", "Lora", sans-serif !important;
}

/* ========== Hero — Desktop ========== */
#hero {
  position: relative;
  overflow: hidden;
  min-height: var(--hero-min-height);
  display: flex;
  align-items: center;
  padding: 3rem 0 4rem;
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, var(--background-color) 0%, transparent 45%),
    linear-gradient(220deg, rgba(13, 148, 136, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse 90% 60% at 100% -10%, rgba(13, 148, 136, 0.12) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.dark #hero::before {
  background:
    linear-gradient(160deg, var(--background-color) 0%, transparent 45%),
    linear-gradient(220deg, rgba(45, 212, 191, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse 90% 60% at 100% -10%, rgba(45, 212, 191, 0.08) 0%, transparent 55%);
}

#hero .container {
  position: relative;
  z-index: 1;
}

#hero h2 {
  font-size: clamp(2.75rem, 6.5vw, 4.75rem) !important;
  font-weight: 800 !important;
  letter-spacing: -0.035em;
  line-height: 1.05 !important;
  color: var(--primary-color) !important;
  margin-bottom: 0.25rem;
}

#hero .subtitle {
  display: inline-block;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem) !important;
  font-weight: 600;
  color: var(--primary-color) !important;
  opacity: 1 !important;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

#hero .hero-badge {
  display: inline-block;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  background: rgba(13, 148, 136, 0.14);
  border: 1px solid rgba(13, 148, 136, 0.35);
  border-radius: 9999px;
}

.dark #hero .hero-badge {
  color: var(--primary-color);
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.4);
}

#hero .hero-content {
  font-size: 1.1rem;
  line-height: 1.75;
  max-width: 38rem;
  margin-top: 0.5rem;
  opacity: 0.92;
}

#hero a.btn:not(.social-icon) {
  font-weight: 600;
  padding: 0.85rem 2rem !important;
  border-radius: 0.5rem !important;
  background: var(--primary-color) !important;
  color: var(--secondary-color) !important;
  border: none !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  font-size: 1rem;
}

#hero a.btn:not(.social-icon):hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(13, 148, 136, 0.4) !important;
  opacity: 1 !important;
}

.dark #hero a.btn:not(.social-icon):hover {
  box-shadow: 0 12px 28px rgba(45, 212, 191, 0.3) !important;
}

#hero .image img {
  border-radius: 1rem !important;
  border: 2px solid var(--primary-color) !important;
  box-shadow: 0 24px 64px rgba(13, 148, 136, 0.18) !important;
  transition: box-shadow 0.3s, transform 0.3s;
}

.dark #hero .image img {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45) !important;
  border-color: rgba(45, 212, 191, 0.45) !important;
}

#hero .image img:hover {
  box-shadow: 0 28px 72px rgba(13, 148, 136, 0.22) !important;
  transform: scale(1.02);
}

/* ========== Hero — Mobile ========== */
@media (max-width: 991.98px) {
  #hero {
    min-height: var(--hero-min-height-mobile);
    padding: 2rem 0 3rem;
    text-align: center;
  }

  #hero .content {
    text-align: center;
  }

  #hero .hero-content {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    font-size: 1rem;
  }

  #hero h2 {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
  }

  #hero .hero-badge {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.5rem 1.1rem;
    font-size: 0.75rem;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #hero a.btn:not(.social-icon) {
    min-height: 3rem;
    padding: 0.75rem 1.75rem !important;
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  #hero .image {
    padding-top: 1.5rem !important;
  }

  #hero .image img {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }

  #hero .content > .row {
    justify-content: center;
    gap: 0.5rem;
  }

  #hero .content > .row .col-auto:first-child {
    width: 100%;
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 575.98px) {
  #hero {
    padding: 1.5rem 0 2.5rem;
  }

  #hero .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ========== Sections communes ========== */
#about, #experience, #education, #projects, #achievements, #contact {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

@media (max-width: 767.98px) {
  #about, #experience, #education, #projects, #achievements, #contact {
    padding-top: var(--section-padding-y-mobile);
    padding-bottom: var(--section-padding-y-mobile);
  }
}

/* Titres de section — ligne d’accent plus marquée */
#about h3, #experience h3, #education .container > h3,
#projects h3, #achievements h3, #contact h3 {
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

#about h3::after, #experience h3::after, #education .container > h3::after,
#projects h3::after, #achievements h3::after, #contact h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4rem;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

@media (max-width: 767.98px) {
  #about h3::after, #experience h3::after, #education .container > h3::after,
  #projects h3::after, #achievements h3::after, #contact h3::after {
    width: 3rem;
    height: 3px;
  }
}

/* ========== Experience — cartes ========== */
#experience .experience-container {
  border-radius: 1.25rem !important;
  border: 1px solid rgba(13, 148, 136, 0.18) !important;
  box-shadow: 0 8px 32px rgba(15, 80, 100, 0.1) !important;
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.25s !important;
  overflow: hidden;
}

.dark #experience .experience-container {
  border-color: rgba(45, 212, 191, 0.15) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

#experience .experience-container:hover {
  box-shadow: 0 16px 48px rgba(15, 80, 100, 0.14) !important;
  border-color: rgba(13, 148, 136, 0.3) !important;
  transform: translateY(-2px);
}

.dark #experience .experience-container:hover {
  border-color: rgba(45, 212, 191, 0.25) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35) !important;
}

#experience .nav-item .nav-link.active {
  color: var(--primary-color) !important;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  #experience .experience-container {
    border-radius: 1rem !important;
  }

  #experience .nav-item .nav-link {
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
  }
}

/* ========== About ========== */
#about .content {
  font-size: 1.05rem;
  line-height: 1.75;
}

#about ul {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
  gap: 0.5rem 1.25rem !important;
}

#about ul li {
  padding: 0.25rem 0;
}

#about ul li::before {
  content: "▸" !important;
  font-size: 0.75em;
  color: var(--primary-color);
}

@media (max-width: 767.98px) {
  #about ul {
    grid-template-columns: 1fr !important;
  }
}

/* ========== Education / Achievements — cartes ========== */
#education .card, #achievements .card {
  transition: transform 0.25s, box-shadow 0.25s !important;
  border-radius: 1.25rem !important;
}

#education .card:hover, #achievements .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(15, 80, 100, 0.12) !important;
}

.dark #education .card:hover, .dark #achievements .card:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35) !important;
}

@media (max-width: 767.98px) {
  #education .card .card-body, #achievements .card .card-body {
    padding: 1.25rem !important;
  }
}

/* ========== Navbar — plus impactant ========== */
header {
  transition: box-shadow 0.2s, background-color 0.2s;
}

.showHeaderOnTop {
  box-shadow: 0 4px 24px rgba(15, 80, 100, 0.12) !important;
  background: var(--background-color) !important;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}

.dark .showHeaderOnTop {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25) !important;
  background: rgba(15, 23, 42, 0.92) !important;
}

.navbar-brand {
  font-weight: 700 !important;
  font-size: 1.15rem !important;
}

.navbar .nav-link {
  transition: color 0.2s !important;
}

/* Mobile navbar */
@media (max-width: 991.98px) {
  .navbar-collapse {
    padding: 1rem 0;
  }

  .navbar .nav-item .nav-link {
    padding: 0.65rem 1rem !important;
    font-size: 1rem;
  }

  .navbar-toggler {
    padding: 0.5rem 0.6rem;
  }
}

/* ========== Footer ========== */
footer {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

footer .card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: 1rem !important;
}

footer .card:hover {
  transform: translateY(-2px);
}

#footer-socialNetworks-github-svg-path {
  transition: fill 0.2s;
}

/* ========== Contact ========== */
#contact .btn {
  min-height: 3rem;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600;
}

@media (max-width: 767.98px) {
  #contact form .form-control {
    font-size: 16px; /* évite le zoom sur iOS */
  }
}

/* ========== Utilitaires & polish ========== */
body *::selection {
  background-color: rgba(37, 99, 235, 0.25) !important;
}

.dark body *::selection {
  background-color: rgba(45, 212, 191, 0.28) !important;
}

body::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.4);
  border-radius: 1rem;
}

.dark body::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.35);
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Focus visible (accessibilité) */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========== Sélecteur de langue (drapeaux) ========== */
.language-switcher {
  position: fixed !important;
  bottom: 1.25rem !important;
  right: 1.25rem !important;
  top: auto !important;
  left: auto !important;
  z-index: 1050;
  display: flex !important;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
}

.language-switcher a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 !important;
  border-radius: 0.5rem;
  text-decoration: none !important;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: inherit;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.language-switcher a:hover {
  background: rgba(37, 99, 235, 0.2) !important;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.language-switcher a.active {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.22) !important;
}

.dark .language-switcher a {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(45, 212, 191, 0.12);
}

.dark .language-switcher a:hover {
  background: rgba(45, 212, 191, 0.22) !important;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.15);
}

.dark .language-switcher a.active {
  border-color: var(--primary-color);
  background: rgba(45, 212, 191, 0.22) !important;
}

.language-switcher a[title="Français"] span,
.language-switcher a[title="English"] span {
  font-size: 1.5rem !important;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .language-switcher {
    bottom: 1rem !important;
    right: 1rem !important;
  }

  .language-switcher a {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  .language-switcher a span {
    font-size: 1.35rem !important;
  }
}

/* Conteneur : largeur max sur très grands écrans */
@media (min-width: 1400px) {
  #content .container-fluid.mx-xs-2,
  #content .container.px-3 {
    max-width: 1320px;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
