/***************************************************
 * 1. RESET                                        *
 ***************************************************/
:root {
  /* — Couleurs — */
  --primary-color:   #3498db;
  --secondary-color: #2c3e50; /* également utilisée comme --dark-color */
  --dark-color:      #2c3e50;
  --light-color:     #ecf0f1;
  --accent-color:    #e74c3c;
  --bg-light:        #f9f9f9;

  /* — Couleurs texte — */
  --text-color:  #333;
  --text-light:  #7f8c8d;

  /* — Ombres — */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/***************************************************
 * 2. ATOMS                                        *
 ***************************************************/
/* — Boutons — */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

/***************************************************
 * 3. GENERIC LAYOUT HELPERS                       *
 ***************************************************/
.container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: 80px;
}

.section-title {
  position: relative;
  margin-bottom: 60px;
  text-align: center;
  font-size: 2.5rem;
  color: var(--secondary-color);
}

.section-title::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  margin: 15px auto 0;
  background: var(--primary-color);
}

.bg-light {
  background: var(--bg-light);
}

/***************************************************
 * 4. HEADER / NAVIGATION                          *
 ***************************************************/
#navbar {
  position: fixed;
  inset-block-start: 0;
  width: 100%;
  z-index: 1000;
  background: #fff;
  box-shadow: var(--shadow);
}

#navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
}

#navbar h1 {
  font-size: 1.8rem;
}

#navbar .highlight {
  color: var(--primary-color);
}

#navbar ul {
  display: flex;
}

#navbar ul li {
  margin-inline-start: 30px;
}

#navbar ul li a {
  position: relative;
  font-weight: 600;
  transition: color 0.3s;
}

#navbar ul li a:hover {
  color: var(--primary-color);
}

#navbar ul li a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: -5px;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s;
}

#navbar ul li a:hover::after {
  width: 100%;
}

/***************************************************
 * 5. SECTION – À PROPOS                           *
 ***************************************************/
#about .about-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

#about .about-img {
  flex: 1;
  max-width: 350px;
}

#about .about-img img {
  width: 100%;
  max-height: 400px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  object-fit: cover;
}

#about .about-text {
  flex: 1;
}

#about h3 {
  margin-bottom: 15px;
  font-size: 2rem;
  color: var(--secondary-color);
}

#about .metier {
  margin-bottom: 20px;
  font-style: italic;
  color: var(--text-light);
}

#about .bio p {
  margin-bottom: 15px;
}

/***************************************************
 * 6. SECTION – PARCOURS                           *
 ***************************************************/
.journey-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
  margin-bottom: 50px;
}

#journey h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: var(--secondary-color);
}

/* — Timeline items — */
.timeline-item {
  position: relative;
  margin-bottom: 30px;
  padding-inline-start: 30px;
  border-inline-start: 2px solid var(--primary-color);
}

.timeline-item::before {
  content: "";
  position: absolute;
  inset-inline-start: -8px;
  inset-block-start: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
}

.timeline-item h4 {
  margin-bottom: 5px;
  font-size: 1.2rem;
}

.timeline-item .date {
  margin-bottom: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
}

.timeline-item .company,
.timeline-item .institution {
  margin-bottom: 10px;
  font-style: italic;
}

/***************************************************
 * 7. SECTION – LANGUES                            *
 ***************************************************/
.languages {
  margin-bottom: 50px;
}

.language-bars {
  margin-top: 20px;
}

.language {
  margin-bottom: 20px;
}

.language p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.language p span {
  font-size: 0.9rem;
  color: var(--text-light);
}

.bar {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd;
}

.level {
  height: 100%;
  background: var(--primary-color);
}

/***************************************************
 * 8. SECTION – CERTIFICATIONS                     *
 ***************************************************/
.certifications {
  margin-block: 40px;
}

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border-radius: 5px;
  background: #fff;
  border-inline-start: 4px solid transparent;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.cert-item:hover {
  transform: translateY(-5px);
}

