/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', sans-serif;
  background-color: #f1f1f1;
  color: #111;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* Barre du haut */
.menu {
  background-image: url('/assets/img/Image_fond.png');
  position: fixed; top: 0; left: 0; right: 0;
  background-size: cover;
  background-position: center;
  height: auto;
  min-height: 80px;
  display: flex; 
  flex-wrap: wrap;
  align-items: center; 
  justify-content: space-between;
  padding: 12px 25px;
  z-index: 1100;
  gap: 12px;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.logo-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.logo-img {
  height: 60px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  opacity: 1;
  filter: none;
  transition: transform 0.3s ease;
  object-fit: contain;
}

.logo-img:hover {
  transform: scale(1.08);
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
}

.logo-title {
  font-size: 18px;
  font-weight: 700;
  color: #0d2d5f;
  letter-spacing: 0.5px;
  line-height: 1;
}

.logo-subtitle {
  font-size: 12px;
  font-weight: 600;
  color: #f4d03f;
  letter-spacing: 1px;
  line-height: 1;
}

.menu .logo a {
  font-size: 1.2em; font-weight: 600;
  color: #050631; text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-toggle {
  appearance: none; border: none; background: none; color: #111;
  font-size: 24px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
}

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 80vw; max-width: 320px; height: 100%;
  background-color: #111; color: #fff;
  padding: 16px;
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  z-index: 1200;
}
.sidebar.is-open { transform: translateX(0); }

