/* Variables CSS pour le thème */
:root {
  --primary-color: #6366f1;
  --primary-dark: #4f46e5;
  --bg-light: #ffffff;
  --bg-dark: #0f172a;
  --text-light: #334155;
  --text-dark: #e2e8f0;
  --card-light: #ffffff;
  --card-dark: #1e293b;
  --border-light: rgba(0, 0, 0, 0.1);
  --border-dark: rgba(255, 255, 255, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --backdrop: rgba(255, 255, 255, 0.8);
  --backdrop-dark: rgba(15, 23, 42, 0.9);
}

/* Police par défaut */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Mode clair (défaut) */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-light);
  min-height: 100vh;
  transition: all 0.3s ease;
  position: relative;
}

/* Particules en arrière-plan */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
}

/* Navigation */
.navbar {
  background: var(--backdrop) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
  transition: all 0.3s ease;
}

/* Titre principal avec effet de gradient */
.gradient-text {
  color: #fff;
  background: none;
  font-weight: 700;
  letter-spacing: -0.025em;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background-clip: initial;
  text-shadow: none;
}

/* Sous-titre avec style amélioré */
.subtitle-enhanced {
  color: #fff;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: 0.025em;
  opacity: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
}

/* Titre de section stylé */
.section-title {
  color: #fff;
  background: none;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.section-title::before,
.section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 2px;
  background: #fff;
  transform: translateY(-50%);
}

.section-title::before {
  left: -60px;
}

.section-title::after {
  right: -60px;
}

/* Cartes de services */
.service-card {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px var(--shadow-light);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  color: var(--text-light);
  overflow: hidden;
  position: relative;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(99, 102, 241, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

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

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px var(--shadow-light), 0 10px 10px -5px var(--shadow-light);
  border-color: var(--primary-color);
}

.service-card .card-body {
  position: relative;
  z-index: 1;
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.service-card .card-title {
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Carte d'informations */
.info-card {
  background: var(--card-light);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px var(--shadow-light);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.info-card .card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  padding: 1.5rem;
}

.info-item {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  transition: all 0.3s ease;
}

.info-item:hover {
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.02);
}

.info-item code {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.info-item code:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* Boutons de contrôle */
#music-control, #nightModeToggle {
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(99, 102, 241, 0.5) !important;
  color: white !important;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#music-control:hover, #nightModeToggle:hover {
  background: rgba(99, 102, 241, 0.8) !important;
  border-color: rgba(99, 102, 241, 0.8) !important;
  transform: scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

/* Mode sombre pour les boutons */
[data-theme="dark"] #music-control, 
[data-theme="dark"] #nightModeToggle {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] #music-control:hover, 
[data-theme="dark"] #nightModeToggle:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.music-playing #music-icon {
  animation: pulse 2s infinite;
}

/* Mode sombre */
[data-theme="dark"] {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-dark);
}

[data-theme="dark"] .navbar {
  background: var(--backdrop-dark) !important;
  border-bottom-color: var(--border-dark);
}

[data-theme="dark"] .service-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
  color: var(--text-dark);
  box-shadow: 0 4px 6px -1px var(--shadow-dark);
}

[data-theme="dark"] .service-card:hover {
  box-shadow: 0 20px 25px -5px var(--shadow-dark), 0 10px 10px -5px var(--shadow-dark);
}

[data-theme="dark"] .service-card .card-title {
  color: var(--text-dark);
}

[data-theme="dark"] .info-card {
  background: var(--card-dark);
  border-color: var(--border-dark);
  box-shadow: 0 10px 15px -3px var(--shadow-dark);
}

