:root{
  --brand:#0d6efd;
  --muted:#6c757d;
}

/* Mobile-first optimizations */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  -webkit-touch-callout: none;
}

body { 
  padding-bottom: 40px; 
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; 
  background:#f7f8fb;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Improve touch scrolling */
.navbar-collapse,
.modal,
.dropdown-menu {
  -webkit-overflow-scrolling: touch;
}

/* Prevent text size adjustment on mobile */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Navbar Styling */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  font-weight: 500;
  padding: 8px 16px;
  transition: color 0.2s ease;
}

.navbar-nav .nav-link:hover {
  color: #fff !important;
  opacity: 0.9;
}

.navbar-nav .nav-link i {
  margin-right: 5px;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 150px;
}

/* Hero Banner */
.hero-banner {
  position: relative;
  height: 500px;
  background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.4)), 
              url('https://images.unsplash.com/photo-1564013799919-ab600027ffc6?w=1920&q=80&auto=format&fit=crop') center/cover no-repeat;
  margin-bottom: 40px;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-content {
  padding: 20px;
}
.search-box-large {
  max-width: 900px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.search-box-large .form-control,
.search-box-large .form-select {
  font-size: 0.95rem;
}

/* Quick Booking Cards */
.quick-book-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(18,38,63,0.06);
  transition: all .3s ease;
  height: 100%;
  cursor: pointer;
}
.quick-book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(18,38,63,0.12);
}
a.text-decoration-none:hover .quick-book-card h5,
a.text-decoration-none:hover .quick-book-card p {
  color: inherit;
}

/* Listing Cards */
.listings-wrapper {
  position: relative;
}

.listings-grid {
  display: flex;
  flex-wrap: wrap;
}

.listing-item {
  margin-bottom: 24px;
}

.listing-card { 
  border: none;
  border-radius: 12px; 
  overflow: hidden; 
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 2px 12px rgba(18,38,63,0.08);
}
a:has(.listing-card) {
  display: block;
  text-decoration: none;
}
a:has(.listing-card):hover .listing-card { 
  transform: translateY(-8px); 
  box-shadow: 0 12px 32px rgba(18,38,63,0.15); 
  cursor: pointer;
}
.listing-card .card-title {
  transition: color 0.2s ease;
}
a:hover .listing-card .card-title {
  color: #0d6efd !important;
}
.listing-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 220px;
}
.listing-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.listing-card:hover .listing-img-wrapper img { 
  transform: scale(1.08); 
}
.badge-location {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255,255,255,0.95);
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-primary { background: var(--brand); border-color: var(--brand); }
.badge-muted { background: var(--muted); color: white; }
.listing-meta { color: var(--muted); font-size: 0.95rem; }
.footer { position: relative; bottom: 0; width: 100%; }

/* Featured Rental Cards */
.featured-rental-card {
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  overflow: hidden;
  border-radius: 12px;
}

.featured-rental-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.featured-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 180px;
}

.featured-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-rental-card:hover .featured-img-wrapper img {
  transform: scale(1.05);
}

.badge-featured {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.featured-rental-card .card-body {
  padding: 1rem;
}

.featured-rental-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

/* Sidebar Filters */
.sidebar-filters {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 20px;
}

.filter-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e9ecef;
}

.filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.filter-checkbox:hover {
  background-color: #f8f9fa;
}

.filter-checkbox input[type=\"checkbox\"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #0d6efd;
}

.filter-checkbox span {
  color: #495057;
  font-weight: 500;
}

.filter-checkbox span i {
  margin-right: 6px;
  font-size: 0.9rem;
  color: #6c757d;
}

/* Filter Buttons */
.filter-button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.filter-button:hover {
  background-color: #f8f9fa;
  border-color: #0d6efd;
  color: #0d6efd;
}

