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;
}

/* ================================
   GLOBAL SLIM SCROLLBAR STYLES
   ================================ */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(155, 155, 155, 0.5) transparent;
}

/* Webkit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(155, 155, 155, 0.5);
  border-radius: 20px;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(155, 155, 155, 0.7);
}

/* Dark theme scrollbars */
.dark *::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] *::-webkit-scrollbar-thumb {
  background-color: rgba(100, 100, 100, 0.5);
}

.dark *::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 100, 100, 0.7);
}

/* ================================
   GLOBAL MOBILE RESPONSIVE STYLES
   ================================ */

/* Ensure touch-friendly tap targets */
@media (max-width: 767.98px) {
  .btn,
  .nav-link,
  .dropdown-item,
  .form-control,
  .form-select {
    min-height: 44px;
  }

  /* Prevent text size adjustment on orientation change */
  html {
    -webkit-text-size-adjust: 100%;
  }

  /* Better touch scrolling */
  .overflow-auto,
  .overflow-scroll,
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* Responsive images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Stack flex items on mobile */
  .flex-mobile-column {
    flex-direction: column !important;
  }

  /* Full width buttons on mobile */
  .btn-mobile-full {
    width: 100% !important;
  }

  /* Responsive spacing */
  .p-mobile-2 { padding: 0.5rem !important; }
  .p-mobile-3 { padding: 1rem !important; }
  .m-mobile-0 { margin: 0 !important; }
  .gap-mobile-2 { gap: 0.5rem !important; }
}

/* Small mobile */
@media (max-width: 575.98px) {
  /* Even smaller padding */
  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Compact cards */
  .card-body {
    padding: 0.75rem;
  }

  /* Smaller headings */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.25rem; }
  h3, .h3 { font-size: 1.1rem; }

  /* Responsive tables */
  .table {
    font-size: 0.8125rem;
  }

  .table th,
  .table td {
    padding: 0.5rem;
  }

  /* Prevent form zoom on iOS */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Utility classes for responsive visibility */
@media (max-width: 767.98px) {
  .hide-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .show-mobile-only { display: none !important; }
}

/* Safe area support for notched devices */
@supports (padding: max(0px)) {
  .safe-area-inset {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
}
