/* public/css/layout.css */

/**
 * KB Medizin Technik - Layout
 * Theme: Medical Clean
 */

.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  background-color: var(--neutral-50); /* Fond global gris très léger */
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  z-index: 500;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.03); /* Ombre très légère */
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex; align-items: center; padding-left: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 1.25rem; font-weight: 800; color: var(--color-primary);
  margin: 0; letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1; padding: 2rem 1rem; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.25rem;
  color: var(--neutral-600);
  font-size: 0.9rem; font-weight: 500;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-nav a i { width: 24px; text-align: center; font-size: 1.1rem; transition: color 0.2s; }

.sidebar-nav a:hover {
  background-color: var(--neutral-50);
  color: var(--color-primary);
}

/* État Actif : Bleu médical */
.sidebar-nav a.active {
  background-color: var(--color-primary); 
  color: white;
  box-shadow: 0 4px 12px rgba(2, 119, 189, 0.25); /* Ombre bleue */
  font-weight: 600;
}
.sidebar-nav a.active i { color: white; }

.sidebar-footer {
  padding: 1.5rem; border-top: 1px solid var(--border-color);
  background: var(--neutral-50);
}

/* User Info */
.user-info {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  padding: 0.5rem; border-radius: var(--radius-md);
  min-height: 50px;
}

.user-avatar {
  width: 40px; height: 40px;
  background: white; 
  border: 2px solid var(--color-primary-light); 
  color: var(--color-primary);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}

.user-details { overflow: hidden; }
.user-details strong { display: block; font-size: 0.9rem; color: var(--neutral-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-details span { display: block; font-size: 0.75rem; color: var(--neutral-500); }

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1; margin-left: var(--sidebar-width);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header {
  position: sticky; top: 0; z-index: 400;
  height: var(--topbar-height); padding: 0 3rem;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}

.page-header h1 {
  font-size: 1.5rem; margin: 0; display: flex; align-items: center; gap: 1rem; color: var(--neutral-900);
}
.page-header h1 i { color: var(--color-primary); opacity: 0.8; }

/* Footer */
.app-footer {
  margin-top: auto; padding: 4rem 3rem; background: white; border-top: 1px solid var(--border-color);
}
.footer-content {
  max-width: var(--container-max-width); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3rem;
}
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-logo {
  width: 48px; height: 48px; 
  background: var(--gradient-primary); 
  color: white;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.footer-info h3 { margin: 0; font-size: 1rem; color: var(--neutral-900); font-weight: 700; }
.footer-info p { margin: 0; font-size: 0.85rem; color: var(--neutral-500); }

.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--neutral-600); font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--color-primary); }

.footer-bottom {
  border-top: 1px solid var(--neutral-100); margin-top: 3rem; padding-top: 1.5rem;
  text-align: center; color: var(--neutral-400); font-size: 0.8rem;
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .page-header { padding: 0 1.5rem; }
}