/* Sidebar styles - inclus par toutes les pages */

/* Layout global avec sidebar */
html {
  background-color: var(--bg-white);
}

/* Cacher la page jusqu'au chargement de la sidebar pour éviter le flash */
body.with-sidebar {
  visibility: hidden;
}

body.with-sidebar.sidebar-ready {
  visibility: visible;
}

body.with-sidebar {
  display: flex;
  flex-direction: row;
  max-width: none;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-white);
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-white);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  padding: 24px 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
  z-index: 100;
}

.sidebar-header {
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.sidebar-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-coral));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-version {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Navigation */
.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 24px;
  margin: 0;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  display: block;
  padding: 8px 24px 8px 32px;
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.nav-links a:hover {
  background: var(--bg-light);
  color: var(--primary-orange);
  text-decoration: none;
}

.nav-links a.active {
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-orange);
  border-left-color: var(--primary-orange);
}

/* Resources section */
.nav-resources {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.nav-resources .nav-section-title {
  color: #8b5cf6;
}

.nav-resources .nav-links a:hover {
  color: #8b5cf6;
}

.external-link {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-left: 4px;
}

/* Main content avec sidebar */
body.with-sidebar > main,
body.with-sidebar > .main-content,
body.with-sidebar > .page-content {
  margin-left: 280px;
  min-height: 100vh;
  padding: 60px 80px 60px 120px;
  max-width: 1100px;
  background: var(--bg-white);
}

/* Mobile */
@media (max-width: 900px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }

  body.with-sidebar {
    flex-direction: column;
  }

  body.with-sidebar > main,
  body.with-sidebar > .main-content,
  body.with-sidebar > .page-content {
    margin-left: 0;
    padding: 40px 24px;
    max-width: none;
  }
}

/* Print - cacher la sidebar et remettre le contenu en pleine largeur */
@media print {
  .sidebar,
  #sidebar-container {
    display: none !important;
  }

  body.with-sidebar {
    display: block;
  }

  body.with-sidebar > main,
  body.with-sidebar > .main-content,
  body.with-sidebar > .page-content {
    margin-left: 0;
    padding: 0;
    max-width: none;
  }
}
