/* public/css/responsive.css */

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Mobile Menu Button Position */
  #mobileMenuBtn {
    position: absolute;
  }
  
  [dir="ltr"] #mobileMenuBtn {
    right: 1rem;
  }
  
  [dir="rtl"] #mobileMenuBtn {
    left: 1rem;
  }
  
  /* Mobile Menu Animation */
  [dir="ltr"] #mobileMenu {
    animation: slideInRight 0.3s ease-out;
  }
  
  [dir="rtl"] #mobileMenu {
    animation: slideInLeft 0.3s ease-out;
  }
  
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  /* Navigation */
  nav .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
    position: relative;
  }
  
  nav .flex.justify-between {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
  }
  
  nav .flex.justify-between > a {
    margin-bottom: 1rem;
    width: 100%;
    justify-content: center;
  }
  
  nav .flex.items-center.space-x-4 {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  /* Hero Section */
  .relative.h-screen {
    height: auto;
    min-height: 80vh;
    padding: 3rem 0;
  }
  
  .relative.h-screen .max-w-7xl {
    padding: 0 1.5rem;
  }
  
  .relative.h-screen .text-white {
    max-width: 100%;
  }
  
  h1.text-4xl,
  h1.text-6xl,
  .text-6xl {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }
  
  .text-xl,
  .text-2xl {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }
  
  /* Search Form */
  .relative.h-screen form {
    width: 100%;
  }
  
  .relative.h-screen form input {
    font-size: 0.875rem !important;
  }
  
  .relative.h-screen form button {
    padding: 0.875rem !important;
    font-size: 1rem !important;
  }
  
  /* Grid Layouts */
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
  
  .grid-cols-1.md\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
  
  .grid-cols-1.md\:grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  /* Property Cards */
  .hover-lift:hover {
    transform: none;
  }
  
  /* Chat Widget */
  #chatWidget {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  
  #chatToggle {
    width: 56px;
    height: 56px;
  }
  
  #chatBox {
    width: calc(100vw - 2rem);
    max-width: 380px;
    right: 0;
    bottom: 75px;
  }
  
  #chatMessages {
    height: 60vh;
    max-height: 400px;
    scroll-behavior: smooth;
  }
  
  /* Detail Page */
  .grid.grid-cols-4.gap-2 {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .grid.grid-cols-4.gap-2 > div:first-child {
    grid-column: span 1;
    grid-row: span 1;
    height: 250px;
  }
  
  .grid.grid-cols-3.gap-8 {
    grid-template-columns: 1fr;
  }
  
  .col-span-2,
  .col-span-1 {
    grid-column: span 1;
  }
  
  /* Booking Card */
  .sticky.top-20 {
    position: relative;
    top: 0;
  }
  
  /* Search Filters */
  .flex.items-center.space-x-4 {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .flex.items-center.space-x-4 label {
    width: 100%;
  }
  
  .ml-auto {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Typography */
  .text-5xl {
    font-size: 2rem;
  }
  
  .text-4xl {
    font-size: 1.75rem;
  }
  
  .text-3xl {
    font-size: 1.5rem;
  }
  
  /* Spacing */
  .py-20 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .px-4.sm\:px-6.lg\:px-8 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .text-6xl.md\:text-7xl {
    font-size: 3rem !important;
  }
  
  .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #chatBox {
    width: 360px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
  
  input,
  select,
  textarea {
    font-size: 16px;
  }
  
  .hover\:shadow-xl:hover,
  .hover\:bg-gray-50:hover,
  .hover\:scale-105:hover {
    box-shadow: none;
    background-color: inherit;
    transform: none;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .relative.h-screen {
    min-height: 100vh;
  }
  
  #chatMessages {
    height: 40vh;
  }
}

/* RTL Mobile Adjustments */
@media (max-width: 768px) {
  [dir="rtl"] .space-x-reverse {
    flex-direction: row-reverse;
  }
  
  [dir="rtl"] .flex.items-center {
    flex-direction: row-reverse;
  }
}