/* ===================================
   Learning Modal - Styles dédiés
   =================================== */

/* Modal Container */
#learning-modal.modal {
  backdrop-filter: blur(15px);
  overflow-y: auto;
}

#learning-modal .modal-content {
  max-width: 850px;
  max-height: 90vh;
  margin: 2rem auto;
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Modal Body */
.learning-modal-body {
  padding: 3rem;
  background: linear-gradient(135deg, var(--color-card) 0%, #fafafa 100%);
}

/* Header Section */
.learning-modal-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.05) 0%, rgba(0, 113, 227, 0.02) 100%);
  border-radius: 16px;
  border: 2px solid rgba(0, 113, 227, 0.1);
  position: relative;
  overflow: hidden;
}

.learning-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmerHeader 3s infinite;
}

@keyframes shimmerHeader {
  0% { left: -100%; }
  100% { left: 200%; }
}

.learning-modal-icon {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: white;
  border: 3px solid rgba(0, 113, 227, 0.2);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.15);
  transition: all 0.3s ease;
}

.learning-modal-icon:hover {
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 12px 32px rgba(0, 113, 227, 0.25);
}

.learning-modal-header > div {
  flex: 1;
}

.learning-modal-header h2 {
  text-align: left;
  margin-bottom: 0.75rem;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.learning-modal-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  font-weight: 400;
}

/* Journey Section */
.learning-modal-journey {
  margin-top: 2.5rem;
}

.learning-modal-journey h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.learning-modal-journey h3 i {
  color: var(--color-accent);
  animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.journey-intro {
  font-size: 1.05rem;
  color: var(--color-text-secondary);
  margin-bottom: 2.5rem;
  text-align: center;
  padding: 1rem;
  background: rgba(0, 113, 227, 0.03);
  border-radius: 10px;
  border-left: 4px solid var(--color-accent);
}

.journey-intro span {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1.1rem;
}

/* Journey Path - Vertical Timeline */
.journey-path {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 2.5rem 0;
  position: relative;
}

/* Ligne verticale de connexion */
.journey-path::before {
  content: '';
  position: absolute;
  left: 29px;
  top: 30px;
  bottom: 30px;
  width: 3px;
  background: linear-gradient(180deg,
    var(--color-accent) 0%,
    var(--color-border) 50%,
    var(--color-border) 100%);
  z-index: 0;
}

/* Milestone Cards */
.journey-milestone {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  border: 2px solid var(--color-border);
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  transform: translateX(-30px);
  animation: slideInMilestone 0.6s ease forwards;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

@keyframes slideInMilestone {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.journey-milestone:nth-child(1) { animation-delay: 0.1s; }
.journey-milestone:nth-child(2) { animation-delay: 0.2s; }
.journey-milestone:nth-child(3) { animation-delay: 0.3s; }
.journey-milestone:nth-child(4) { animation-delay: 0.4s; }
.journey-milestone:nth-child(5) { animation-delay: 0.5s; }

.journey-milestone + .journey-milestone {
  margin-top: 1.5rem;
}

/* États des milestones */
.journey-milestone.completed {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.08) 0%, white 100%);
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.12);
}

.journey-milestone.current {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.12) 0%, white 100%);
  border-color: var(--color-accent);
  border-width: 3px;
  box-shadow: 0 8px 30px rgba(0, 113, 227, 0.25);
  transform: translateX(0) scale(1.02);
}

.journey-milestone.upcoming {
  opacity: 0.5;
  background: #fafafa;
}

.journey-milestone:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(0, 113, 227, 0.2);
}

.journey-milestone.current:hover {
  transform: translateX(8px) scale(1.02);
}

/* Milestone Icon */
.journey-milestone-icon {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  transition: all 0.4s ease;
  position: relative;
}

