/* ATLAS Mobile Property Cards - Phase 3 Day 2 */

/* ================================
   MOBILE-OPTIMIZED PROPERTY CARDS
   ================================ */

/* Property Card Mobile Variants */
.property-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  height: auto;
}

/* Mobile: Stack vertically by default */
@media (max-width: 767px) {
  .property-card {
    margin-bottom: var(--space-lg);
    border-radius: 12px;
  }
  
  .property-card-compact {
    flex-direction: row;
    height: 140px;
    max-width: 100%;
  }
  
  .property-card-compact .property-card-image {
    width: 140px;
    height: 100%;
    flex-shrink: 0;
  }
  
  .property-card-compact .property-card-content {
    padding: var(--space-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .property-card-compact .property-card-title {
    font-size: var(--text-sm);
    line-height: 1.3;
    margin-bottom: var(--space-xs);
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .property-card-compact .property-card-price {
    font-size: var(--text-base);
    margin-bottom: var(--space-xs);
  }
  
  .property-card-compact .property-card-features {
    display: none;
  }
  
  .property-card-compact .property-card-actions {
    gap: var(--space-xs);
  }
  
  .property-card-compact .atlas-btn {
    min-height: 32px;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }
}

/* Tablet: 2-column layout */
@media (min-width: 768px) and (max-width: 1023px) {
  .property-card {
    border-radius: 14px;
  }
  
  .property-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

/* Desktop: 3+ columns */
@media (min-width: 1024px) {
  .property-card {
    border-radius: 16px;
  }
  
  .property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  }
  
  .property-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
  }
}

/* Property Card Image Optimizations */
.property-card-image {
  position: relative;
  overflow: hidden;
  background: var(--bg-light);
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .property-card-image img {
  transform: scale(1.08);
}

/* Mobile-specific image heights */
@media (max-width: 767px) {
  .property-card-image {
    height: 180px;
  }
  
  .property-card-compact .property-card-image {
    height: 100%;
  }
}

@media (min-width: 768px) {
  .property-card-image {
    height: 220px;
  }
}

@media (min-width: 1024px) {
  .property-card-image {
    height: 240px;
  }
}

/* Property Card Badges */
.property-card-badges {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}

.property-badge {
  background: var(--primary-color);
  color: white;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.property-badge.for-rent {
  background: #10b981;
}

.property-badge.for-sale {
  background: var(--primary-color);
}

/* Favorite Button */
.property-favorite {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.property-favorite:hover {
  background: white;
  transform: scale(1.1);
}

.property-favorite.active {
  background: #e91e63;
  color: white;
}

.property-favorite .fas {
  font-size: 14px;
}

/* Property Card Content */
.property-card-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (max-width: 767px) {
  .property-card-content {
    padding: var(--space-md);
    gap: var(--space-xs);
  }
}

.property-card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 767px) {
  .property-card-title {
    font-size: var(--text-base);
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

.property-card-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

@media (max-width: 767px) {
  .property-card-price {
    font-size: var(--text-lg);
  }
}

.property-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.property-card-features {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

@media (max-width: 767px) {
  .property-card-features {
    gap: var(--space-md);
    margin-top: var(--space-xs);
  }
}

.property-feature {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.property-feature i {
  color: var(--primary-color);
  font-size: 12px;
}

/* Property Card Actions */
.property-card-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-sm);
}

.property-card-actions .atlas-btn {
  flex: 1;
  min-height: 40px;
}

@media (max-width: 767px) {
  .property-card-actions .atlas-btn {
    min-height: 36px;
    font-size: var(--text-sm);
  }
}

/* ================================
   MOBILE PROPERTY FILTERS
   ================================ */

/* Filter Toggle for Mobile */
.mobile-filter-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-fixed);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 25px;
  padding: var(--space-sm) var(--space-lg);
  box-shadow: 0 4px 16px rgba(204, 0, 0, 0.3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

@media (max-width: 767px) {
  .mobile-filter-toggle {
    display: flex;
  }
  
  .property-filters {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: var(--z-modal);
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--space-lg);
  }
  
  .property-filters.atlas-active {
    transform: translateY(0);
  }
  
  .filters-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
  }
  
  .filter-header h3 {
    margin: 0;
    font-size: var(--text-lg);
  }
  
  .filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
  }
}

/* ================================
   MOBILE PROPERTY MODAL
   ================================ */

@media (max-width: 767px) {
  .property-modal-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  
  .property-modal-header {
    padding: var(--space-sm) var(--space-md);
    flex-shrink: 0;
  }
  
  .property-modal-title {
    font-size: var(--text-lg);
  }
  
  .property-modal-gallery {
    padding: 0;
    flex-shrink: 0;
  }
  
  .property-modal-main-img {
    height: 250px;
    border-radius: 0;
  }
  
  .property-modal-thumbnails {
    padding: var(--space-sm) var(--space-md);
  }
  
  .property-modal-body {
    flex: 1;
    overflow-y: auto;
    display: block;
    padding: var(--space-md);
  }
  
  .property-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    position: sticky;
    bottom: 0;
    background: white;
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
  }
  
  .property-modal-action-btn {
    min-height: var(--button-height);
  }
}

/* ================================
   MOBILE LOADING STATES
   ================================ */

/* Skeleton Loading for Mobile */
.property-card-skeleton {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  animation: pulse 2s infinite;
}

.property-card-skeleton .skeleton-image {
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.property-card-skeleton .skeleton-content {
  padding: var(--space-md);
}

.property-card-skeleton .skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  margin-bottom: var(--space-sm);
  border-radius: 6px;
}

.property-card-skeleton .skeleton-line.short {
  width: 60%;
}

.property-card-skeleton .skeleton-line.medium {
  width: 80%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* ================================
   MOBILE SEARCH & SORT
   ================================ */

/* Mobile Search Bar */
@media (max-width: 767px) {
  .mobile-search-container {
    position: sticky;
    top: var(--header-height);
    background: white;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    z-index: var(--z-sticky);
  }
  
  .mobile-search-input {
    width: 100%;
    min-height: var(--button-height);
    padding: var(--space-sm) var(--space-lg) var(--space-sm) var(--space-xl);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: var(--text-base);
    background: var(--bg-light);
    position: relative;
  }
  
  .mobile-search-input:focus {
    border-color: var(--primary-color);
    background: white;
  }
  
  .mobile-search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
  }
  
  .mobile-sort-toggle {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
  }
}

/* Mobile Sort Options */
.mobile-sort-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: var(--z-modal);
  padding: var(--space-lg);
}

.mobile-sort-drawer.atlas-active {
  transform: translateY(0);
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sort-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-light);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  width: 100%;
}

.sort-option:hover,
.sort-option.active {
  background: var(--primary-color);
  color: white;
}

.sort-option .fas {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sort-option.active .fas {
  opacity: 1;
}
