/* Page Layout CSS */

/* Main layout */
.page-container {
  display: flex;
  height: 100vh;
  background-color: #f9fafb; /* bg-gray-50 */
}

/* Sidebar */
.page-sidebar {
  width: 16rem; /* w-64 */
  background-color: #ffffff; /* bg-white */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
}

.page-sidebar-header {
  padding: 1.5rem; /* p-6 */
}

.page-sidebar-title {
  font-size: 1.5rem; /* text-2xl */
  font-weight: 700; /* font-bold */
  color: #1f2937; /* text-gray-800 */
}

.page-sidebar-subtitle {
  font-size: 0.875rem; /* text-sm */
  color: #4b5563; /* text-gray-600 */
  margin-top: 0.25rem; /* mt-1 */
}

.page-nav {
  margin-top: 1.5rem; /* mt-6 */
}

/* Navigation items */
.page-nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  padding-left: 1.5rem; /* px-6 */
  padding-right: 1.5rem; /* px-6 */
  padding-top: 0.75rem; /* py-3 */
  padding-bottom: 0.75rem; /* py-3 */
  text-align: left;
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  color: #4b5563; /* text-gray-600 */
}

.page-nav-button:hover {
  background-color: #f9fafb; /* hover:bg-gray-50 */
}

.page-nav-button-active {
  background-color: #eff6ff; /* bg-blue-50 */
  color: #2563eb; /* text-blue-600 */
  border-right-width: 2px;
  border-right-color: #2563eb; /* border-blue-600 */
}

/* Main content area */
.page-content {
  flex: 1;
  overflow: auto;
}

.page-content-inner {
  padding: 1.5rem; /* p-6 */
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem; /* mb-6 */
}

.page-title {
  font-size: 1.875rem; /* text-3xl */
  font-weight: 700; /* font-bold */
  color: #111827; /* text-gray-900 */
}

.page-description {
  color: #4b5563; /* text-gray-600 */
  margin-top: 0.5rem; /* mt-2 */
}

/* Icons */
.page-icon {
  width: 1.25rem; /* w-5 */
  height: 1.25rem; /* h-5 */
  margin-right: 0.75rem; /* mr-3 */
}

/* Loading bar */
.loading-bar {
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent,
  #000, transparent,
  #000, transparent
  );
}

.htmx-request.loading-bar {
  opacity: 1;
  animation: fadeIn 2s linear forwards, slide 0.8s ease-in-out infinite;
}

@keyframes slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Mobile Navigation */
.mobile-nav-toggle {
  display: none;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.mobile-nav-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 16rem; /* w-64 */
  height: 100%;
  background-color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 51;
}

.mobile-nav-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Show mobile navigation when checkbox is checked */
.mobile-nav-toggle:checked ~ .mobile-nav-overlay {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-toggle:checked ~ .mobile-nav-overlay .mobile-nav-content {
  transform: translateX(0);
}

.mobile-nav-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.mobile-nav-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.mobile-nav-subtitle {
  font-size: 0.875rem;
  color: #4b5563;
  margin-top: 0.25rem;
}

.mobile-nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-close:hover {
  color: #1f2937;
}

.mobile-nav {
  padding: 1rem 0;
}

.mobile-nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  text-align: left;
  transition-property: color, background-color;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  color: #4b5563;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  z-index: 50;
}

.mobile-nav-button:hover {
  background-color: #f9fafb;
}

.mobile-nav-button-active {
  background-color: #eff6ff;
  color: #2563eb;
  border-right-width: 2px;
  border-right-color: #2563eb;
}

/* Mobile hamburger menu button */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #4b5563;
}

.mobile-menu-button:hover {
  color: #1f2937;
}

.hamburger-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Page header adjustments for mobile */
.page-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.page-header-text {
  flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page-sidebar {
    display: none;
  }

  .mobile-menu-button {
    display: block;
  }

  .mobile-nav-overlay {
    display: block;
  }

  .page-content-inner {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }
}

@media (min-width: 769px) {
  .mobile-nav-overlay {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: none !important;
  }
}