/* Header de la sidebar */
.sidebar-header { display: flex; justify-content: flex-end; }
.close-btn {
  appearance: none; border: none; background: none; color: #fff;
  font-size: 28px; cursor: pointer;
  width: 44px; height: 44px; display: grid; place-items: center;
}
.close-btn:hover { color: #00bcd4; }

/* Sections */
.sidebar h3 {
  font-size: 1.05em; color: #ddd;
  margin: 16px 0 8px; border-bottom: 1px solid #333; padding-bottom: 6px;
}
.sidebar ul { list-style: none; margin: 0 0 16px; padding: 0; }
.sidebar li { display: flex; align-items: center; }
.sidebar a {
  color: #fff; text-decoration: none; font-size: 0.98em;
  padding: 10px 12px; border-radius: 6px; width: 100%;
  transition: background 0.2s, color 0.2s;
}
.sidebar a:hover { background-color: #00bcd4; color: #111; }

/* Top controls */
.top-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}

.languages {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.lang-btn {
  appearance: none;
  border: none;
  background: none;
  color: #fff;
  padding: 2px 4px;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.lang-btn .flag-icon {
  width: 20px;
  height: 15px;
  display: inline-block;
  flex-shrink: 0;
}

.lang-btn span {
  display: inline !important;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.lang-btn:hover {
  background: none;
  color: #00bcd4;
  border-color: transparent;
}

.lang-btn.active {
  background: none;
  color: #00bcd4;
  border-color: transparent;
}

.languages button {
  appearance: none; border: none; background: #333; color: #fff;
  padding: 6px 10px; border-radius: 4px; cursor: pointer;
}
.languages button:hover { background: #00bcd4; color: #111; }
.dark-mode-toggle { font-size: 0.9em; color: #ccc; }

/* Overlay */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 1150;
}
.overlay.active { opacity: 1; visibility: visible; }

/* Contenu principal */
.content { 
  padding: 16px; 
  margin-top: 100px;
}

@media (max-width: 768px) {
  .content {
    margin-top: 120px;
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .content {
    margin-top: 130px;
    padding: 10px;
  }
}

/* Profil utilisateur dans le menu */
.user-profile-section {
  padding: 16px;
  margin: 16px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  color: #fff;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.user-profile-icon {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.user-profile-icon-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-profile-info {
  flex: 1;
}

.user-profile-label {
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.user-profile-name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.user-profile-type {
  font-size: 12px;
  opacity: 0.9;
}

.user-profile-link {
  display: block;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  transition: all 0.3s ease;
}

.user-profile-link:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mode sombre */
body.dark { background-color: #181818; color: #eee; }
body.dark .menu { background-color: #000; }
body.dark .sidebar { background-color: #00bcd4; }
body.dark .sidebar a:hover { background-color: #00bcd4; color: #000; }

/* Mobile tweaks - Tablet (768px) */
@media (max-width: 768px) {
  .menu {
    padding: 10px 12px;
    height: auto;
    min-height: 70px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .logo-img {
    height: 50px;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    object-fit: contain;
  }
  
  .logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px;
  }
  
  .logo-title {
    font-size: 16px;
    font-weight: 700;
  }
  
  .logo-subtitle {
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  
  .menu .logo-container {
    flex: 1;
    min-width: 0;
    order: 2;
  }
  
  .menu-toggle {
    font-size: 22px;
    padding: 8px 12px;
    order: 1;
  }
  
  .navbar-auth-buttons {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
    margin-left: 0;
  }
  
  .auth-btn {
    padding: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
  }
  
  .sidebar {
    width: 80vw;
    max-width: 320px;
  }
  
  .top-controls {
    flex-direction: row;
    gap: 6px;
    margin-bottom: 16px;
  }
  
  .languages {
    display: flex;
    gap: 4px;
    width: 100%;
  }
  
  .languages a {
    flex: 1;
    padding: 8px 6px;
    font-size: 12px;
    text-align: center;
  }
  
  .lang-btn .flag-icon {
    width: 13px;
    height: 9px;
  }
  
  .lang-btn span {
    display: inline !important;
    color: #fff;
  }
  
  .user-profile-section {
    padding: 12px;
    margin: 12px 0;
  }
  
  .user-profile-badge {
    gap: 10px;
  }
  
  .user-profile-icon {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
  
  .user-profile-name {
    font-size: 13px;
  }
  
  .user-profile-type {
    font-size: 11px;
  }
  
  .user-profile-link {
    padding: 8px 10px;
    font-size: 11px;
  }
}

/* Mobile - Petit écran (480px et moins) */
@media (max-width: 480px) {
  .menu {
    padding: 8px 10px;
    height: auto;
    min-height: 68px;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .menu-toggle {
    padding: 8px 10px;
    font-size: 20px;
    margin-right: 8px;
    order: 1;
  }
  
  .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    order: 2;
  }
  
  .logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 6px;
    border-radius: 0;
    background: none;
  }
  
  .logo-link:hover {
    background-color: transparent;
    transform: none;
  }
  
  .logo-img { 
    height: 48px;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    object-fit: contain;
    flex-shrink: 0;
  }
  
  .logo-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
    justify-content: center;
    padding: 0;
  }
  
  .logo-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
  }
  
  .logo-subtitle {
    font-size: 10px;
    letter-spacing: 0px;
    line-height: 1;
    white-space: nowrap;
  }
  
  .navbar-auth-buttons {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    margin-left: 0;
    margin-top: 4px;
    margin-right: 0;
    padding-right: 10px;
  }
  
  .auth-btn {
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .sidebar { 
    width: 90vw;
    max-width: 280px;
    padding: 12px;
  }
  
  .sidebar-header {
    margin-bottom: 8px;
  }
  
  .close-btn {
    width: 40px;
    height: 40px;
  }
  
  .top-controls {
    margin-bottom: 12px;
    gap: 4px;
  }
  
  .languages a {
    padding: 6px 4px;
    font-size: 10px;
  }
  
  .lang-btn .flag-icon {
    width: 12px;
    height: 8px;
  }

  .lang-btn span {
    display: inline !important;
    color: #fff;
  }
  
  .sidebar h3 {
    font-size: 0.95em;
    margin: 12px 0 6px;
  }
  
  .sidebar a {
    font-size: 0.9em;
    padding: 8px 10px;
  }
  
  .user-profile-section {
    padding: 10px;
    margin: 10px 0;
  }
  
  .user-profile-badge {
    gap: 8px;
  }
  
  .user-profile-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .user-profile-name {
    font-size: 12px;
    max-width: 150px;
  }
  
  .user-profile-type {
    font-size: 10px;
  }
  
  .user-profile-link {
    padding: 6px 8px;
    font-size: 10px;
  }
}

/* Auth Buttons in Navbar */
.navbar-auth-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

.auth-btn {
  padding: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-decoration: none;
  font-size: 20px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.auth-btn--login {
  background-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.auth-btn--login:hover {
  background-color: #2563eb;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.auth-btn--register {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.auth-btn--register:hover {
  background-color: #10b981;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Hide auth buttons on mobile by default */
@media (max-width: 768px) {
  .navbar-auth-buttons {
    display: flex;
  }
}

@media (max-width: 480px) {
  .auth-btn {
    font-size: 12px;
    padding: 8px 15px;
  }
}

@media (max-width: 360px) {
  .menu {
    padding: 6px 8px;
    min-height: 64px;
  }
  
  .logo-img {
    height: 42px;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
  }
  
  .logo-title {
    font-size: 12px;
  }
  
  .logo-subtitle {
    font-size: 8px;
  }
  
  .menu-toggle {
    padding: 4px 8px;
    font-size: 18px;
  }

  .navbar-auth-buttons {
    gap: 6px;
  }

  .auth-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .sidebar {
    width: 95vw;
    max-width: 240px;
  }
}

/* Ajustement pour très petits écrans en hauteur */
@media (max-height: 600px) and (max-width: 480px) {
  .menu {
    min-height: 64px;
  }
  
  .logo-img {
    height: 42px;
    width: 42px;
  }
  
  .auth-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
}
