/* ============================================
   PROJECT DETAIL - Stylesheet
   Design cohérent avec le portfolio
   ============================================ */

main {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */
.project-detail {
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 1;
}

.project-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  width: 100%;
  max-width: 1200px;
  align-items: start;
}

/* ============================================
   HERO SECTION
   ============================================ */
.project-hero {
  background: linear-gradient(
    135deg,
    var(--color-surface) 0%,
    rgba(124, 106, 247, 0.08) 100%
  );
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.project-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(124, 106, 247, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.project-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    var(--color-accent) 50%,
    var(--color-primary) 100%
  );
}

.project-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
}

.project-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-title {
  font-family: var(--title-font);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.project-meta {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: center;
}

.project-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.project-meta i {
  color: var(--color-primary);
}

/* ============================================
   BADGES
   ============================================ */
.project-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-badge::before {
  font-family: "Font Awesome 6 Free";
  font-size: 0.65rem;
}

.project-badge.en-cours {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-primary-dark) 100%
  );
  color: white;
  box-shadow: 0 2px 10px rgba(124, 106, 247, 0.3);
}

.project-badge.en-cours::before {
  content: "\f017";
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.project-badge.termine {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.25);
}

.project-badge.termine::before {
  content: "\f00c";
  font-weight: 900;
}

/* ============================================
   BOUTON RETOUR
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  position: relative;
}

.back-link:hover {
  color: var(--color-primary);
}

.back-link i {
  transition: transform 0.2s ease;
}

.back-link:hover i {
  transform: translateX(-3px);
}

.back-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width 0.2s ease;
}

.back-link:hover::after {
  width: 100%;
}

/* ============================================
   SIDEBAR
   ============================================ */
.project-sidebar {
  position: sticky;
  top: 50vh;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-section {
  background: var(--color-surface);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.sidebar-section:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 25px rgba(124, 106, 247, 0.15);
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-title i {
  color: var(--color-accent);
  font-size: 0.9rem;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(124, 106, 247, 0.05);
  border-radius: 0.6rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-link-active {
  color: var(--color-text-primary);
  background: rgba(124, 106, 247, 0.1);
}

.sidebar-link-active:hover {
  background: var(--color-primary);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(124, 106, 247, 0.25);
}

.sidebar-link-inactive {
  color: var(--color-text-secondary);
  cursor: not-allowed;
  opacity: 0.5;
}

.sidebar-link i {
  font-size: 1.1rem;
  color: var(--color-primary);
  width: 20px;
  text-align: center;
  transition: color 0.2s ease;
}

.sidebar-link-active:hover i {
  color: white;
}

.sidebar-link span {
  font-size: 0.9rem;
}

.sidebar-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-techs .tech-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(124, 106, 247, 0.08);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-techs .tech-item:hover {
  background: rgba(124, 106, 247, 0.2);
  border-color: var(--color-primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 15px rgba(124, 106, 247, 0.2);
}

.sidebar-techs .tech-item i {
  font-size: 1.75rem;
  color: var(--color-primary);
}

/* ============================================
   SECTIONS
   ============================================ */
.project-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(124, 106, 247, 0.12);
}

.project-section:last-of-type {
  border-bottom: none;
}

.section-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-subtitle i {
  color: var(--color-accent);
  font-size: 1rem;
}

.section-content {
  color: var(--color-text-primary);
  line-height: 1.75;
}

.section-content p {
  margin-bottom: 1rem;
}

.section-content p:last-child {
  margin-bottom: 0;
}

.content-list {
  list-style: none;
  padding-left: 0;
}

.content-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-left: 1rem;
  padding: 0.6rem 0;
  color: var(--color-text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid rgba(124, 106, 247, 0.08);
}

.content-list-item:last-child {
  border-bottom: none;
}

.content-list-item::before {
  content: "→";
  color: var(--color-primary);
  font-weight: 600;
  flex-shrink: 0;
}

/* ============================================
   DÉFIS & SOLUTIONS
   ============================================ */
.challenge-solution-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.challenge-item,
.solution-item {
  padding: 1.25rem;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}

.challenge-item {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.08) 0%,
    rgba(239, 68, 68, 0.02) 100%
  );
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.challenge-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.solution-item {
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.08) 0%,
    rgba(34, 197, 94, 0.02) 100%
  );
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.solution-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.challenge-item h3,
.solution-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.challenge-item h3 {
  color: #ef4444;
}

.challenge-item h3::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-size: 0.85rem;
}

