/* ============================
   VARIABLES GLOBALES
============================ */
:root {
  /* Couleurs principales */
  --primary: #3B82F6;
  --primary-dark: #1D4ED8;
  --accent: #A855F7;

  /* Couleurs texte */
  --text-dark: #0F172A;
  --text-medium: #334155;
  --text-light: #64748B;
  --text-muted: #94A3B8;

  /* Background */
  --bg-light: #F8FAFC;
  --bg-lighter: #F1F5F9;
  --bg-white: #FFFFFF;

  /* Bordures */
  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;

  /* Feedback */
  --success-bg: #D1FAE5;
  --success-border: #10B981;
  --success-text: #065F46;

  --error-bg: #FEE2E2;
  --error-border: #EF4444;
  --error-text: #991B1B;

  --warning-bg: #FEF3C7;
  --warning-border: #F59E0B;
  --warning-text: #92400E;
}

/* ============================
   DARK MODE
============================ */
body.dark {
  --primary: #60A5FA;
  --primary-dark: #3B82F6;
  --accent: #C084FC;

  --text-dark: #F1F5F9;
  --text-medium: #CBD5E1;
  --text-light: #94A3B8;
  --text-muted: #64748B;

  --bg-light: #1E293B;
  --bg-lighter: #0F172A;
  --bg-white: #1E293B;

  --border-light: #334155;
  --border-medium: #475569;

  --success-bg: #064E3B;
  --success-border: #10B981;
  --success-text: #A7F3D0;

  --error-bg: #7F1D1D;
  --error-border: #EF4444;
  --error-text: #FECACA;

  --warning-bg: #78350F;
  --warning-border: #F59E0B;
  --warning-text: #FDE68A;
}

.theme-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.4rem;
  border-radius: 6px;
  transition: background 0.2s ease;
}

body {
  background-color: var(--bg-lighter);
}

/* ============================
   HEADER
============================ */
header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-medium);
  padding: 0.4rem 0;
  position: relative;
  transition: color .2s ease;
}

nav a:hover {
  color: var(--primary);
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: width .25s ease;
}

nav a:hover::after {
  width: 100%;
}

.activ {
  color: var(--primary);
}

.theme-btn:hover {
  background: rgba(0,0,0,0.05);
}

body.dark .theme-btn:hover {
  background: rgba(255,255,255,0.1);
}

.theme-btn .icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.theme-btn:active .icon {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.8rem 1rem;
  }

  nav {
    display: flex;
    gap: 1rem;
  }

  .theme-btn {
    position: static;
    transform: none;
    font-size: 1.4rem;
    margin-left: 10px;
  }
}

/* ============================
   FOOTER
============================ */
footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ============================
   HERO
============================ */
.hero {
  padding: 7rem 1rem;
  text-align: center;
  background: var(--bg-light);
  border-radius: 6px;
  margin: 3rem auto;
  max-width: 1000px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  border: 1px solid var(--border-light);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.3rem;
  color: var(--text-light);
}

@media (max-width: 600px) {
  .hero {
    padding: 4rem 1rem;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero p {
    font-size: 1.1rem;
  }
}

/* ============================
   SECTION TITLES
============================ */
.section-title {
  display: flex;
  justify-content: center;
}

section {
  text-align: center;
}

main h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 3rem 0 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

main h2::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 70px;
  height: 3px;
  background: var(--primary);
  transition: width .3s ease;
}

main h2:hover::after {
  width: 110px;
}

/* ============================
   ABOUT
============================ */
.about {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ============================
   COMPETENCES
============================ */
.skills {
  max-width: 900px;
  margin: 3rem auto;
  text-align: center;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.skills-list span {
  background: var(--border-light);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text-medium);
  font-size: 0.95rem;
  border: 1px solid var(--border-medium);
  transition: background .2s ease, transform .2s ease;
}

.skills-list span:hover {
  background: #dbeafe;
  transform: translateY(-2px);
}

/* ============================
   CONTACT HOME
============================ */
.contact-home {
  text-align: center;
  margin: 4rem 0;
  color: var(--text-light);
}

.contact-home p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.contact-home .btn {
  padding: 0.7rem 1.3rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background .2s ease, transform .2s ease;
}

.contact-home .btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============================
   PROJETS — GRID
============================ */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.2rem;
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* ============================
   PROJETS — CARDS
============================ */
.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: 6px;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  max-width: 450px;
  margin: 0 auto;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.6rem;
}

.project-content .btn {
  margin-top: auto;
  text-align: center;
}

.project-title {
  text-align: center;
  margin-top: 0 auto;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 1rem 1.6rem 0;
  color: var(--text-dark);
}
.type {
  font-weight: 600;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.features {
  margin: 0.8rem 0;
  padding-left: 1.2rem;
  color: var(--text-medium);
}

.tech {
  font-size: 1rem;
  color: var(--text-medium);
  margin-top: 0.8rem;
}

.architecture {
  color: var(--text-dark);
}

.description {
  color: var(--text-dark);
}

.toggle-card-btn {
  display: none;
  color: rgb(255, 255, 255);
}

/* Responsive mobile */
@media (max-width: 768px) {
  .projects {
    grid-template-columns: 1fr;
    gap: 1.6rem;
    padding: 1rem;
  }

  .project-card {
    max-width: 100%;
    overflow: visible;
  }

  .project-title {
    padding: 1rem 1.6rem 0;
    font-size: 1.4rem;
    font-weight: 700;
  }

  .project-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.6rem;
    transition: max-height .35s ease, padding .25s ease;
  }

  .project-content.open {
    max-height: 1200px;
    padding: 1.4rem 1.6rem;
  }

  .toggle-card-btn {
    display: block;
    margin: 0, auto;
    background: var(--primary);
    border: 1px solid var(--border-light);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background .2s ease;
  }

  .toggle-card-btn:hover {
    background: rgba(0,0,0,0.05);
  }
}

/* ============================
   SLIDER
============================ */
.project-slider {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

.slider-images {
  display: flex;
  transition: transform 0.4s ease;
  height: 100%;
}

.slider-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none;
  font-size: 2rem;
  padding: 0 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
  z-index: 10;
}

.slider-btn:hover {
  background: rgba(255,255,255,0.9);
}

.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

@media (max-width: 768px) 
{
  .project-slider {
    height: 300px;
  }
}

/* ============================
   LIGHTBOX
============================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 2rem;

  text-align: center;
}

.lightbox img {
  max-width: 80%;
  max-height: 80%;
  border-radius: 6px;

  display: block;
  margin: auto;
}

.lightbox button {
  background: none;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  user-select: none;
  z-index: 100000;
}

.lightbox.close-area {
  cursor: pointer;
}

/* ============================
   BOUTON GLOBAL
============================ */
.btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.7rem 1.2rem;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background .2s ease, transform .2s ease;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============================
   FORMULAIRE CONTACT
============================ */
form {
  max-width: 600px;
  margin: 2rem auto 4rem;
  background: var(--bg-white);
  padding: 2rem;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

form label {
  font-weight: 600;
  color: var(--text-medium);
  text-align: left;
}

form input,
form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-medium);
  background: var(--bg-lighter);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}

form input:focus,
form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  outline: none;
}

form textarea {
  min-height: 140px;
  resize: vertical;
}

form button {
  padding: 0.8rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

form button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============================
   MESSAGES SUCCESS / ERROR
============================ */
.success,
.error {
  max-width: 600px;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
}

.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-border);
}

/* ============================
   WARNING
============================ */
.site-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--warning-border);
}