/* Utility Classes */
.h-100 {
  height: 100% !important;
}

/* Theme toggle button */
.theme-toggle-container {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: 20px;
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  position: relative;
  white-space: nowrap;
}

:root[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.1);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--bg-color-secondary);
}

/* Theme toggle text */
.theme-text {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.5rem;
  display: inline-block;
}

/* Theme toggle icon */
.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

/* Hide text on very small screens */
@media (max-width: 480px) {
  .theme-text { display: none; }
}

.d-flex {
  display: flex !important;
}

.flex-column {
  flex-direction: column !important;
}

/* Base styles and variables */
:root {
  /* Hauteur de la navbar */
  --navbar-height: 80px;
  --navbar-scrolled-height: 70px;
  --navbar-transition: all 0.3s ease;

  --primary-color: #3498db;
  --secondary-color: #4895ef;
  --bg-color: #0f172a;
  --bg-color-secondary: #1e293b;
  --text-color: #f1f5f9;
  --header-bg: rgba(15, 23, 42, 0.8);
  --card-bg: #16213e;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --border-color: #2a3b5f;
  --skill-bg: #2a3b5f;
  --skill-level: linear-gradient(90deg, #4cc9f0, #4895ef);
  --section-bg: #0f3460;
  --footer-bg: #0b1120;
  --footer-text: #94a3b8;
  --skill-category-bg: rgba(42, 59, 95, 0.5);
}

/* Light theme overrides */
:root[data-theme="light"] {
  /* Palette claire avec hiérarchie visuelle renforcée */
  --bg-color: #f5f7fb;             /* fond principal légèrement bleuté */
  --bg-color-secondary: #f0f4f9;   /* fond secondaire (ex: barre latérale) */
  --text-color: #1a202c;           /* texte principal */
  --text-secondary: #4a5568;       /* texte secondaire (paragraphes, labels) */
  
  /* Cartes et conteneurs */
  --card-bg: #ffffff;              /* fond des cartes */
  --card-border: #e2e8f0;          /* bordure des cartes */
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* ombre subtile */
  --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); /* effet de survol */
  
  /* Sections */
  --section-bg: #f0f4f9;          /* fond des sections principales */
  --section-bg-alt: #e6edf7;      /* fond alternatif pour varier les sections */
  
  /* Pied de page */
  --footer-bg: #e2e8f0;           /* fond du pied de page */
  --footer-text: #2d3748;         /* texte du pied de page */
  
  /* Éléments interactifs */
  --primary-color: #2563eb;       /* couleur primaire (liens, boutons) */
  --primary-hover: #1d4ed8;       /* survol des éléments primaires */
  
  /* Compétences */
  --skill-bg: #e2e8f0;            /* fond des barres de compétences */
  --skill-level: #3b82f6;         /* niveau de compétence */
  --skill-category-bg: #e9edf5;   /* fond des catégories de compétences */
  
  /* Bordures */
  --border-color: #d1d9e6;        /* bordure générale */
  --border-light: #e2e8f0;        /* bordure légère */
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease;
  padding-top: var(--navbar-height);
  scroll-padding-top: calc(var(--navbar-height) + 1rem);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Styles pour les conteneurs principaux */
.main-content,
.section-content {
  background-color: var(--bg-color);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.main-content:hover,
.section-content:hover {
  box-shadow: var(--card-hover-shadow);
}

/* Cartes */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* En-têtes de section */
.section-header {
  background-color: var(--bg-color-secondary);
  border-bottom: 1px solid var(--border-light);
  padding: 1.5rem;
  border-radius: 8px 8px 0 0;
}

/* Pieds de section */
.section-footer {
  background-color: var(--bg-color-secondary);
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  border-radius: 0 0 8px 8px;
}

/* Bordures et séparateurs */
hr, .divider {
  border: 0;
  height: 1px;
  background-color: var(--border-light);
  margin: 1.5rem 0;
}

/* Style pour les éléments de formulaire */
input, textarea, select {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  outline: none;
}

html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 40px;
}

/* Smooth theme transitions for common UI blocks */
header.navbar,
footer,
.profile-sidebar,
.main-content,
.card,
.skill-category,
.project,
.certification-card,
.social-section,
.nav-sidebar a {
  transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease, box-shadow 250ms ease;
}

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

a:hover {
  color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Scroll reveal base states */
.reveal,
.reveal-left,
.reveal-right {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
  will-change: opacity, transform;
}

.reveal-left {
  transform: translateX(-24px);
}

.reveal-right {
  transform: translateX(24px);
}

.in-view {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
