/* Sidebar Responsive Styles - Media Queries for all screen sizes */

/* Ensure menu doesn't get cut off on all screen sizes */
.menu-inner {
  overflow-x: hidden;
  overflow-y: auto;
  word-wrap: break-word;
  box-sizing: border-box;
  padding: 1.5rem 1rem !important;
  width: 100%;
  max-width: 100%;
}

/* Site Selector Section - Responsive adjustments */
.site-selector-section {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.site-selector-section h3 {
  word-wrap: break-word;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 1.125rem !important;
  margin-bottom: 1rem !important;
}

.site-selector-dropdown {
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem !important;
  font-size: 0.9375rem !important;
}

/* Navigation Buttons - Responsive adjustments */
.menu-nav-button {
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.75rem 1rem !important;
  font-size: 0.9375rem !important;
  width: 100%;
}

.menu-nav-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  flex: 1;
  min-width: 0;
}

.menu-nav-button svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
  .menu-inner {
    padding: 1rem 0.75rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.625rem 2rem 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  .menu-nav-button {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
  
  .menu-nav-button svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
  }
  
  /* Reduce spacing between items on small screens */
  .menu-item {
    margin-bottom: 0.375rem !important;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .menu-inner {
    padding: 1.25rem 0.875rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1.0625rem !important;
    margin-bottom: 0.875rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.6875rem 2.25rem 0.6875rem 0.875rem !important;
    font-size: 0.875rem !important;
  }
  
  .menu-nav-button {
    padding: 0.6875rem 0.875rem !important;
    font-size: 0.875rem !important;
  }
  
  .menu-nav-button svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .menu-inner {
    padding: 1.375rem 0.9375rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1.09375rem !important;
    margin-bottom: 1rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.71875rem 2.375rem 0.71875rem 0.9375rem !important;
    font-size: 0.90625rem !important;
  }
  
  .menu-nav-button {
    padding: 0.71875rem 0.9375rem !important;
    font-size: 0.90625rem !important;
  }
  
  .menu-nav-button svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .menu-inner {
    padding: 1.5rem 1rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button {
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .menu-inner {
    padding: 1.5rem 1rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button {
    padding: 0.75rem 1rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* XXL devices (extra large desktops, 1400px and up) */
@media (min-width: 1400px) {
  .menu-inner {
    padding: 1.5rem 1.125rem !important;
  }
  
  .site-selector-section h3 {
    font-size: 1.125rem !important;
    margin-bottom: 1rem !important;
  }
  
  .site-selector-dropdown {
    padding: 0.75rem 2.5rem 0.75rem 1.125rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button {
    padding: 0.75rem 1.125rem !important;
    font-size: 0.9375rem !important;
  }
  
  .menu-nav-button svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  .menu-inner {
    padding: 0.75rem 0.875rem !important;
  }
  
  .menu-item {
    margin-bottom: 0.25rem !important;
  }
  
  .menu-nav-button {
    padding: 0.5rem 0.875rem !important;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .site-selector-dropdown {
    border-width: 0.5px;
  }
}

/* Prevent text overflow in menu items */
.menu-item {
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

/* Ensure SVG icons don't cause overflow */
.menu-nav-button svg,
.site-selector-dropdown svg {
  flex-shrink: 0;
  display: block;
}

/* Fix for select dropdown overflow */
.site-selector-dropdown {
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ensure parent container doesn't restrict width */
#layout-menu,
.layout-menu,
.sidebar-left {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100%;
}

/* Ensure sidebar doesn't expand beyond its container */
#layout-menu,
.layout-menu {
  box-sizing: border-box;
  overflow: hidden;
  /* Don't override width - let core.css handle it */
}

/* Ensure all menu items fit within sidebar */
.menu-item {
  width: 100%;
  box-sizing: border-box;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow: hidden;
}

/* Ensure dropdown and buttons don't overflow */
.site-selector-dropdown,
.menu-nav-button {
  max-width: 100%;
  box-sizing: border-box;
}

/* Fix for menu inner container */
.menu-inner.py-5 {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure menu items and content don't overflow */
.menu-item .site-selector-section,
.menu-item .menu-nav-button {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ensure proper word breaking for long text */
.menu-nav-button span,
.site-selector-dropdown option {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Fix for layout overlap - ensure content area accounts for sidebar width */
/* Note: core.css should handle margin-left for layout-page, but we ensure it works */

/* Ensure sidebar doesn't expand beyond its intended width - only restrict max-width */
#layout-menu,
.layout-menu {
  max-width: 100% !important;
}

/* Don't override core.css layout calculations, just ensure no overflow */
.layout-menu-fixed .layout-page,
.layout-menu-fixed .content-wrapper,
.layout-menu-fixed #right-content {
  box-sizing: border-box;
  width: 100%;
}

/* On small screens, ensure sidebar doesn't overlap content */
@media (max-width: 991.98px) {
  .layout-menu-fixed .layout-page {
    margin-left: 0 !important;
  }
  
  /* Sidebar should be offcanvas on mobile */
  .layout-menu-fixed #layout-menu,
  .layout-menu-fixed .layout-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
  }
  
  .layout-menu-fixed.layout-menu-open #layout-menu,
  .layout-menu-fixed.layout-menu-open .layout-menu {
    transform: translateX(0);
  }
}

