/* Variables */
:root {
  --primary-color: #007bff;
  --secondary-color: #f4a261;
  --background-color: #f4f4f4;
  --text-color: #333;
  --header-bg-color: #000;
  --header-text-color: #fff;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
  --transition-normal: all 0.3s ease;
}

/* Global styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--background-color);
  touch-action: pan-y;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  touch-action: pan-y;
}

#animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Header */
header {
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.site-title {
  text-align: center;
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 0;
  margin-top: 10px;
  gap: 20px;
}

nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  transition: var(--transition-normal);
  padding: 5px 10px;
}

nav ul li a:hover {
  color: var(--secondary-color);
}

/* Common Section Styles */
.section {
  padding: 60px 0;
  background-color: #fff;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  touch-action: pan-y;
}

.section h2 {
  font-size: 32px;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-color);
}

/* About Section */
#about {
  text-align: center;
  padding: 30px 0;
}

.profile-picture {
  display: block;
  margin: 0 auto 10px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
  object-fit: cover;
  object-position: center;
}

.profile-picture:hover {
  transform: scale(1.05);
}

.about-content {
  max-width: 600px;
  margin: 0 auto;
}

.about-content h3 {
  margin-top: 15px;
  font-size: 22px;
}

/* Skills List */
.skill-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0;
  list-style: none;
  margin: 15px 0 0;
}

.skill-list li {
  background: var(--background-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.skill-list li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.resume-button-container {
  text-align: center;
  margin-top: 20px;
}

/* Timeline Section */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  width: 2px;
  background: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -1px;
}

.timeline-item {
  margin-bottom: 40px;
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: -8px;
  transition: var(--transition-normal);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
}

.timeline-content {
  width: calc(50% - 30px);
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition-normal);
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-left: auto;
}

.timeline-content:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Certifications Section - Version améliorée pour l'intégration des logos */
.certification-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 15px;
}

/* Style de base des cartes */
.certification-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
  border: 1px solid #eaeaea;
}

.certification-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.certification-header {
  background: var(--primary-color);
  color: white;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.certification-header img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: white;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  object-fit: contain;
  transition: transform 0.3s ease;
}

.certification-card:hover .certification-header img {
  transform: scale(1.1);
}

.certification-header h3 {
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
}

/* Contenu de la carte */
.certification-content {
  padding: 15px;
  font-size: 0.85rem;
}

.certification-details {
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #666;
}

.certification-motivation h4,
.certification-skills h4 {
  font-size: 0.9rem;
  margin: 10px 0 5px;
  color: #444;
}

.certification-motivation p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.certification-skills {
  margin-bottom: 12px;
}

.certification-skills ul {
  list-style: none;
  padding-left: 0;
  margin: 5px 0;
}

.certification-skills li {
  padding: 3px 0;
  position: relative;
  padding-left: 15px;
  font-size: 0.8rem;
}

.certification-skills li:before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary-color);
}

/* Style pour le bouton */
.certification-content .btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-decoration: none;
}

.certification-content .btn:hover {
  background-color: var(--primary-color-dark, #0056b3);
}

/* Responsive */
@media (max-width: 1200px) {
  .certification-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .certification-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .certification-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .certification-header h3 {
    font-size: 0.9rem;
  }
}

/* Projects Section */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
}

.project-card {
  margin: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.project-card img {
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.project-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.project-info p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: #666;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  transition: var(--transition-normal);
  font-weight: 500;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

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

/* Footer */
footer {
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}

.social-links {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.social-links a {
  color: var(--header-text-color);
  text-decoration: none;
  transition: var(--transition-normal);
  font-size: 16px;
}

.social-links a:hover {
  color: var(--secondary-color);
}

/* Loading States */
.project-card img:not([loaded]),
.certification-header img:not([loaded]) {
  opacity: 0;
}

/* Fallback for no JavaScript */
.no-js .timeline-item,
.no-js .skill-list li {
  opacity: 1 !important;
  transform: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* Header */
  .site-title {
    font-size: 24px;
  }

  nav ul {
    flex-wrap: wrap;
  }

  /* Sections */
  .section {
    padding: 40px 0;
  }

  .section h2 {
    font-size: 24px;
  }

  .about-content h3 {
    font-size: 20px;
  }

  /* Timeline */
  .timeline::before {
    left: 30px;
  }

  .timeline-dot {
    left: 30px;
  }

  .timeline-content {
    width: calc(100% - 80px);
    margin-left: 60px !important;
  }

  /* Grids */
  .project-grid,
  .certification-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons - Updated with your modifications */
  .project-actions {
    justify-content: center;
  }

  .btn {
    width: auto; /* Remove full width */
    padding: 8px 16px; /* Reduce padding */
    font-size: 14px; /* Smaller font */
    max-width: 200px; /* Set maximum width */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Space between icon and text */
  }
  
  .resume-button-container {
    margin-top: 15px;
    margin-bottom: 15px;
  }
}

/* Print Styles */
@media print {
  #animated-background {
    display: none;
  }

  .section {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .project-card,
  .certification-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
