/* ===============================================
   COMPONENTS.CSS - Composants réutilisables
   =============================================== */

/* ========== CARDS ========== */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Card with icon */
.card-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.card-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

/* Project Card */
.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.project-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-card-image {
  transform: scale(1.1);
}

.project-card-content {
  padding: 1.5rem;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ========== TAGS / BADGES ========== */
.tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

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

.tag-secondary {
  background: var(--secondary);
  color: var(--text-primary);
  border-color: var(--secondary);
}

/* ========== PROGRESS BAR ========== */
.progress-container {
  margin-bottom: 2rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

/* ========== STATS COUNTER ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.stat-card {
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========== TIMELINE ========== */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-content {
  width: calc(50% - 30px);
  padding: 1.5rem;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.timeline-marker {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border: 4px solid var(--background);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  box-shadow: 0 0 0 4px var(--primary);
}

/* ========== ACCORDION ========== */
.accordion {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.accordion-header {
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.accordion-header:hover {
  background: var(--surface-hover);
}

.accordion-icon {
  transition: transform var(--transition-fast);
}

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

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  padding: 0 1.5rem;
  color: var(--text-secondary);
}

.accordion.active .accordion-content {
  max-height: 1000px;
  padding: 0 1.5rem 1.5rem;
}

/* ========== MODAL ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--primary);
  color: white;
  transform: rotate(90deg);
}

/* ========== TECH STACK ICONS ========== */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.tech-icon {
  width: 80px;
  height: 80px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.tech-icon:hover {
  transform: translateY(-8px) scale(1.1);
  box-shadow: var(--shadow-glow);
  border-color: var(--primary);
}

.tech-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* ========== FORM ELEMENTS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary), 0.1);
}

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

/* ========== SOCIAL LINKS ========== */
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.social-link {
  width: 50px;
  height: 50px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.social-link:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

/* ========== FILTER BUTTONS ========== */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    flex-direction: row !important;
  }

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

  .timeline-marker {
    left: 30px;
  }

  .tech-stack {
    gap: 1rem;
  }

  .tech-icon {
    width: 60px;
    height: 60px;
  }

  .tech-icon img {
    width: 36px;
    height: 36px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }
}

/* ========== PAGE-SPECIFIC: PROFIL ========== */

/**
 * Profile About Grid
 * @description Layout sidebar + main content pour la page profil
 * @example <div class="profil-about-grid">...</div>
 */
.profil-about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

/**
 * Profile Stats Grid
 * @description Grille 4 colonnes pour les statistiques
 * @example <div class="profil-stats-grid">...</div>
 */
.profil-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.profil-stats-grid > .stat-box {
    min-width: 0; /* Prevent overflow */
}

/**
 * Timeline List Item
 * @description Style pour les listes dans la timeline
 * @example <ul class="timeline-list">...</ul>
 */
.timeline-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-list li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.timeline-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/**
 * Stat Box
 * @description Boîte de statistique simple avec valeur + label
 * @example <div class="stat-box">...</div>
 */
.stat-box {
    padding: 1.5rem;
    text-align: center;
}

.stat-box__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-box__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/**
 * Vision Card Header
 * @description En-tête de carte avec icône et titre
 * @example <div class="vision-header">...</div>
 */
.vision-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/**
 * Development Axis
 * @description Cartes pour les axes de développement
 * @example <div class="dev-axis">...</div>
 */
.dev-axis {
    text-align: center;
    padding: 1.5rem;
}

.dev-axis__icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 992px) {
    .profil-about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profil-about-grid > .glass:first-child {
        max-width: 350px;
        margin: 0 auto;
    }
}

/* Profil stats grid responsive - mobile first */
@media (max-width: 992px) {
    .profil-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .profil-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    .stat-box__value {
        font-size: 1.5rem;
    }
}
