html {
  font-size: 14px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 16px;
  }
}

/* Focus styles */
.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;
  outline: none;
}

/* Layout improvements */
html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
}

/* Container responsive behavior */
.container-fluid {
  max-width: 100%;
  padding-left: 15px;
  padding-right: 15px;
}

@media (min-width: 576px) {
  .container-fluid {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (min-width: 768px) {
  .container-fluid {
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* Table responsiveness improvements */
.table-responsive {
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table-responsive .table {
  margin-bottom: 0;
  min-width: 100%;
}

/* Better mobile table handling */
@media (max-width: 767.98px) {
  .table-responsive {
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.875rem;
  }

  .table thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
  }

  .btn-group .btn {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }

  .btn-sm {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
  }
}

/* Card improvements */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
}

/* Form improvements */
.form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button improvements */
.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Navigation improvements */
.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

/* Responsive text utilities */
@media (max-width: 575.98px) {
  .display-4 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  h1, .h1 { font-size: 1.75rem; }
  h2, .h2 { font-size: 1.5rem; }
  h3, .h3 { font-size: 1.25rem; }
  h4, .h4 { font-size: 1.125rem; }
  h5, .h5 { font-size: 1rem; }
  h6, .h6 { font-size: 0.875rem; }
}

/* Spacing utilities */
.mb-6 { margin-bottom: 4rem !important; }
.mt-6 { margin-top: 4rem !important; }
.py-6 { padding-top: 4rem !important; padding-bottom: 4rem !important; }

/* Utility classes for better responsive design */
.text-responsive {
  font-size: clamp(0.875rem, 2.5vw, 1rem);
}

.overflow-hidden {
  overflow: hidden;
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Improve modal responsiveness */
.modal-dialog {
  margin: 1rem;
}

@media (min-width: 576px) {
  .modal-dialog {
    margin: 2rem auto;
  }
}

/* Footer improvements */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
  line-height: 60px;
  background-color: #f5f5f5;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animation improvements */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badge improvements */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Alert improvements */
.alert {
  border-radius: 0.375rem;
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Tab improvements */
.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  color: #6c757d;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: #495057;
}

.nav-tabs .nav-link.active {
  border-bottom-color: #007bff;
  color: #007bff;
  background-color: transparent;
}

/* Dropdown improvements */
.dropdown-menu {
  border-radius: 0.375rem;
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  padding: 0.5rem 1rem;
  font-weight: 400;
  transition: background-color 0.15s ease-in-out;
}

/* Improve select elements */
select.form-select {
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
}

/* Print styles */
@media print {
  .navbar, .btn, .footer {
    display: none !important;
  }

  .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}