/* ----- Variables ----- */
:root {
  --primary: #1d13d1;
  --bg: #f8f9fc;
  --text: #333;
  --radius: 20px;
  --card-bg: #fff;
}

body.dark {
  --primary: #7c8cff;  /* Bleu plus doux */
  --bg: #121212;       /* Noir profond */
  --text: #e0e0e0;     /* Blanc cassé */
  --card-bg: #1e1e1e;  /* Gris très foncé */
  --radius: 20px;
}

body.dark h1 {
  color: #b0b0b0;      /* Gris clair pour les titres */
}

body.dark header {
  background: #1a1a2e;  /* Bleu nuit profond pour l'en-tête */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark .card {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid #333; /* Légère bordure pour mieux délimiter les cartes */
}

body.dark .card:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* ----- Barre de progression ----- */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: transparent;
  z-index: 1000;
}

.progress-bar {
  height: 5px;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* Conteneur des onglets fixes */
.tabs-container {
  position: sticky;
  top: 0;
  z-index: 999;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0;
  height: 90px; /* Hauteur augmentée de 60px à 70px */
  display: flex;
  align-items: center;
}

body.dark .tabs-container {
  background: #1a1a1a;
  border-bottom: 1px solid #333;
}

.tabs {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  max-width: 1000px;
  height: 100%;
  align-items: center;
}

/* Ajustement pour le contenu principal */
main {
  position: relative;
  z-index: 1;
}

/* Ajustement pour le défilement fluide */
html {
  scroll-behavior: smooth;
}

/* ----- Structure ----- */
body {
  font-family: "Poppins", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* ----- En-tête ----- */
header {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 3rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
}

.profile-pic {
  width: 160px; /* Légèrement plus grand pour une meilleure qualité */
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center; /* Assure un bon centrage */
  border: 4px solid white;
  margin-bottom: 1rem;
  image-rendering: -webkit-optimize-contrast; /* Améliore le contraste */
  image-rendering: crisp-edges; /* Rend les bords plus nets */
  backface-visibility: hidden; /* Améliore les performances */
  transform: translateZ(0); /* Active l'accélération matérielle */
  -webkit-backface-visibility: hidden; /* Pour Safari */
  -webkit-transform: translateZ(0); /* Pour Safari */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); /* Ombre subtile */
  transition: transform 0.3s ease, filter 0.3s ease; /* Animation fluide */
}

/* Effet de survol subtil */
.profile-pic:hover {
  transform: scale(1.03) translateZ(0);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

header h1 {
  font-size: 2.4rem;
  margin-bottom: 0.3rem;
}

.subtitle {
  opacity: 0.9;
  margin-bottom: 1rem;
}

/* ----- Bouton thème ----- */
#theme-toggle {
  background: rgb(255, 255, 255);
  color: var(--primary);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#theme-toggle:hover {
  background: #f3f4f6;
  transform: scale(1.05);
}

/* ----- Sections ----- */
section {
  margin-top: 3rem;
}

h2 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

/* ----- Cartes ----- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* ----- Grille intérêts ----- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* ----- Section Contact ----- */
.contact-section {
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Ancienne version avec formulaire en pleine largeur */
.contact-container {
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-form {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Styles de base du formulaire */
.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  max-width: 600px; /* Largeur maximale réduite pour une meilleure lisibilité */
  margin: 0 auto;
}

.contact-form .form-group {
  margin-bottom: 0;
}

.contact-info {
  background: var(--card-bg);
  padding: 3rem 2.5rem; /* Padding vertical augmenté */
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Espacement entre les éléments augmenté */
  margin-top: 1.5rem; /* Décale légèrement vers le bas */
  align-items: center;
}

.contact-info h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
  text-align: center;
}

.contact-item {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  text-align: center;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-item i {
  font-size: 1.5rem;
  color: var(--primary);
  margin-right: 1rem;
  width: 30px;
  text-align: center;
}

.contact-item a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.contact-item a:hover {
  color: var(--primary);
  text-decoration: none;
}

.socials {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.socials a {
  background: var(--primary);
  color: white !important;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.socials a i {
  font-size: 1.1rem;
}

.socials a:hover {
  background: #3730a3;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .contact-container {
    padding: 0 1rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .contact-container {
    padding: 0 1.5rem;
    margin: 1.5rem auto 3rem;
  }
  
  .contact-info {
    padding: 1.5rem;
  }
}

/* ----- Pied de page ----- */
footer {
  text-align: center;
  background: #eef0f8;
  color: #666;
  padding: 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-top: 4rem;
  transition: background 0.3s;
}

body.dark footer {
  background: black;
}

/* ----- Styles des onglets ----- */
.tabs {
  display: flex;
  justify-content: center;
  margin: 20px 0 40px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 0 25px;
  margin: 0 10px;
  background: none;
  border: none;
  font-size: 1.1em;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease;
  color: var(--text);
  font-weight: 600;
  box-sizing: border-box;
  position: relative;
  min-width: 120px;
  text-align: center;
}

.tab-button:hover, .tab-button.active {
  color: var(--primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- Formulaire de contact ----- */
.contact-form {
  width: 100%;
  background: var(--card-bg);
  padding: 3.5rem; /* Padding intérieur augmenté */
  border-radius: var(--radius);
  box-shadow: 0 5px 20px rgba(0,0,0,0.12);
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  font-size: 1em;
  transition: all 0.3s ease;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 15px;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
  outline: none;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.btn:hover {
  background-color: var(--primary-dark, #3a5a80);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1em;
}

.contact-item i {
  color: var(--primary);
  font-size: 1.3em;
  width: 30px;
  text-align: center;
}

.contact-section h2 {
  color: var(--primary);
  font-size: 2.2rem;
  margin: 0 auto 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.contact-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Mode sombre pour le formulaire */
body.dark .form-control {
  background-color: #2d2d2d;
  border-color: #444;
  color: #f0f0f0;
}

body.dark .contact-form {
  background: #1e1e1e;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body.dark .form-control:focus {
  box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .tabs {
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  .tab-button {
    width: 100%;
    margin: 5px 0;
    text-align: center;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
  
  .form-control {
    padding: 12px 15px;
    font-size: 1em;
  }
  
  .contact-form textarea.form-control {
    min-height: 150px;
  }
}

/* ----- Section Documents ----- */
.documents-section {
  padding: 20px 0;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.document-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.document-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.document-card .document-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 15px;
  text-align: center;
}

.document-card .document-info h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 1.2rem;
}

.document-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.document-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.document-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

/* Style pour la carte d'ajout de document */
.document-card.add-new {
  border: 2px dashed #ccc;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.document-card.add-new:hover {
  border-color: var(--primary);
  background: rgba(74, 111, 165, 0.05);
}

.document-card.add-new .document-icon {
  color: #999;
  margin-bottom: 10px;
}

.document-card.add-new h3 {
  color: #666;
  text-align: center;
  margin-bottom: 5px;
}

.document-card.add-new p {
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 15px;
}

/* Style pour les différents types de fichiers */
.fa-file-pdf { color: #e74c3c; }
.fa-file-word { color: #2b579a; }
.fa-file-excel { color: #217346; }
.fa-file-powerpoint { color: #d24726; }
.fa-file-archive { color: #f39c12; }

/* Style pour le bouton de téléchargement secondaire */
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(74, 111, 165, 0.1);
}

/* Mode sombre pour les documents */
body.dark .document-card {
  background: #1e1e1e;
  border-color: #333;
}

body.dark .document-card h3 {
  color: #f0f0f0;
}

body.dark .document-meta {
  color: #aaa;
}

body.dark .document-card.add-new {
  border-color: #444;
  background: rgba(255, 255, 255, 0.03);
}

body.dark .document-card.add-new:hover {
  border-color: var(--primary);
  background: rgba(74, 111, 165, 0.1);
}

body.dark .btn-outline {
  border-color: var(--primary);
  color: var(--primary);
}

body.dark .btn-outline:hover {
  background: rgba(124, 140, 255, 0.2);
}