.filter-button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.filter-button.active:hover {
  background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

.filter-button i {
  margin-right: 8px;
  font-size: 1rem;
}

.filter-button.active i {
  color: white;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.category-link:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
  color: white;
}

.category-link i {
  margin-right: 10px;
  font-size: 1.1rem;
}

.price-inputs {
  display: flex;
  flex-direction: column;
}

.price-inputs input {
  font-size: 0.9rem;
}

.listings-count {
  font-size: 0.8rem;
  vertical-align: middle;
  padding: 0.4em 0.6em;
}

@media (max-width: 991px) {
  .sidebar-filters {
    position: relative;
    top: 0;
    margin-bottom: 30px;
  }
}

/* Listing Detail Page Styles */
.listing-gallery {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.listing-detail-img {
  height: 500px;
  object-fit: cover;
  width: 100%;
}

/* Carousel controls visibility */
.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  opacity: 0.8;
  z-index: 10;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 2rem;
  height: 2rem;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 10px;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 5px;
}

.thumbnail-gallery-wrapper {
  margin-top: 15px;
  overflow: hidden;
  position: relative;
}

.thumbnail-gallery-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #0d6efd #f0f0f0;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.thumbnail-gallery-scroll::-webkit-scrollbar {
  height: 8px;
}

.thumbnail-gallery-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.thumbnail-gallery-scroll::-webkit-scrollbar-thumb {
  background: #0d6efd;
  border-radius: 10px;
}

.thumbnail-gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: #0b5ed7;
}

.thumbnail-item {
  flex: 0 0 auto;
  width: 150px;
  scroll-snap-align: start;
}

.thumbnail-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  opacity: 0.7;
  display: block;
}

.thumbnail-img:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.thumbnail-img.active {
  border-color: #0d6efd;
  opacity: 1;
}

.property-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
}

.price-tag {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 20px;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  display: block;
  line-height: 1;
}

.price-period {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  font-weight: 500;
}

.booking-sidebar .card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.booking-sidebar .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15) !important;
}

.sticky-booking {
  position: sticky;
  top: 20px;
}

.quick-info {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
}

.info-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.amenities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.amenity-item {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.amenity-item:hover {
  background: #e9ecef;
  border-color: #0d6efd;
  transform: translateX(5px);
}

.amenity-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  margin-right: 12px;
  flex-shrink: 0;
}

.amenity-text {
  font-weight: 500;
  color: #495057;
  font-size: 0.95rem;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.5);
  border: 2px solid rgba(255,255,255,0.8);
}

.carousel-indicators .active {
  background-color: white;
}

