/* ===== Général ===== */
body, html {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f8f9fa;
}

/* ===== Sidebar ===== */
.sidebar {
  background-color: #343a40;
  min-height: 100vh;
  padding-top: 1rem;
  width: 240px;
  transition: transform 0.3s ease-in-out;
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
}

.sidebar nav ul li {
  margin: 0;
}

.sidebar nav ul li a {
  display: block;
  padding: 12px 20px;
  color: #f8f9fa;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: background 0.3s, border-left 0.3s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  background-color: #495057;
  border-left: 4px solid #0d6efd;
  font-weight: bold;
}

/* Responsive : cache la sidebar */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    height: calc(100vh - 70px);
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .admin-container {
    margin-left: 0 !important;
  }
}

/* ===== Header ===== */
.admin-header {
  background: linear-gradient(135deg, #007bff, #6610f2);
  color: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-bottom: none;
  transition: background 0.3s ease-in-out;
}

.admin-header h1 {
  font-size: 1.3rem;
  font-weight: bold;
}

.admin-header .btn {
  transition: all 0.2s ease;
}

.admin-header .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-header img {
  border: 2px solid white;
  padding: 2px;
}


/* ===== Main content ===== */
.admin-container {
  display: flex;
}

.content {
  flex-grow: 1;
  padding: 2rem;
  transition: margin-left 0.3s ease-in-out;
  background-color: #ffffff;
}

/* Animation au chargement */
.content, .sidebar, .admin-header {
  animation: fadeInUp 0.5s ease-in-out;
}

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

/* ===== Boutons ===== */
button {
  transition: transform 0.2s ease-in-out;
}
button:hover {
  transform: scale(1.05);
}


@media (max-width: 768px) {
  .admin-header h1 {
    font-size: 1rem;
  }

  .admin-header img {
    height: 32px;
  }
}

/* Sidebar */
/* === CONTENEUR SIDEBAR === */
.sidebar {
  background: linear-gradient(to bottom, #1c1f24, #2c2f36);
  min-height: 100vh;
  padding-top: 10px;
  width: 250px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  transition: width 0.3s ease;
  position: relative;
}

/* === TITRE DE SECTION === */
.sidebar h6 {
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 1rem;
  color: #bbb;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

/* === LIENS DE NAVIGATION === */
.sidebar .nav-link {
  color: #e9ecef;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.25s, transform 0.1s;
}

.sidebar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

/* === ICÔNE === */
.sidebar .nav-link i {
  font-size: 1.1rem;
  color: #b0c4de;
  transition: color 0.3s ease;
}

.sidebar .nav-link:hover i {
  color: #ffffff;
}

/* === LIEN ACTIF (ajoute la classe "active" dynamiquement dans JS ou serveur) === */
.sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.12);
  font-weight: bold;
  border-left: 4px solid #0d6efd;
  color: #fff;
}

.sidebar .nav-link.active i {
  color: #0d6efd;
}

/* === PETITE SCROLLBAR DOUCE SI DÉPASSEMENT === */
.sidebar nav {
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #555 #2c2f36;
}
.sidebar nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 3px;
}
.sidebar nav::-webkit-scrollbar-track {
  background-color: #2c2f36;
}

/* Responsive */
@media (min-width: 768px) {
  .sidebar {
    left: 0;
    position: static;
    height: auto;
  }

  .sidebar-overlay {
    display: none !important;
  }
}


.content {
  flex: 1;
  padding: 2rem;
  background-color: #fff;
}

.footer {
  background-color: #343a40;
  color: white;
  text-align: center;
  padding: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    transform: translateX(-100%);
    top: 60px;
    left: 0;
    width: 200px;
    height: calc(100% - 60px);
    z-index: 10;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}
