/* Application Layout - Modern CSS 2025 */

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  background-color: #f9fafb;
}

/* App Layout Container */
.app-layout {
  display: flex;
  min-height: 100vh;
  @media (min-width: 1024px) {
    margin-left: 15rem;
  }
}

/* Hidden Checkbox for Mobile Menu */
.app-sidebar-toggle,
.backoffice-sidebar-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* Content Area */
.app-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  position: relative;
  z-index: 50;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e5e7eb;
}

.app-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
  padding: 0.5rem;

  @media (min-width: 1024px) {
    padding-inline: 1.5rem;
  }
}

.app-header-left {
  display: flex;
  align-items: center;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: block;
  padding: 0.5rem;
  margin-right: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: opacity 200ms;
}

.mobile-menu-toggle:hover {
  opacity: 0.75;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Page Title */
.app-page-title-wrapper {
  margin-left: 1rem;
}

@media (min-width: 1024px) {
  .app-page-title-wrapper {
    margin-left: 0;
  }
}

.app-page-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}

/* Main Content */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

@media (min-width: 1024px) {
  .app-main {
    padding: 1.5rem;
  }
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.3);
}

.app-sidebar-toggle:checked ~ .mobile-overlay {
  display: block;
}

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

/* Backoffice Mobile Overlay (darker) */
.mobile-overlay-dark {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: rgba(0, 0, 0, 0.5);
}

.backoffice-sidebar-toggle:checked ~ .mobile-overlay-dark {
  display: block;
}

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

/* Flash Messages (Authentication & Clean layouts) */

.bg-gradient {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

@media (min-width: var(--breakpoint-mobile)) {
  .bg-gradient {
    padding: 1.5rem;
  }
}

@media (min-width: var(--breakpoint-desktop)) {
  .bg-gradient {
    padding: 2rem;
  }
}

/* Impersonate Banner */
.impersonate-banner {
  background-color: #fef3c7;
  border-bottom: 1px solid #fbbf24;
  padding: 0.75rem 1rem;
  z-index: 100;
}

.impersonate-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  font-size: 0.875rem;
  color: #92400e;
}

.impersonate-banner-content .btn.sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Sandbox Banner */
.sandbox-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fed7aa;
  border-bottom: 1px solid #fb923c;
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #9a3412;
  z-index: 500;
}

body.has-sandbox-banner {
  padding-top: 2.5rem;
}