@media (max-width: 991px) {
  .sticky-booking {
    position: relative;
    top: 0;
  }
  
  .listing-detail-img {
    height: 350px;
  }
  
  .amenities-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px){
  /* General mobile optimizations */
  body {
    font-size: 16px;
  }
  
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Hero Section */
  .hero-banner { 
    height: 350px; 
    margin-bottom: 30px;
  }
  
  .hero-content {
    padding: 15px;
  }
  
  .hero-content h1 { 
    font-size: 1.75rem;
    margin-bottom: 15px;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .search-box-large { 
    padding: 15px;
    max-width: 100%;
  }
  
  .search-box-large .form-control,
  .search-box-large .form-select,
  .search-box-large .btn {
    font-size: 16px;
    padding: 12px 16px;
    height: 48px;
    border-radius: 8px;
  }
  
  /* Buttons and touch targets */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  .btn-lg {
    min-height: 50px;
    padding: 14px 24px;
    font-size: 18px;
  }
  
  /* Cards */
  .quick-book-card { 
    margin-bottom: 20px;
    padding: 20px;
  }
  
  .quick-book-card h5 {
    font-size: 1.25rem;
  }
  
  .quick-book-card p {
    font-size: 0.95rem;
  }
  
  .quick-book-card i {
    font-size: 2.5rem;
  }
  
  /* Horizontal scrolling for property listings */
  .listings-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    margin: 0 -15px;
    padding: 0 15px;
  }
  
  .listings-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }
  
  .listings-grid {
    flex-wrap: nowrap;
    gap: 15px;
  }
  
  .listing-item {
    flex: 0 0 85%;
    max-width: 85%;
    scroll-snap-align: start;
    margin-bottom: 0;
  }
  
  .listing-card {
    margin-bottom: 0;
    height: 100%;
  }
  
  .listing-img-wrapper {
    height: 200px;
  }
  
  .featured-img-wrapper { 
    height: 180px; 
  }
  
  .featured-rental-card {
    margin-bottom: 20px;
  }
  
  /* Listing Detail Page */
  .listing-detail-img {
    height: 280px;
  }
  
  .thumbnail-img {
    height: 70px;
  }
  
  .price-amount {
    font-size: 2rem;
  }
  
  .property-title {
    font-size: 1.4rem;
    line-height: 1.4;
  }
  
  .booking-sidebar {
    margin-top: 30px;
  }
  
  .booking-sidebar .btn {
    font-size: 18px;
  }
  
  .amenities-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .amenity-item {
    padding: 14px;
  }
  
  .info-icon {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  
  /* Navbar mobile improvements */
  .navbar {
    padding: 10px 0;
  }
  
  .navbar-brand {
    font-size: 1.4rem;
    padding: 8px 0;
  }
  
  .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
    padding: 10px 14px;
    font-size: 1.2rem;
  }
  
  .navbar-toggler:focus {
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.5);
  }
  
  .navbar-toggler-icon {
    width: 26px;
    height: 26px;
  }
  
  .navbar-collapse {
    background-color: #212529;
    padding: 15px;
    margin: 10px -15px -10px -15px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }
  
  .navbar-nav {
    margin-top: 0;
  }
  
  .navbar-nav .nav-item {
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-item:last-child {
    border-bottom: none;
  }
  
  .navbar-nav .nav-link {
    padding: 14px 12px !important;
    font-size: 16px;
    font-weight: 500;
    display: block;
    color: rgba(255, 255, 255, 0.85) !important;
  }
  
  .navbar-nav .nav-link:active {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
  }
  
  .navbar-nav .dropdown-menu {
    background-color: #343a40;
    border: none;
    margin-top: 0;
    padding: 0;
    box-shadow: none;
  }
  
  .navbar-nav .dropdown-toggle::after {
    float: right;
    margin-top: 8px;
  }
  
  .navbar-nav .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    padding: 14px 20px;
    font-size: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-nav .dropdown-item:hover,
  .navbar-nav .dropdown-item:active {
    background-color: #495057;
    color: #fff;
  }
  
  /* Filter sidebar */
  .sidebar-filters {
    padding: 15px;
    margin-bottom: 25px;
  }
  
  .filter-title {
    font-size: 0.9rem;
    margin-bottom: 12px;
  }
  
  .filter-button {
    padding: 12px 14px;
    font-size: 16px;
  }
  
  .filter-button i {
    font-size: 1.1rem;
  }
  
  .filter-checkbox {
    padding: 12px 10px;
    font-size: 16px;
  }
  
  .filter-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
  }
  
  .category-link {
    padding: 14px 16px;
    font-size: 16px;
  }
  
  /* Forms */
  .form-control,
  .form-select,
  .form-check-input {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 14px;
  }
  
  .form-label {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 500;
  }
  
  /* Cards and sections spacing */
  .card {
    margin-bottom: 20px;
  }
  
  .card-body {
    padding: 20px;
  }
  
  .card-title {
    font-size: 1.2rem;
  }
  
  /* Footer */
  .footer {
    padding: 20px 0;
    margin-top: 40px;
  }
  
  .footer small {
    font-size: 14px;
  }
  
  /* Modal improvements */
  .modal-dialog {
    margin: 10px;
  }
  
  .modal-content {
    border-radius: 12px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  /* Table responsiveness */
  .table-responsive {
    font-size: 14px;
  }
  
  /* Badge sizes */
  .badge {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  /* Price display */
  .price-tag {
    padding: 18px;
    margin-bottom: 18px;
  }
  
  /* Reduce animations on mobile for better performance */
  * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
  }
}
