:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --light-text: #6b7280;
  --background: #ffffff;
  --section-bg: #fafafa;
  --gradient-start: #3b82f6;
  --gradient-end: #1d4ed8;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text-color);
  line-height: 1.5;
  background: var(--background);
}

/* Container de la barre de navigation */
.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 3rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: fadeIn 0.5s ease-out;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}
/* Style for the image logo */
.logo img {
  max-width: 100%; /* Ensure the image doesn't overflow */
  max-height: 60px; /* Set a maximum height for the logo */
  width: auto; /* Maintain aspect ratio */
  height: auto; /* Maintain aspect ratio */
  object-fit: contain; /* Ensure the image fits within the container */
}

/* Optional: Add a hover effect for the image logo */
.logo img:hover {
  opacity: 0.8; /* Slightly fade the image on hover */
  transition: opacity 0.3s ease; /* Smooth transition */
}

/* Liens de navigation */
.nav-links a {
  margin-left: 2rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* Style actif pour le lien courant */
.nav-links a.active {
  position: relative;
  color: var(--primary-color);
  font-weight: bold;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* Style commun à tous les boutons */
.nav-links .btn-base {
  margin-left: 6rem;
  padding: 0.5rem 1rem;
  color: #fff;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-links .btn-base::after {
  content: none;
}
/* Bouton Se connecter (bleu) */
.nav-links .btn {
  background-color: var(--secondary-color);
}

.nav-links .btn:hover {
  background-color: #1e3a8a; /* par exemple un bleu un peu plus foncé */
  color: #fff;
}

/* Bouton Déconnexion (rouge) */
.nav-links .btn_deco {
  background-color: #e11d48;
}

.nav-links .btn_deco:hover {
  background-color: #be123c;
  color: #fff;
}
/* Supprime l'animation d'underline pour les boutons */
.nav-links .btn-base::after {
  content: none;
}

/* Hamburger menu (mobile) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.menu-toggle .bar {
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    display: none; /* caché par défaut */
    animation: fadeIn 0.3s ease-in-out;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a,
  .nav-links .btn-base {
    margin: 0;
  }

  .nav-links .btn-base {
    margin-top: 1rem;
  }
  navbar .container {
    flex-wrap: wrap;
  }
}

/* === Sidebar Toggle Button === */
.sidebar-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 200; /* Higher than sidebar but lower than navbar */
  background-color: #1e1e2d;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 20px;
  border-radius: 5px;
  cursor: pointer;
  display: none;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background-color: #2a2a3a;
}

/* === Sidebar === */
.sidebar {
  width: 250px;
  height: 100vh;
  background: rgba(30, 30, 45, 0.95);
  padding-top: 80px;
  position: fixed;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
  z-index: 100; /* Reduced z-index to not hide navbar */
  /* Force scroll on all devices */
  overflow-y: scroll;
  overflow-x: hidden;
  /* Force scrollbar to always be visible */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Style de la scrollbar pour webkit browsers (Chrome, Safari, Edge) */
.sidebar::-webkit-scrollbar {
  width: 12px; /* Increased width for better visibility */
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  border: 2px solid rgba(30, 30, 45, 0.95);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.6);
}

.sidebar::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.8);
}

.sidebar a {
  display: flex;
  align-items: center;
  color: #b3b3b3;
  text-decoration: none;
  padding: 15px 20px;
  margin: 8px 15px;
  border-radius: 8px;
  transition: all 0.3s ease-in-out;
  font-size: 16px;
  word-wrap: break-word;
  cursor: pointer;
}

.sidebar a:hover {
  background: #2a2a3a;
  color: #fff;
  transform: translateX(5px);
}

/* Active link */
.sidebar a.active {
  background: #4a4a6a;
  color: white;
  box-shadow: 0 2px 8px rgba(74, 74, 106, 0.3);
}

/* Style spécial pour le bouton mail */
.sidebar .btn-base {
  background: linear-gradient(145deg, #1e90ff, #007bff);
  color: white;
  text-align: center;
  font-weight: bold;
}

.sidebar .btn-base:hover {
  background: linear-gradient(145deg, #007bff, #1e90ff);
  transform: translateX(5px) translateY(-2px);
}

/* Message copié */
.copied-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #4caf50;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  display: none;
  z-index: 2000; /* High z-index for notifications */
  font-weight: bold;
}

/* === Main Content === */
.main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  min-height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("https://images.unsplash.com/photo-1632406897798-e5472b4a989e?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D")
      no-repeat center center/cover;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: all 0.3s ease;
}

.welcome-container {
  background: rgba(0, 0, 0, 0.7);
  padding: 30px;
  border-radius: 15px;
  backdrop-filter: blur(15px);
  text-align: center;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Titre principal */
.welcome-container h1 {
  font-size: clamp(28px, 5vw, 50px);
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Style du bouton */
.welcome-container .btn {
  display: inline-block;
  padding: 12px 25px;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(145deg, #1e90ff, #007bff);
  border: none;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  transition: all 0.3s ease;
  margin: 10px;
}

.welcome-container .btn:hover {
  background: linear-gradient(145deg, #007bff, #1e90ff);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* === Responsive Design === */

/* Tablettes */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
    width: calc(100% - 220px);
  }

  .sidebar a {
    font-size: 15px;
    padding: 12px 18px;
  }
}

/* Tablettes petites et mobiles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 150; /* Higher on mobile when needed */
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 15px;
  }

  .welcome-container {
    padding: 20px;
    margin-top: 60px;
  }

  .sidebar a {
    font-size: 16px;
    padding: 15px 20px;
  }
}

/* Mobiles très petits */
@media (max-width: 480px) {
  .sidebar {
    width: 100vw;
  }

  .welcome-container {
    padding: 15px;
    border-radius: 10px;
  }

  .welcome-container .btn {
    padding: 10px 20px;
    font-size: 16px;
    display: block;
    margin: 10px auto;
    width: fit-content;
  }

  .sidebar a {
    font-size: 15px;
    padding: 12px 15px;
    margin: 5px 10px;
  }
}

/* Très grands écrans */
@media (min-width: 1400px) {
  .sidebar {
    width: 300px;
  }

  .main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
  }

  .sidebar a {
    font-size: 18px;
    padding: 18px 25px;
  }
}

/* Overlay pour mobile quand sidebar est ouverte */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99; /* Just below sidebar */
}

@media (max-width: 768px) {
  .sidebar-overlay.active {
    display: block;
  }
}

/* Animation d'ouverture */
.sidebar.opening {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}
