/* Global Responsive Enhancements */

* {
  box-sizing: border-box;
}

/* Ensure proper viewport scaling */
html {
  font-size: 16px;
}

body {
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

/* Base container improvements */
.container {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* Fix hero section heights for mobile */
.hero-section {
  min-height: calc(100vh - 64px); /* Account for navbar */
}

@media (min-width: 768px) {
  .hero-section {
    min-height: 819px; /* Original height for desktop */
  }
}

/* Improve text scaling */
.text-scale {
  font-size: 1rem;
}

@media (min-width: 640px) {
  .text-scale {
    font-size: 1.125rem;
  }
}

@media (min-width: 1024px) {
  .text-scale {
    font-size: 1.25rem;
  }
}

/* Better spacing utilities */
.space-y-responsive > * + * {
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .space-y-responsive > * + * {
    margin-top: 2rem;
  }
}

@media (min-width: 1024px) {
  .space-y-responsive > * + * {
    margin-top: 2.5rem;
  }
}

/* Grid improvements */
.grid-responsive {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card improvements */
.card-responsive {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.card-responsive:hover {
  transform: translateY(-0.25rem);
  transition: transform 0.2s ease;
}

/* Form improvements */
.form-input-responsive {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.form-input-responsive:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Button improvements */
.button-responsive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: #2563eb;
  color: white;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.button-responsive:hover {
  background-color: #1d4ed8;
}

.button-responsive:active {
  transform: scale(0.98);
}

/* Secondary button */
.button-secondary-responsive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.button-secondary-responsive:hover {
  background-color: #eff6ff;
}

.button-secondary-responsive:active {
  transform: scale(0.98);
}

/* Navigation improvements */
.navbar-responsive {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4rem;
  background-color: white;
  border-bottom: 1px solid #e5e7eb;
  z-index: 50;
}

/* Dashboard headers with fixed sidebar widths */
@media (max-width: 767px) {
  [class*="w-[calc(100%-18rem)]"] {
    width: 100% !important;
  }
}

@media (min-width: 768px) {
  .navbar-responsive {
    height: 5rem;
  }
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none;
  }
}

/* Hide desktop menu on mobile */
.desktop-menu {
  display: none;
}

@media (min-width: 768px) {
  .desktop-menu {
    display: flex;
  }
}

/* Footer improvements */
.footer-responsive {
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (min-width: 640px) {
  .footer-responsive {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

/* Utility classes for better responsiveness */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-center-responsive {
  text-align: center;
}

@media (min-width: 640px) {
  .text-center-responsive {
    text-align: left;
  }
}

/* Image responsiveness */
.img-responsive {
  max-width: 100%;
  height: auto;
}

/* Prevent horizontal overflow */
.overflow-x-hidden {
  overflow-x: hidden;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}
