/**
 * Responsive Design Enhancements
 * Additional responsive utilities and fixes
 */

/* ===================================
   Bootstrap Grid Enhancements
   =================================== */

/* Ensure proper spacing on all screen sizes */
.row {
  margin-left: -15px;
  margin-right: -15px;
}

.row > * {
  padding-left: 15px;
  padding-right: 15px;
}

/* ===================================
   Global Responsive Utilities
   =================================== */

/* Hide elements on specific screen sizes */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block !important;
}

@media (max-width: 767px) {
  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-hide {
    display: none !important;
  }
}

/* ===================================
   Responsive Images
   =================================== */

img {
  max-width: 100%;
  height: auto;
}

.img-fluid {
  max-width: 100%;
  height: auto;
}

/* ===================================
   Responsive Tables
   =================================== */

@media (max-width: 767px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===================================
   Responsive Text Alignment
   =================================== */

@media (max-width: 767px) {
  .text-md-center {
    text-align: center !important;
  }

  .text-md-left {
    text-align: left !important;
  }

  .text-md-right {
    text-align: right !important;
  }
}

/* ===================================
   Responsive Spacing Adjustments
   =================================== */

/* Reduce padding on mobile */
@media (max-width: 767px) {
  .section {
    padding: 2rem 0 !important;
  }

  .py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .py-4 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .my-5 {
    margin-top: 2.5rem !important;
    margin-bottom: 2.5rem !important;
  }

  .my-4 {
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
}

/* Extra small screens */
@media (max-width: 575px) {
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* ===================================
   Responsive Cards
   =================================== */

@media (max-width: 767px) {
  .card {
    margin-bottom: 1rem;
  }

  .card-body {
    padding: 1.25rem;
  }
}

@media (max-width: 575px) {
  .card-body {
    padding: 1rem;
  }
}

/* ===================================
   Responsive Buttons
   =================================== */

@media (max-width: 767px) {
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Full width buttons on mobile */
@media (max-width: 575px) {
  .btn-mobile-full {
    width: 100%;
    display: block;
  }
}

/* ===================================
   Responsive Grid Adjustments
   =================================== */

/* Ensure proper stacking on mobile */
@media (max-width: 767px) {
  .row.g-4 {
    --bs-gutter-y: 1.5rem;
  }

  .row.g-3 {
    --bs-gutter-y: 1rem;
  }
}

/* ===================================
   Responsive Navigation
   =================================== */

/* Ensure navbar is always visible on mobile */
@media (max-width: 991px) {
  .navbar-collapse {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .navbar-nav {
    padding: 0.5rem 0;
  }

  .nav-item {
    margin-bottom: 0.25rem;
  }
}

/* ===================================
   Responsive Forms
   =================================== */

@media (max-width: 767px) {
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .form-label {
    font-size: 0.95rem;
  }
}

/* ===================================
   Responsive Modals
   =================================== */

@media (max-width: 767px) {
  .modal-dialog {
    margin: 0.5rem;
  }

  .modal-content {
    border-radius: 8px;
  }

  .modal-body {
    padding: 1.25rem;
  }
}

/* ===================================
   Responsive Containers
   =================================== */

/* Adjust container padding on mobile */
@media (max-width: 767px) {
  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 575px) {
  .container,
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ===================================
   Responsive Typography
   =================================== */

/* Ensure readable text on all devices */
@media (max-width: 767px) {
  .lead {
    font-size: 1.1rem;
  }

  .display-1 {
    font-size: 3rem;
  }

  .display-2 {
    font-size: 2.5rem;
  }

  .display-3 {
    font-size: 2rem;
  }

  .display-4 {
    font-size: 1.75rem;
  }
}

/* ===================================
   Responsive Utilities
   =================================== */

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Touch-friendly tap targets */
@media (max-width: 767px) {
  a,
  button,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===================================
   Print Styles
   =================================== */

@media print {
  .navbar,
  .footer,
  .btn,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
  }
}

/* ===================================
   Accessibility Improvements
   =================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--gold-start);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--navy-blue);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* ===================================
   Performance Optimizations
   =================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================================
   Dark Mode Support (Optional)
   =================================== */

@media (prefers-color-scheme: dark) {
  /* Add dark mode styles if needed in future */
}