[data-theme="dark"] .info-item {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .info-item:hover {
  background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .info-item code {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

[data-theme="dark"] .info-item code:hover {
  background: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .info-item small {
    color: #a5b4fc !important;
}

[data-theme="dark"] .info-item strong {
    color: #a5b4fc;
  }

/* Mode sombre pour les nouveaux styles */
[data-theme="dark"] .subtitle-enhanced {
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .section-title {
  color: #fff;
}
[data-theme="dark"] .section-title::before,
[data-theme="dark"] .section-title::after {
  background: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .display-3 {
    font-size: 2.5rem;
  }
  
  .service-icon {
    font-size: 2rem;
  }
  
  .navbar {
    padding: 0.5rem 0;
  }
  
  header {
    padding: 2rem 0 !important;
  }
  
  .info-item {
    margin-bottom: 1rem;
  }
  
  .subtitle-enhanced {
    font-size: 1.1rem;
  }
  
  .section-title {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }
  
  .section-title::before,
  .section-title::after {
    width: 20px;
  }
  
  .section-title::before {
    left: -30px;
  }
  
  .section-title::after {
    right: -30px;
  }
}

@media (max-width: 576px) {
  .display-3 {
    font-size: 2rem;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .service-card {
    margin-bottom: 1rem;
  }
  
  .subtitle-enhanced {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  .section-title::before,
  .section-title::after {
    display: none;
  }
  
  .section-title {
    font-size: 0.9rem;
  }
}

/* Transitions fluides */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Amélioration de l'accessibilité */
.user-select-all {
  user-select: all;
}

/* Styles pour les liens de focus */
a:focus, button:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Styles pour le défilement fluide */
html {
  scroll-behavior: smooth;
}

html, body {
  overflow-x: hidden !important;
}
footer, footer .container {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

/* Masquer le scrollbar mais garder la fonctionnalité */
body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}

body::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* Sticky footer layout moderne */
.container-fluid.min-vh-100 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

main.flex-grow-1 {
  flex: 1;
}

/* === FOOTER / FOOTBAR MODERNE & RESPONSIVE === */
footer {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 16px 0 rgba(99, 102, 241, 0.08);
  position: relative;
  z-index: 10;
}
footer .container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
}
footer p {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
  letter-spacing: 0.03em;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Correction footer : full width et hauteur réduite */
footer {
  left: 0;
  right: 0;
  width: 100vw;
  min-height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 0;
}
footer .container {
  min-height: 40px;
  padding: 0;
  width: 100vw;
  max-width: 100vw;
}
@media (max-width: 768px) {
  footer .container {
    min-height: 36px;
    padding: 0;
  }
}
@media (max-width: 576px) {
  footer .container {
    min-height: 32px;
    padding: 0;
  }
}

[data-theme="dark"] footer {
  background: rgba(30, 41, 59, 0.85);
  border-top: 1px solid var(--border-dark);
  box-shadow: 0 -2px 16px 0 rgba(30, 41, 59, 0.18);
}
[data-theme="dark"] footer p {
  color: var(--text-dark);
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

/* Vidéos du HUB */
.video-hub {
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  background: #000;
  width: 100%;
  max-width: 350px;      /* Largeur max sur desktop */
  aspect-ratio: 9/16;    /* Ratio vertical */
  height: auto;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-color);
  transition: box-shadow 0.3s;
}
.video-hub:focus, .video-hub:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
  outline: none;
}
@media (max-width: 768px) {
  .video-hub {
    max-width: 220px;
  }
}
@media (max-width: 576px) {
  .video-hub {
    max-width: 100%;
    aspect-ratio: 9/16;
  }
}

/* Vidéo horizontale spéciale */
.video-hub-horizontal {
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  background: #000;
  width: 100%;
  max-width: 700px;
  aspect-ratio: 16/9;
  height: auto;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-color);
  transition: box-shadow 0.3s;
}
.video-hub-horizontal:focus, .video-hub-horizontal:hover {
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25);
  outline: none;
}
@media (max-width: 768px) {
  .video-hub-horizontal {
    max-width: 100%;
    aspect-ratio: 16/9;
  }
}

/* Galerie photo carrée */
.gallery-grid {
  max-width: 600px;
  margin: 0 auto;
}
.gallery-thumb {
  aspect-ratio: 1/1;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid var(--primary-color);
  transition: box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 8px rgba(99,102,241,0.08);
}
.gallery-thumb:hover, .gallery-thumb:focus {
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.18);
  outline: none;
}
@media (max-width: 576px) {
  .gallery-thumb {
    width: 60px;
    height: 60px;
  }
  .gallery-grid {
    max-width: 100vw;
  }
}