/* — Logos — */
.cert-logo {
  flex: 0 0 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cert-logo img {
  max-width: 100%;
  max-height: 44px;
  object-fit: contain;
}

/* — Détails — */
.cert-details h4 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.cert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.issuer,
.date {
  font-size: 0.85rem;
  color: #666;
}

.score {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  background: #f58025;
}

/* ––– Color accents per certificate ––– */
.cisco {
  border-inline-start-color: #005073; /* Bleu Cisco */
}

.toeic {
  border-inline-start-color: #f58025; /* Orange TOEIC */
}

/***************************************************
 * 9. SECTION – COMPÉTENCES                        *
 ***************************************************/
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.skill-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
}

.skill-image-container {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.skill-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.skill-card:hover .skill-image {
  transform: scale(1.05);
}

.skill-content {
  flex-grow: 1;
  padding: 25px;
}

.skill-title {
  margin-bottom: 15px;
  font-size: 1.3rem;
  color: var(--secondary-color);
}

/* — Description toggle (fermée par défaut) — */
.skill-description {
  display: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

/* — Lorsque la carte possède .is-open — */
.skill-card.is-open .skill-description {
  display: block;     /* accessibilité */
  max-height: 800px;  /* valeur arbitraire suffisamment haute */
  opacity: 1;
}

/* — Alternative avec .active (compat.) — */
.skill-card.active .skill-description {
  display: block;
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 500px; }
}

/* — Liste des compétences — */
.skill-items {
  columns: 2;
  margin-top: 15px;
}

.skill-items li {
  position: relative;
  padding-inline-start: 20px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  break-inside: avoid;
}

.skill-items li::before {
  content: "▹";
  position: absolute;
  inset-inline-start: 0;
  color: var(--primary-color);
}

/***************************************************
 * 10. SECTION – TECHNOLOGIES                      *
 ***************************************************/
#technologies .tech-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  margin-block: 25px 40px; /* top & bottom spacing merged */
}

#technologies .tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border-radius: 8px;
  background: var(--light-color);
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

#technologies .tech-item:hover {
  transform: translateY(-4px);
}

#technologies .tech-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
}

#technologies .tech-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#technologies .tech-name {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary-color);
}

#technologies h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: var(--secondary-color);
}

/***************************************************
 * 11. SECTION – PROJETS                           *
 ***************************************************/
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.project-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-content {
  padding: 20px;
}

.project-content h3 {
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.project-description p {
  margin-bottom: 15px;
}

.tech-used {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/***************************************************
 * 12. SECTION – CONTACT                           *
 ***************************************************/
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 50px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-submit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.contact-info h3 {
  margin-bottom: 30px;
  font-size: 1.5rem;
  color: var(--secondary-color);
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.social-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 5px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: background 0.3s, color 0.3s;
}

.social-links a:hover {
  background: var(--primary-color);
  color: #fff;
}

.social-links i {
  font-size: 1.2rem;
}

/***************************************************
 * 13. FOOTER & UTILITAIRES                        *
 ***************************************************/
#footer {
  padding-block: 30px;
  text-align: center;
  color: #fff;
  background: var(--secondary-color);
}

/* — Bouton retour haut de page */
.back-to-top {
  position: fixed;
  inset-block-end: 30px;
  inset-inline-end: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s, background 0.3s, opacity 0.3s;
}

.back-to-top.active {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--accent-color);
}

/***************************************************
 * 14. RESPONSIVE                                  *
 ***************************************************/
@media (max-width: 992px) {
  .journey-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  #navbar .container {
    flex-direction: column;
    text-align: center;
  }

  #navbar ul {
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
  }

  #navbar ul li {
    margin: 0 10px 10px;
  }
}

@media (max-width: 576px) {
  .section-title {
    font-size: 2rem;
  }

  .project-content h3 {
    font-size: 1.3rem;
  }
}
