/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ============================================
   Mobile Responsive Styles
   ============================================ */

/* Base Mobile Styles */
@media (max-width: 767.98px) {
  /* Container adjustments */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Typography */
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  h4, h5 {
    font-size: 1.1rem;
  }

  /* Header/Navbar improvements */
  .navbar-brand {
    font-size: 1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .navbar-nav .nav-item.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .navbar-nav .nav-item.d-flex img {
    margin-bottom: 0.5rem;
    margin-right: 0 !important;
  }

  /* Buttons */
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }

  .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    margin-bottom: 0.25rem;
    width: 100%;
  }

  /* Cards */
  .card {
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1rem;
  }

  /* Tables - make them scrollable */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.5rem;
    white-space: nowrap;
  }

  .table th {
    font-size: 0.8rem;
  }

  /* Forms */
  .form-group {
    margin-bottom: 1rem;
  }

  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.5rem 0.75rem;
  }

  .form-label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
  }

  /* Filter buttons - stack on mobile */
  .mb-3 .btn-sm {
    margin-bottom: 0.5rem;
    margin-right: 0.25rem;
  }

  /* Statistics cards - stack vertically */
  .row .col-md-3 {
    margin-bottom: 1rem;
  }

  /* Action buttons in tables */
  .table td .btn-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .table td .btn {
    margin: 0.25rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  /* Alerts */
  .alert {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  /* Badges */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  /* Spacing adjustments */
  .mb-4 {
    margin-bottom: 1.5rem !important;
  }

  .mt-4 {
    margin-top: 1.5rem !important;
  }

  /* Flex utilities for mobile */
  .d-flex.justify-content-between {
    flex-direction: column;
  }

  .d-flex.justify-content-between > div {
    margin-bottom: 1rem;
  }

  .d-flex.justify-content-between > div:last-child {
    margin-bottom: 0;
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 991.98px) {
  .container {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  .table {
    font-size: 0.9rem;
  }

  .btn-group {
    flex-wrap: wrap;
  }
}

/* Small Mobile Devices */
@media (max-width: 575.98px) {
  /* Even tighter spacing */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  h1 {
    font-size: 1.5rem;
  }

  /* Hide less important columns in tables on very small screens */
  .table-responsive .table th:nth-child(n+5),
  .table-responsive .table td:nth-child(n+5) {
    display: none;
  }

  /* Make filter forms stack */
  .row.g-3 > div {
    margin-bottom: 1rem;
  }

  /* Button groups become vertical */
  .btn-group-vertical {
    width: 100%;
  }
}

/* Landscape Mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
  .navbar-nav {
    flex-direction: row;
  }

  .table {
    font-size: 0.8rem;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Better spacing for touch */
  .table td {
    padding: 0.75rem 0.5rem;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .pagination,
  .alert {
    display: none !important;
  }

  .container {
    max-width: 100%;
  }

  .table {
    font-size: 0.75rem;
  }
}

/* Enhanced Pagination Styling */
.pagination {
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

.pagination .page-link {
  padding: 0.5rem 0.75rem;
  color: #495057;
  background-color: #fff;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
  min-width: 42px;
  text-align: center;
  margin: 0 2px;
}

.pagination .page-link:hover {
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-decoration: none;
}

.pagination .page-item.active .page-link {
  z-index: 1;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
  font-weight: 600;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  pointer-events: none;
  cursor: auto;
  background-color: #fff;
  border-color: #dee2e6;
  opacity: 0.6;
}

.pagination .page-item:first-child .page-link {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.pagination .page-item:last-child .page-link {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.pagination-info {
  text-align: center;
  margin-top: 0.5rem;
}

.pagination-info small {
  color: #6c757d;
}