.journey-milestone.completed .journey-milestone-icon {
  background: linear-gradient(135deg, var(--milestone-color, var(--color-accent)) 0%,
              color-mix(in srgb, var(--milestone-color, var(--color-accent)) 80%, black) 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.4);
}

.journey-milestone.completed .journey-milestone-icon::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-success);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(48, 209, 88, 0.4);
}

.journey-milestone.current .journey-milestone-icon {
  background: linear-gradient(135deg, var(--milestone-color, var(--color-accent)) 0%,
              color-mix(in srgb, var(--milestone-color, var(--color-accent)) 80%, black) 100%);
  color: white;
  box-shadow: 0 12px 32px rgba(0, 113, 227, 0.5);
  animation: pulseCurrentMilestone 2s ease-in-out infinite;
}

@keyframes pulseCurrentMilestone {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 12px 32px rgba(0, 113, 227, 0.5);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 16px 40px rgba(0, 113, 227, 0.7);
  }
}

.journey-milestone.current .journey-milestone-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 18px;
  border: 2px solid var(--color-accent);
  animation: rotateRing 3s linear infinite;
}

@keyframes rotateRing {
  0% { transform: rotate(0deg); opacity: 0.5; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg); opacity: 0.5; }
}

.journey-milestone.upcoming .journey-milestone-icon {
  background: white;
  border: 3px dashed var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: none;
}

/* Milestone Content */
.journey-milestone-content {
  flex: 1;
  padding-top: 0.25rem;
}

.journey-milestone-content h4 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.journey-milestone-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}

.journey-milestone.completed .journey-milestone-status {
  background: rgba(0, 113, 227, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(0, 113, 227, 0.3);
}

.journey-milestone.current .journey-milestone-status {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
  animation: pulseStatus 2s ease-in-out infinite;
}

@keyframes pulseStatus {
  0%, 100% { box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4); }
  50% { box-shadow: 0 6px 20px rgba(0, 113, 227, 0.6); }
}

.journey-milestone.upcoming .journey-milestone-status {
  background: #f0f0f0;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.journey-milestone-content p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-top: 0.5rem;
}

.journey-milestone.completed .journey-milestone-content p {
  color: color-mix(in srgb, var(--color-text-secondary) 90%, var(--color-accent));
}

/* Legend Section */
.journey-legend {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
  padding: 1.5rem;
  background: rgba(0, 113, 227, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(0, 113, 227, 0.1);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--color-text);
  font-weight: 500;
  transition: all 0.3s ease;
}

.legend-item:hover {
  transform: translateY(-2px);
}

.legend-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.legend-icon.completed {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.legend-icon.current {
  background: var(--color-accent);
  color: white;
  animation: pulseLegend 2s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

@keyframes pulseLegend {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.legend-icon.upcoming {
  background: white;
  border: 2px dashed var(--color-border);
  color: var(--color-text-secondary);
}

/* Close Button Enhancement */
#learning-modal .modal-close {
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
  background: white;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
}

#learning-modal .modal-close:hover {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .learning-modal-body {
    padding: 2rem;
  }

  .learning-modal-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .learning-modal-header h2 {
    font-size: 1.8rem;
    text-align: center;
  }

  .learning-modal-icon {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .journey-path::before {
    left: 24px;
  }

  .journey-milestone {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .journey-milestone-icon {
    width: 60px;
    height: 60px;
    font-size: 1.7rem;
  }

  .journey-milestone-content h4 {
    font-size: 1.15rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .journey-legend {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
  }

  .learning-modal-journey h3 {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .learning-modal-body {
    padding: 1.5rem;
  }

  .learning-modal-header {
    padding: 1.25rem;
  }

  .learning-modal-header h2 {
    font-size: 1.5rem;
  }

  .learning-modal-icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .journey-milestone {
    padding: 1.25rem;
  }

  .journey-milestone-icon {
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
  }

  .journey-intro {
    font-size: 0.95rem;
  }
}

.fa-crosshairs {
    color: white;
}
