/* Variables et Design System */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #475569;
  --accent: #8b5cf6;
  --background: #0f172a; /* Dark Mode Background */
  --card-bg: #1e293b; /* Dark Mode Card Background */
  --text-primary: #f1f5f9; /* Dark Mode Primary Text */
  --text-secondary: #94a3b8; /* Dark Mode Secondary Text */
  --success: #22c55e;
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  line-height: 1.6;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  min-height: 80vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="50"/></svg>')
    70% 70% no-repeat;
  opacity: 0.1;
  transform: scale(3);
}

/* Navigation Styles */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.9); /* Dark Mode Nav */
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin: 4rem 0 2rem;
  position: relative;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-header::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 1rem auto;
}

/* Category Headers */
.category-header {
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    rgba(0, 0, 0, 0) 100%
  ); /* Dark Mode Category Header */
  padding: 1rem 2rem;
  margin: 3rem 0 2rem;
  color: white;
  transform: translateX(-20px);
  opacity: 0;
  animation: slideIn 0.5s ease forwards;
}

/* Category-specific colors */
#travaux-s4 .category-header:nth-of-type(1) {
  background: linear-gradient(90deg, #2196f3 0%, transparent 100%);
}

#travaux-s4 .category-header:nth-of-type(2) {
  background: linear-gradient(90deg, #9c27b0 0%, transparent 100%);
}

#travaux-s4 .category-header:nth-of-type(3) {
  background: linear-gradient(90deg, #4caf50 0%, transparent 100%);
}

/* Projects Grid */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto 4rem auto;
}

@media (min-width: 1200px) {
  .projects {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Project Cards */
.project {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--border-radius);
  background: linear-gradient(45deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.project:hover {
  transform: translateY(-5px) rotateX(5deg);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.project:hover::before {
  opacity: 0.1;
}

/* Project Images */
.project-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.project img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project:hover img {
  transform: scale(1.05);
}

/* Glow Effect */
.glow-effect {
  position: relative;
  overflow: hidden;
}

.glow-effect::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.8) 0%,
    transparent 50%
  );
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.project:hover .glow-effect::after {
  opacity: 0.4;
  transform: scale(1);
}

/* Project Content */
.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  position: relative;
  transition: color 0.3s ease;
}

.project-title::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.project:hover .project-title::before {
  width: 100%;
}

/* Technology Badges */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem;
}

.tech-badge {
  background: #334155; /* Dark Mode Tech Badge Background */
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  color: #cbd5e1; /* Dark Mode Tech Badge Text */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(0);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.tech-badge i {
  font-size: 1rem;
}

.tech-badge:hover {
  transform: translateY(-3px);
  background-color: var(--primary);
  color: white;
}

/* Project Links */
.project-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.project-link:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Empty Project Placeholders */
.project.empty {
  border: 2px dashed rgba(255, 255, 255, 0.1); /* Dark Mode Empty Project Border */
  background: transparent;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.project.empty::before {
  content: "+ Nouveau projet";
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Animations */
@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeUp {
  animation: fadeUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }

  .project {
    margin: 1rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  header {
    min-height: 60vh;
  }
}
