/* Adminator CSS - Main Stylesheet */
:root {
  --primary: #5d78ff;
  --secondary: #6c757d;
  --success: #28a745;
  --info: #17a2b8;
  --warning: #ffc107;
  --danger: #dc3545;
  --light: #f8f9fa;
  --dark: #343a40;
  --sidebar-width: 250px;
  --header-height: 60px;
  --sidebar-bg: #2d353c;
  --sidebar-text: #fff;
  --body-bg: #f5f6fa;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --body-bg: #1e2229;
  --light: #2d353c;
  --dark: #f8f9fa;
  --sidebar-bg: #1a1f26;
}

/* General Layout */
body {
  background-color: var(--body-bg);
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 1030;
  transition: all 0.3s ease;
  box-shadow: 0 0 35px 0 rgba(154, 161, 171, 0.15);
  overflow-y: auto;
}

.sidebar-header {
  padding: 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.sidebar-brand:hover {
  color: #fff;
  text-decoration: none;
}

.sidebar-nav {
  padding: 1rem 0;
}

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

.sidebar-nav-item {
  margin-bottom: 2px;
}

/* Styles pour les liens de la sidebar */
.sidebar .sidebar-nav .sidebar-nav-list .sidebar-nav-item .sidebar-link,
.sidebar .sidebar-link {
  display: flex;
  align-items: center;
  /*padding: 0.75rem 1rem;*/
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
  transition: all 0.2s ease;
  position: relative;
  border-radius: 0.2rem;
  margin: 0 0.5rem;
  width: calc(100% - 1rem);
}

.sidebar .sidebar-nav .sidebar-nav-list .sidebar-nav-item .sidebar-link:hover,
.sidebar .sidebar-link:hover {
  color: #fff !important;
  background-color: rgba(59, 125, 221, 0.2);
}

.sidebar .sidebar-nav .sidebar-nav-list .sidebar-nav-item .sidebar-link.active,
.sidebar .sidebar-link.active {
  color: #fff !important;
  background-color: #3b7ddd;
  border-left: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

.sidebar .sidebar-nav .sidebar-nav-list .sidebar-nav-item .sidebar-link.active .sidebar-icon,
.sidebar .sidebar-link.active .sidebar-icon {
  color: #fff !important;
}

.sidebar-icon {
  width: 1.25rem;
  margin-right: 0.75rem;
  text-align: center;
  color: #3b7ddd;
  font-size: 1rem;
}

.sidebar-dropdown-icon {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.sidebar-link:not(.collapsed) {
  background-color: rgba(59, 125, 221, 0.15);
}

.sidebar-link:not(.collapsed) .sidebar-dropdown-icon {
  transform: rotate(180deg);
}

.sidebar-dropdown {
  padding-left: 0;
  background-color: rgba(0, 0, 0, 0.15);
  margin-top: 0;
  border-radius: 0.2rem;
  margin: 0 0.5rem 0.5rem 1.5rem;
}

.sidebar .sidebar-dropdown .sidebar-link,
.sidebar-dropdown .sidebar-item .sidebar-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin: 0.1rem 0.3rem;
  width: calc(100% - 0.6rem);
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none !important;
}

.sidebar .sidebar-dropdown .sidebar-link:hover,
.sidebar-dropdown .sidebar-item .sidebar-link:hover {
  color: #fff !important;
  background-color: rgba(59, 125, 221, 0.2);
}

.sidebar .sidebar-dropdown .sidebar-link.active,
.sidebar-dropdown .sidebar-item .sidebar-link.active {
  color: #fff !important;
  background-color: #3b7ddd;
}

.sidebar-item {
  position: relative;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: transparent;
  transition: background-color 0.2s ease;
}

.sidebar-item:hover::before {
  background-color: rgba(59, 125, 221, 0.5);
}

.sidebar-item.active::before {
  background-color: #3b7ddd;
}

.sidebar-dropdown .sidebar-icon {
  font-size: 0.85rem;
  width: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Force le style des liens uniquement dans la sidebar */
.sidebar{
  --bs-link-color: rgba(255,255,255,.8);
  --bs-link-hover-color: #fff;
  --bs-link-decoration: none;
  --bs-link-hover-decoration: none;
}

/* (optionnel) si certains navigateurs gardent le soulignement */
.sidebar a { text-decoration: none; }
.sidebar a:hover { text-decoration: none; }


/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  min-height: 100vh;
  transition: all 0.3s;
}

/* Header */
.header {
  height: var(--header-height);
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

/* Cards */
.card {
  margin-bottom: 20px;
  box-shadow: 0 0 35px 0 rgba(154, 161, 171, 0.15);
  border: none;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 15px 20px;
}

.card-title {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 500;
}

.card-body {
  padding: 20px;
}

/* Widgets */
.widget {
  background-color: #fff;
  border-radius: 4px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 0 35px 0 rgba(154, 161, 171, 0.15);
}

.widget-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 15px;
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-success { color: var(--success) !important; }
.text-info { color: var(--info) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-light { color: var(--light) !important; }
.text-dark { color: var(--dark) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-light { background-color: var(--light) !important; }
.bg-dark { background-color: var(--dark) !important; }

/* Styles responsive */
@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 15px;
  }
  
  .sidebar {
    left: -260px;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .main-content.active {
    margin-left: var(--sidebar-width);
  }
  
  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1040;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s;
  }
}

/* Toggle Button */
.sidebar-toggle {
  background-color: var(--primary);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1040;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background-color: transparent;
  border: none;
  color: #333;
  cursor: pointer;
  padding: 5px;
}

[data-theme="dark"] .dark-mode-toggle {
  color: #fff;
}

/* Footer */
.footer {
  padding: 15px 0;
  text-align: center;
  background-color: #fff;
  border-top: 1px solid #e9ecef;
}

[data-theme="dark"] .footer {
  background-color: var(--light);
}
