/* ============================================
   Mobile Menu Toggle & Overlay
   Bouton hamburger et fond semi-transparent
   ============================================ */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1002;
  width: 48px;
  height: 48px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.mobile-menu-toggle:hover {
  background: var(--card-hover);
  transform: scale(1.05);
  color: var(--primary-color);
}

.mobile-menu-toggle svg {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-toggle .icon-close {
  display: none;
}

.mobile-menu-toggle .icon-menu {
  display: block;
}

/* Toujours afficher l’icône localisation (fermeture par l’overlay uniquement) */
.mobile-menu-toggle.active .icon-close {
  display: none;
}

.mobile-menu-toggle.active .icon-menu {
  display: block;
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */
@media screen and (max-width: 1024px) {
  .sidebar {
    width: 300px;
    padding: 24px 20px;
  }

  .app-container {
    flex-direction: row; /* Garde le sidebar à gauche */
  }

  .main-content {
    flex: 1;
    width: auto;
    height: 100vh;
  }

  .modal-content {
    max-width: 90%;
    padding: 28px;
  }

  .notification-content {
    max-width: 85%;
    padding: 36px 28px;
  }
}

/* ============================================
   Responsive Design - Mobile
   ============================================ */
@media screen and (max-width: 768px) {
  body {
    overflow: auto;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Menu ouvert : masquer le bouton (fermeture par l’overlay uniquement) */
  .mobile-menu-toggle.active {
    display: none !important;
  }

  .mobile-overlay {
    display: block;
  }

  .app-container {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    padding: 24px 20px;
    padding-bottom: 24px;
    z-index: 1001;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--border-color);
    border-bottom: none;
    min-height: 0;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar::before {
    display: block;
  }

  .logo-container {
    margin-bottom: 24px;
    margin-right: 0;
    padding-bottom: 20px;
    padding-right: 0;
    border-bottom: 1px solid var(--border-color);
    border-right: none;
    min-width: auto;
  }

  .logo-container::after {
    display: block;
  }

  .logo-image {
    max-height: none;
    width: 100%;
  }

  .locations-section {
    margin-bottom: 24px;
    margin-right: 0;
    min-width: auto;
    flex-shrink: 0;
  }

  .locations-section h3 {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .locations-list {
    flex-direction: column;
    gap: 8px;
    overflow-x: visible;
    padding-bottom: 0;
  }

  .locations-list li {
    min-width: auto;
  }

  .location-item-frame {
    padding: 4px 4px 4px 0;
    min-height: 44px;
  }

  .location-btn-name {
    padding: 8px 12px;
    font-size: 14px;
  }

  .location-icon-btn {
    width: 32px;
    height: 32px;
  }

  .controls-section {
    margin-bottom: 24px;
    flex-direction: column;
    gap: 10px;
    min-width: auto;
    flex-shrink: 0;
  }

  .btn {
    padding: 12px 20px;
    font-size: 12px;
    white-space: normal;
    width: 100%;
  }

  .navigation-info {
    display: block !important;
    margin-top: 24px !important;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .main-content {
    width: 100%;
    height: 100vh;
    margin-top: 0;
  }

  .modal-content {
    max-width: 95%;
    padding: 24px 20px;
    margin: 20px;
    border-radius: 16px;
  }

  .modal-content h2 {
    font-size: 20px;
    padding-right: 32px;
  }

  .modal-content p {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .modal-close {
    right: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    font-size: 28px;
  }

  .modal-location-btn {
    padding: 14px 18px;
    font-size: 14px;
  }

  .notification-content {
    max-width: 90%;
    padding: 32px 24px;
    border-radius: 16px;
  }

  .notification-content h3 {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .notification-content p {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .notification-content .btn {
    width: 100%;
    padding: 12px 20px;
  }
}

/* ============================================
   Responsive Design - Small Mobile
   ============================================ */
@media screen and (max-width: 480px) {
  .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    top: 16px;
    left: 16px;
  }

  .sidebar {
    width: 90%;
    max-width: 300px;
    padding: 20px 16px;
    padding-bottom: 20px;
    height: 100vh;
    min-height: 0;
  }

  .logo-container {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .locations-section {
    margin-bottom: 20px;
    flex-shrink: 1;
  }

  .locations-section h3 {
    font-size: 14px;
  }

  .location-item-frame {
    min-height: 40px;
  }

  .location-btn-name {
    padding: 6px 10px;
    font-size: 13px;
  }

  .location-icon-btn {
    width: 30px;
    height: 30px;
  }

  .location-icon-btn .fi {
    font-size: 14px;
  }

  .controls-section {
    margin-bottom: 20px;
    gap: 8px;
    flex-shrink: 0;
  }

  .navigation-info {
    margin-top: 20px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 11px;
  }

  .navigation-info {
    padding: 16px;
  }

  .navigation-info h4 {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .navigation-info > div {
    font-size: 13px;
    margin-bottom: 10px;
  }

  .modal-content {
    padding: 20px 16px;
    margin: 16px;
    border-radius: 12px;
  }

  .modal-content h2 {
    font-size: 18px;
    padding-right: 28px;
  }

  .modal-close {
    right: 12px;
    top: 12px;
    width: 28px;
    height: 28px;
    font-size: 24px;
  }

  .notification-content {
    padding: 28px 20px;
    border-radius: 12px;
  }

  .notification-content h3 {
    font-size: 22px;
  }
}

/* ============================================
   Landscape Mobile Orientation
   ============================================ */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    width: 70%;
    max-width: 280px;
  }

  .main-content {
    height: 100vh;
  }
}
