/* Floating Top Menu Styles */
.floating-menu-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: block; /* Show by default now */
  width: auto;
  max-width: 90%;
}

.floating-menu {
  background-color: hsla(var(--card) / 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 9999px; /* Pill shape */
  padding: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid hsla(var(--border) / 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.floating-menu:hover {
  background-color: hsla(var(--card) / 0.9);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.floating-menu-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.floating-menu-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: all 0.2s ease;
  white-space: nowrap;
}

.floating-menu-item:hover {
  background-color: hsla(var(--muted) / 0.7);
}

.floating-menu-item.active {
  background-color: hsla(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.floating-menu-item i {
  margin-right: 0.5rem;
  height: 1rem;
  width: 1rem;
}

.floating-menu-dropdown {
  position: relative;
}

.floating-menu-dropdown-trigger {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: all 0.2s ease;
  cursor: pointer;
}

.floating-menu-dropdown-trigger:hover {
  background-color: hsla(var(--muted) / 0.7);
}

.floating-menu-dropdown-trigger i:last-child {
  margin-left: 0.25rem;
  height: 0.875rem;
  width: 0.875rem;
}

.floating-menu-dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: hsl(var(--card));
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border: 1px solid hsl(var(--border));
  padding: 0.5rem;
  min-width: 12rem;
  display: none;
  z-index: 1001;
}

.floating-menu-dropdown-content.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.floating-menu-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  transition: all 0.2s ease;
}

.floating-menu-dropdown-item:hover {
  background-color: hsl(var(--muted));
}

.floating-menu-dropdown-item.active {
  background-color: hsla(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.floating-menu-dropdown-item i {
  margin-right: 0.5rem;
  height: 1rem;
  width: 1rem;
}

/* Layout toggle button - now hidden by default */
.layout-toggle {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 9999px;
  width: 3rem;
  height: 3rem;
  display: none; /* Hidden by default now */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: all 0.3s ease;
  border: none;
}

/* Only show on desktop */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) translateX(-50%);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
  }
}

/* Layout classes - updated for mobile responsiveness */
body #sidebar {
  display: none; /* Hide sidebar by default on all screens */
}

/* Only show sidebar on mobile when needed */
@media (max-width: 767px) {
  body #sidebar.open {
    display: block; /* Show sidebar on mobile only when opened */
  }

  .floating-menu-container {
    display: none; /* Hide floating menu on mobile */
  }
}

/* Show floating menu on tablets and larger */
@media (min-width: 768px) {
  .floating-menu-container {
    display: block;
  }
}

body #main-content {
  margin-left: 0 !important; /* Always remove margin since sidebar is hidden by default */
  width: 100% !important;
}

/* Adjust main content padding when using top menu */
body main {
  padding-top: 5rem !important; /* Always add padding for the floating menu */
}

/* Mobile-specific adjustments */
@media (max-width: 767px) {
  body main {
    padding-top: 4rem !important; /* Less padding on mobile for the header */
  }

  .floating-menu {
    width: 95vw;
    max-width: 95vw;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.5rem;
  }

  .floating-menu-nav {
    width: 100%;
    justify-content: space-between;
  }

  .floating-menu-item,
  .floating-menu-dropdown-trigger {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }

  .floating-menu-item i,
  .floating-menu-dropdown-trigger i:first-child {
    margin-right: 0.25rem;
    height: 0.875rem;
    width: 0.875rem;
  }

  /* Hide text on very small screens, show only icons */
  @media (max-width: 480px) {
    .floating-menu-item span,
    .floating-menu-dropdown-trigger span {
      display: none;
    }

    .floating-menu-item i,
    .floating-menu-dropdown-trigger i:first-child {
      margin-right: 0;
    }

    .floating-menu-dropdown-trigger i:last-child {
      display: none;
    }
  }
}

/* Dark mode adjustments */
.dark .floating-menu {
  background-color: hsla(var(--card) / 0.7);
}

.dark .floating-menu:hover {
  background-color: hsla(var(--card) / 0.8);
}

.dark .floating-menu-dropdown-content {
  background-color: hsl(var(--card));
  border-color: hsla(var(--border) / 0.2);
}
