html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Fix sidebar scrolling issue - ensure sidebar content is scrollable */
.sidebar-wrapper {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Mobile responsiveness improvements */
@media (max-width: 991.98px) {
  /* Start with collapsed sidebar on mobile */
  body:not(.sidebar-open) {
    padding-left: 0 !important;
  }
  
  /* Ensure sidebar overlay works on mobile */
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  }
  
  body:not(.sidebar-open) .app-sidebar {
    transform: translateX(-100%);
  }
  
  /* Add overlay backdrop when sidebar is open on mobile */
  body.sidebar-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1039;
    animation: fadeIn 0.3s;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  /* Ensure sidebar is above overlay */
  .app-sidebar {
    z-index: 1040;
    position: fixed;
    transition: transform 0.3s ease-in-out;
  }
  
  /* Make sure main content isn't offset on mobile */
  .app-main {
    margin-left: 0 !important;
  }
  
  /* Ensure header spans full width on mobile */
  .header {
    left: 0 !important;
    width: 100% !important;
  }
}

/* Improve touch targets on mobile */
@media (max-width: 767.98px) {
  .nav-link {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .sidebar-menu .nav-link {
    padding: 0.75rem 1rem;
  }
  
  /* Make buttons easier to tap */
  .btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  
  /* Improve form inputs on mobile */
  .form-control, .form-select {
    min-height: 44px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  /* Stack footer links vertically on very small screens */
  .app-footer .float-end {
    float: none !important;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  /* Adjust breadcrumbs for mobile */
  .breadcrumb {
    font-size: 0.875rem;
    flex-wrap: wrap;
  }
}

/* Ensure content is scrollable on mobile */
@media (max-width: 991.98px) {
  .app-content {
    padding: 1rem;
    overflow-x: hidden;
  }
  
  /* Make tables responsive */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}

/* Fix cookie banner on mobile */
@media (max-width: 767.98px) {
  .cookie-consent-banner .container-fluid {
    padding: 0.5rem;
  }
  
  .cookie-consent-banner .btn {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .cookie-consent-content p {
    font-size: 0.85rem;
  }
}