/* ========================================
   VARIABLES & RESET
======================================== */

:root {
  /* Couleurs Dark Mode */
  --bg-primary: #0a0e17;
  --bg-secondary: #151b2b;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2a3d;
  --text-primary: #e8edf4;
  --text-secondary: #a8b3c7;
  --accent-primary: #00d4ff;
  --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #0099ff 100%);
  --border-color: #2a3547;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
  
  /* Typographie */
  --font-primary: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  
  /* Espacements */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-primary: #0099ff;
  --accent-gradient: linear-gradient(135deg, #0099ff 0%, #0066cc 100%);
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(0, 153, 255, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* ========================================
   NAVIGATION
======================================== */

.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Photo en bulle - SÉPARÉE et TOUJOURS EN HAUT */
.nav-photo-link {
  flex-shrink: 0;
  margin-right: auto;
}

.nav-photo-bubble {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  background: var(--bg-card);
}

.nav-photo-bubble::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent-gradient);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-photo-bubble:hover {
  transform: scale(1.1) rotate(5deg);
}

.nav-photo-bubble:hover::after {
  opacity: 1;
}

.nav-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Liens de navigation - TOUJOURS SUR LA MÊME LIGNE */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transform: translateX(-50%);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--accent-primary);
  background: var(--bg-card);
}

.nav-link:hover::before {
  width: 60%;
}

/* Bouton thème */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: rotate(180deg) scale(1.1);
  box-shadow: var(--shadow-glow);
}

/* ========================================
   RESPONSIVE NAVIGATION
======================================== */

@media (max-width: 768px) {
  .nav-container {
    padding: 0.8rem 1rem;
    gap: 1rem;
  }
  
  .nav-photo-bubble {
    width: 45px;
    height: 45px;
  }
  
  .nav-links {
    gap: 0.3rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
  }
  
  .theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

/* Si vraiment nécessaire, 2 lignes max */
@media (max-width: 600px) {
  .nav-container {
    flex-wrap: wrap;
  }
  
  .nav-photo-link {
    margin-right: 0;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   TERMINAL ANIMATION
======================================== */

.terminal-wrapper {
  max-width: 1200px;
  margin: 2rem auto 3rem;
  padding: 0 2rem;
}

.terminal {
  background: #000000;
  border: 2px solid var(--accent-primary);
  border-radius: 12px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
  min-height: 60px;
}

.terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(0, 212, 255, 0.1) 50%, 
    transparent 100%
  );
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% { transform: translateY(-30px); }
  100% { transform: translateY(100px); }
}

.cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background: var(--accent-primary);
  margin-left: 5px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ========================================
   MAIN CONTENT
======================================== */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  animation: fadeInUp 0.6s ease;
}

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

/* Titres */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--accent-primary);
  position: relative;
  padding-left: 1rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--accent-gradient);
  border-radius: 2px;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.5rem 0 0.8rem;
  color: var(--text-primary);
}

/* Paragraphes */
p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Listes */
ul, ol {
  margin: 1rem 0 1rem 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Liens */
a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

a:hover {
  color: var(--accent-primary);
  filter: brightness(1.2);
}

/* Séparateurs */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--border-color) 50%, 
    transparent 100%
  );
  margin: 2.5rem 0;
}

/* ========================================
   CARDS
======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.8rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

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

.card ul {
  margin-top: 1rem;
  margin-left: 1.2rem;
}

.card li {
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

/* ========================================
   CODE & TERMINAL STYLES
======================================== */

code {
  background: var(--bg-secondary);
  color: var(--accent-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ========================================
   FOOTER
======================================== */

.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  margin-top: 5rem;
  text-align: center;
}

.main-footer p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
  .terminal-wrapper,
  .main-content {
    padding: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.2rem;
  }
  
  .terminal {
    font-size: 0.85rem;
    padding: 1rem;
  }
  
  .card {
    padding: 1.2rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
}

/* ========================================
   UTILITIES
======================================== */

.text-center {
  text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.card {
  animation: fadeInUp 0.6s ease backwards;
}

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