.solution-item h3 {
  color: #22c55e;
}

.solution-item h3::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-size: 0.85rem;
}

.challenge-item p,
.solution-item p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   CAPTURES D'ÉCRAN
   ============================================ */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.screenshots-grid .screenshot-item:first-child {
  grid-column: 1 / -1;
}

.screenshot-item {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
  transition: all 0.3s ease;
  position: relative;
}

.screenshot-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--color-primary);
}

.screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 300px;
  object-fit: cover;
  cursor: zoom-in;
  transition: all 0.3s ease;
}

.screenshot-item:hover img {
  transform: scale(1.02);
}

/* ============================================
   LISTE COMPÉTENCES
   ============================================ */
.skills-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.75rem;
}

.skills-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface);
  border-radius: 0.6rem;
  color: var(--color-text-primary);
  font-size: 0.9rem;
  border: 1px solid rgba(124, 106, 247, 0.15);
  transition: all 0.2s ease;
}

.skills-list li:hover {
  border-color: var(--color-primary);
  transform: translateX(4px);
}

.skills-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(124, 106, 247, 0.5);
}

/* ============================================
   RESPONSIVE - Tablette
   ============================================ */
@media (max-width: 1024px) {
  .project-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-section {
    flex: 1;
    min-width: 200px;
  }

  .screenshots-grid {
    grid-template-columns: 1fr;
  }

  .screenshots-grid .screenshot-item:first-child {
    grid-column: auto;
  }

  .challenge-solution-container {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }

  .project-layout {
    gap: 1.5rem;
  }

  .project-detail {
    padding: 0;
  }

  .project-hero {
    padding: 1.5rem;
  }

  .project-title {
    font-size: 1.75rem;
  }

  .project-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .project-status {
    align-self: flex-start;
  }

  .sidebar-section {
    padding: 1rem;
  }

  .sidebar-title {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .sidebar-techs .tech-item {
    width: 42px;
    height: 42px;
  }

  .sidebar-techs .tech-item i {
    font-size: 1.5rem;
  }

  .skills-list {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   RESPONSIVE - Small Mobile
   ============================================ */
@media (max-width: 480px) {
  main {
    padding: 0.75rem;
  }

  .project-detail {
    padding: 0;
  }

  .back-link {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
  }

  .project-hero {
    padding: 1.25rem;
    border-radius: 1rem;
  }

  .project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .project-header {
    flex-direction: column;
    gap: 1rem;
  }

  .section-subtitle {
    font-size: 1.1rem;
  }

  .project-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .section-content p {
    font-size: 0.9rem;
  }

  .challenge-item,
  .solution-item {
    padding: 1rem;
  }

  .challenge-item h3,
  .solution-item h3 {
    font-size: 0.9rem;
  }

  .project-sidebar {
    flex-direction: column;
    gap: 1rem;
  }

  .sidebar-section {
    min-width: auto;
  }
}

/* ============================================
   SCREENSHOT OVERLAY
    ============================================ */
.screenshot-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.screenshot-overlay.active {
  opacity: 1;
  visibility: visible;
}

.screenshot-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  cursor: default;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.screenshot-overlay.active img {
  transform: scale(1);
}

.overlay-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: rgba(124, 106, 247, 0.2);
  border: 1px solid var(--color-primary);
  border-radius: 50%;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.overlay-close:hover {
  background: var(--color-primary);
  transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
  .screenshot-overlay {
    transition: none;
  }

  .screenshot-overlay img {
    transform: none;
  }

  .overlay-close:hover {
    transform: none;
  }
}

/* ============================================
   REDUCED MOTION
    ============================================ */
@media (prefers-reduced-motion: reduce) {
  .project-badge.en-cours::before {
    animation: none;
  }

  .sidebar-section:hover {
    transform: none;
  }

  .screenshot-item:hover {
    transform: none;
  }

  .screenshot-item:hover img {
    transform: none;
  }
}
