/*-----------------------------
  Variables Globales
-----------------------------*/

:root {
  --primary-color: #121212;
  --secondary-color: #1e1e1e;
  --accent-color: #bb86fc;
  --accent-pink: #cf6679;
  --accent-blue: #03dac6;
  --accent-orange: #f4a261;
  --primary-text-color: #e0e0e0;
  --heading-color: #bb86fc;
  --link-color: #03dac6;
  --link-hover-color: #cf6679;
  --card-background-color: #1e1e1e;
  --card-text-color: #e0e0e0;
  --card-heading-color: #bb86fc;
}

/*-----------------------------
  Styles de base
-----------------------------*/

body {
  font-family: "Montserrat", sans-serif;
  background: linear-gradient(-45deg, #1e1e1e, #121212);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--primary-text-color);
  overflow-x: hidden;
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/*-----------------------------
  Styles pour les cartes de projet
-----------------------------*/

.project-card {
  background: var(--card-background-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

/*-----------------------------
  Styles pour les articles
-----------------------------*/

.article-card {
  background: var(--card-background-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    var(--accent-color), 
    var(--link-color), 
    var(--accent-color)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.article-card:hover::before {
  opacity: 1;
}

/* Style pour les tags dans les articles */
.article-card .tag {
  background: var(--accent-color);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.article-card .tag:hover {
  transform: scale(1.05);
}

/*-----------------------------
  Modal pour articles
-----------------------------*/

#articleModal .prose {
  color: var(--primary-text-color);
  line-height: 1.8;
}

#articleModal .prose h1,
#articleModal .prose h2,
#articleModal .prose h3 {
  color: var(--heading-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

#articleModal .prose p {
  margin-bottom: 1.5rem;
}

/*-----------------------------
  Navigation
-----------------------------*/

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(10, 10, 35, 0.5);
  backdrop-filter: blur(10px);
  z-index: 100;
  overflow-x: hidden;
}

/*-----------------------------
  Intro et animations
-----------------------------*/

.terminal {
  padding: 20px;
}

#intro::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 20px;
  background-color: var(--accent-color);
  margin-left: 5px;
  animation: blink 1.5s steps(2, start) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card.animate__fadeInUp {
  animation-delay: calc(var(--animation-order, 0) * 0.1s);
}

/*-----------------------------
  Superposition d'introduction
-----------------------------*/

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #1a1a2e);
  z-index: 9999;
  opacity: 1;
  transition: opacity 2s ease-out;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/*-----------------------------
  Liens et titres
-----------------------------*/

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

h2 {
  color: var(--heading-color);
  margin-top: 40px;
  text-shadow: 0 0 5px rgba(187, 134, 252, 0.3);
}

h2:nth-of-type(2n) {
  color: var(--accent-blue);
}

h2:nth-of-type(3n) {
  color: var(--accent-orange);
}

p {
  font-size: 1.2em;
  line-height: 1.5em;
}

/*-----------------------------
  Boutons
-----------------------------*/

.button {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-pink));
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  font-weight: 500;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(187, 134, 252, 0.3);
  text-decoration: none;
  color: white;
}

/*-----------------------------
  Responsive Design
-----------------------------*/

@media (max-width: 768px) {
  #articles-list,
  #projects-list {
    grid-template-columns: 1fr;
  }
  
  .article-card,
  .project-card {
    margin-bottom: 1rem;
  }
  
  .terminal {
    padding: 10px;
  }
  
  p {
    font-size: 1em;
  }
}

/*-----------------------------
  Particules
-----------------------------*/

#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/*-----------------------------
  Scroll vers le haut
-----------------------------*/

#backToTop {
  transition: all 0.3s ease;
}

#backToTop:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
}

/*-----------------------------
  Animations et transitions
-----------------------------*/

.animate__animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.animate__fadeInUp {
  animation-name: fadeInUp;
}

/* Amélioration des cartes avec effet de survol */
.project-card,
.article-card {
  cursor: pointer;
}

.project-card:hover .text-accent-pink,
.article-card:hover .text-accent-pink {
  color: var(--accent-blue) !important;
}

/* Style pour les tags */
.bg-accent-pink {
  background-color: var(--accent-pink) !important;
}

.text-accent-pink {
  color: var(--accent-pink) !important;
}

.text-accent-blue {
  color: var(--accent-blue) !important;
}
