/* Mobile-First Responsive Styles for RentTrust */

/* Base Mobile Styles */
@media (max-width: 768px) {
  /* Typography */
  .text-6xl {
    font-size: 2.5rem !important;
  }
  .text-5xl {
    font-size: 2.25rem !important;
  }
  .text-4xl {
    font-size: 2rem !important;
  }
  .text-3xl {
    font-size: 1.75rem !important;
  }
  .text-2xl {
    font-size: 1.5rem !important;
  }
  .text-xl {
    font-size: 1.25rem !important;
  }

  /* Spacing */
  .py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  .py-16 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  .py-12 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .px-8 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  .px-6 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Container */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Buttons */
  .btn-mobile {
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* Forms */
  .form-input-mobile {
    padding: 0.875rem 1rem !important;
    font-size: 1rem !important;
    border-radius: 0.5rem !important;
  }

  /* Cards */
  .card-mobile {
    margin: 0.5rem !important;
    padding: 1.5rem !important;
    border-radius: 1rem !important;
  }

  /* Navigation */
  .nav-mobile {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
  }

  /* Grid adjustments */
  .grid-cols-3 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }

  /* Flexbox adjustments */
  .flex-row {
    flex-direction: column !important;
  }

  .space-x-6 > * + * {
    margin-left: 0 !important;
    margin-top: 1rem !important;
  }

  .space-x-4 > * + * {
    margin-left: 0 !important;
    margin-top: 0.75rem !important;
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .text-6xl {
    font-size: 3.5rem !important;
  }
  .text-4xl {
    font-size: 2.5rem !important;
  }
  .text-3xl {
    font-size: 2rem !important;
  }

  .container {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  .hover\:bg-blue-700:hover {
    background-color: #1d4ed8 !important;
  }

  .hover\:text-gray-900:hover {
    color: #111827 !important;
  }

  /* Increase touch targets */
  button,
  .btn,
  a[role="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
  }

  /* Remove hover effects on touch devices */
  .hover\:shadow-lg:hover {
    box-shadow: none !important;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .text-sm {
    font-size: 0.9375rem !important;
  }
  .text-base {
    font-size: 1.0625rem !important;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .py-20 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .py-16 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .min-h-screen {
    min-height: 100vh !important;
  }
}

/* Focus styles for accessibility */
@media (max-width: 768px) {
  .focus\:ring-2:focus {
    ring-width: 3px !important;
  }

  .focus\:outline-none:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  .print-friendly {
    background: white !important;
    color: black !important;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .transition-colors,
  .transition-transform,
  .transition-all {
    transition: none !important;
  }

  .animate-spin,
  .animate-bounce,
  .animate-pulse {
    animation: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .dark-mode-bg {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
  }

  .dark-mode-card {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
  }
}

/* Custom mobile utilities */
.mobile-only {
  display: block !important;
}

.desktop-only {
  display: none !important;
}

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

  .desktop-only {
    display: block !important;
  }
}

/* Mobile form improvements */
@media (max-width: 768px) {
  select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px !important;
    border-radius: 8px !important;
  }

  .form-group {
    margin-bottom: 1.5rem !important;
  }

  label {
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
  }
}

/* Mobile navigation improvements */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.mobile-nav-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 50;
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-menu.open {
  right: 0;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Sticky elements on mobile */
@media (max-width: 768px) {
  .sticky-mobile {
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
  }
}

/* Safe area adjustments for notched devices */
@supports (padding: max(0px)) {
  .safe-area-top {
    padding-top: max(1rem, env(safe-area-inset-top)) !important;
  }

  .safe-area-bottom {
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }

  .safe-area-left {
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
  }

  .safe-area-right {
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
  }
}
