/* ======================
   Page des Projets
   ====================== */

/* Conteneur principal */
#projects {
  padding: 7rem 1.5rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* En-tête */
.projects-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  padding-top: 1rem;
}

.projects-header h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  display: inline-block;
  position: relative;
  font-weight: 600;
  letter-spacing: 1px;
}

.projects-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  border-radius: 3px;
}

.projects-header p {
  color: var(--text-color);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
  opacity: 0.9;
  font-weight: 300;
}

/* Grille des projets */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
  padding: 1rem;
}

/* Carte de projet */
.project {
  background: rgba(30, 41, 59, 0.7);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(74, 108, 187, 0.1);
  display: flex;
  flex-direction: column;
  height: 600px; /* Hauteur fixe pour toutes les cartes */
  backdrop-filter: blur(10px);
}

.project:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  border-color: rgba(74, 108, 187, 0.3);
  background: rgba(30, 41, 59, 0.9);
}

/* En-tête de la carte */
.project h3 {
  font-size: 1.5rem;
  color: var(--text-color);
  margin: 1.5rem 1.5rem 1rem;
  line-height: 1.3;
}

/* Galerie d'images du projet */
.project-gallery {
  width: 100%;
  height: 250px;
  position: relative;
  overflow: hidden;
  background-color: #f5f5f5;
  border-radius: 8px 8px 0 0;
}

.main-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  overflow: hidden;
}

.main-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  padding: 10px;
  display: none;
}

.main-image img.active {
  display: block;
}

.thumbnail-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  overflow-x: auto;
  padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

.thumbnail-container::-webkit-scrollbar {
  height: 4px;
}

.thumbnail-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.thumbnail-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
}

.thumbnail {
  width: 40px;
  height: 30px;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
  object-fit: cover;
  border: 2px solid transparent;
  flex-shrink: 0;
  background-color: #fff;
  padding: 2px;
}

.thumbnail:hover {
  opacity: 1;
  transform: scale(1.1);
}

.thumbnail.active {
  opacity: 1;
  border-color: var(--primary-color);
  transform: scale(1.1);
}

/* Contenu de la carte */
.project-details {
  padding: 0 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Description */
.project p {
  color: var(--text-color);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  opacity: 0.9;
  font-weight: 300;
  font-size: 0.95rem;
}

/* Liste des fonctionnalités */
.project-details h4 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin: 1.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  padding-bottom: 0.5rem;
  font-weight: 500;
}

.project-details h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
}

.project-details ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.project-details li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.project-details li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* Technos utilisées */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.tech-tag {
  background: rgba(74, 108, 187, 0.15);
  color: var(--primary-color);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(74, 108, 187, 0.2);
}

.tech-tag:hover {
  background: rgba(74, 108, 187, 0.25);
  transform: translateY(-2px);
}

/* Contenu défilant */
.project-details {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.project-details::-webkit-scrollbar {
  width: 6px;
}

.project-details::-webkit-scrollbar-track {
  background: transparent;
}

.project-details::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 3px;
}

/* Liens du projet */
.project-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  bottom: 0;
  background: rgba(30, 41, 59, 0.95);
  padding-bottom: 0.5rem;
  z-index: 1;
}

.project-links .btn {
  flex: 1;
  text-align: center;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.project-links .btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-links .btn i {
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

.project-links .btn:hover i {
  transform: translateX(2px);
}

/* Styles responsifs */
@media (max-width: 1200px) {
  .projects-grid {
    gap: 2rem;
  }
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .project {
    height: 580px;
  }
}

@media (max-width: 768px) {
  #projects {
    padding: 5.5rem 1rem 2rem;
  }
  
  .projects-header h2 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
  }
  
  .projects-header p {
    font-size: 1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
    gap: 1.5rem;
  }
  
  .project {
    height: auto;
    max-height: 600px;
  }
  
  .project h3 {
    font-size: 1.4rem;
    margin: 1.2rem 1.2rem 1rem;
  }
  
  .project-links {
    position: relative;
    background: transparent;
    padding-top: 1rem;
    margin-top: 1rem;
  }
  
  .project-links .btn {
    width: 100%;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .projects-header h2 {
    font-size: 1.8rem;
  }
  
  .project {
    border-radius: 10px;
  }
  
  .project-details {
    padding: 1.2rem;
  }
  
  .project-links {
    flex-direction: column;
    gap: 0.8rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .project-card {
    max-width: 100%;
  }
}

/* Project Filters */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  background: var(--bg-color-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
