/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0d0f14;
  color: #f3f4f6;
  overflow-x: hidden;
  line-height: 1.5;
  height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  background-color: #090b0e;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* Header & Tabs */
.app-header {
  padding: 16px 16px 8px 16px;
  background: rgba(13, 15, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.search-bar-container {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#searchInput {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
}

#searchInput:focus {
  outline: none;
  border-color: #e5a93b;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(229, 169, 59, 0.15);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f3f4f6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.08);
}

#filterBtn:hover, #filterBtn.active {
  border-color: #e5a93b;
  color: #e5a93b;
  background: rgba(229, 169, 59, 0.05);
}

.nav-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 4px;
}

.tab-link {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.tab-link.active {
  background: rgba(255, 255, 255, 0.06);
  color: #e5a93b;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.badge {
  background: #e5a93b;
  color: #090b0e;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

/* Main Content & Grid */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media(min-width: 480px) {
  .catalog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Property Card Card */
.property-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.property-card:active {
  transform: scale(0.98);
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 65%; /* aspect-ratio 16:10 */
  background: #14171d;
  overflow: hidden;
}

.card-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.property-card:hover .card-image-wrapper img {
  transform: scale(1.05);
}

.card-category-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(13, 15, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-category-badge.rent {
  color: #3b82f6;
}

.card-category-badge.sale {
  color: #e5a93b;
}

.card-fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(13, 15, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.card-fav-btn svg {
  width: 16px;
  height: 16px;
}

.card-fav-btn:active {
  transform: scale(0.85);
}

.card-fav-btn.active {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.card-details {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-price {
  font-size: 18px;
  font-weight: 700;
  color: #e5a93b;
}

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 38px;
}

.card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #9ca3af;
}

.card-location svg {
  flex-shrink: 0;
}

.card-stats {
  display: flex;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 8px;
  margin-top: auto;
  font-size: 12px;
  color: #9ca3af;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  height: 60vh;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #e5e7eb;
}

.empty-state p {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
  max-width: 280px;
}

/* Drawers & Overlays */
.drawer, .modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  overflow: hidden;
}

.drawer-overlay, .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer.active .drawer-overlay,
.modal.active .modal-overlay {
  opacity: 1;
}

.drawer-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 85%;
  background: #0f1218;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer.active .drawer-content {
  transform: translateY(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 28px;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.range-inputs {
  display: flex;
  gap: 12px;
}

.range-inputs input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
}

/* Toggle Chips */
.toggle-chips {
  display: flex;
  gap: 8px;
  row-gap: 8px;
}

.toggle-chips .chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  padding: 10px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-chips .chip.active {
  background: rgba(229, 169, 59, 0.08);
  border-color: #e5a93b;
  color: #e5a93b;
}

/* Districts Multiple Choice */
.districts-list {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px;
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom Checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #e5e7eb;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  height: 20px;
  width: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: inline-block;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-label input:checked ~ .checkbox-custom {
  background: #e5a93b;
  border-color: #e5a93b;
}

.checkbox-custom:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #090b0e;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkbox-custom:after {
  display: block;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: #e5a93b;
  color: #090b0e;
}

.btn-primary:active {
  background: #c99330;
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.08);
}

.btn-block {
  width: 100%;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 12px;
}

.drawer-footer button {
  flex: 1;
}

/* Slide-in Full Screen Modal */
.modal-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0f14;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active .modal-content {
  transform: translateX(0);
}

.modal-header-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.modal-back-btn {
  background: rgba(13, 15, 20, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-back-btn:active {
  transform: scale(0.95);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}

.detail-gallery {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 Aspect Ratio */
  background: #14171d;
}

.detail-gallery img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-category-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: #e5a93b;
  color: #090b0e;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-meta-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-meta-top h1 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.detail-price {
  font-size: 24px;
  font-weight: 800;
  color: #e5a93b;
}

.detail-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #9ca3af;
}

.detail-chips {
  display: flex;
  gap: 12px;
}

.detail-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e5e7eb;
}

.detail-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.detail-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-section p {
  font-size: 14px;
  color: #d1d5db;
  line-height: 1.6;
}

.detail-agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px 16px;
}

.agent-avatar {
  background: rgba(229, 169, 59, 0.1);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.agent-info {
  display: flex;
  flex-direction: column;
}

.agent-title {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
}

.agent-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.modal-footer {
  padding: 16px 20px;
  background: #0f1218;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toast Notifications */
.toast {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(229, 169, 59, 0.95);
  color: #090b0e;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  z-index: 2000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Global utility classes */
.hidden {
  display: none !important;
}

/* Realtime Translation Bar */
.detail-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-section-header h3 {
  margin-bottom: 0 !important;
}

.translate-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2px;
  align-items: center;
}

.translate-btn {
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  color: #9ca3af;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.translate-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #e5a93b;
}

.translate-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 15, 20, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #e5a93b;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5a93b;
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 0.8s linear infinite;
}

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

/* Onboarding Screen & Blur Effect */
.main-interface {
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: filter 0.4s ease, brightness 0.4s ease;
}

.main-interface.blur-effect {
  filter: blur(12px) brightness(0.45);
  pointer-events: none;
}

.onboarding-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 1;
  transition: opacity 0.35s ease;
}

.onboarding-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.onboarding-card {
  background: rgba(15, 18, 24, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 24px 20px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.onboarding-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.onboarding-logo {
  font-size: 28px;
  width: 52px;
  height: 52px;
  background: rgba(229, 169, 59, 0.1);
  border: 1px solid rgba(229, 169, 59, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.onboarding-lang-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 2px;
  align-items: center;
}

.onboarding-lang-btn {
  background: transparent;
  border: none;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  color: #9ca3af;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s ease;
}

.onboarding-lang-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #e5a93b;
}

.onboarding-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #e5a93b;
}

.onboarding-subtitle {
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.4;
}

.onboarding-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  margin: 6px 0;
}

.onboarding-feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feature-icon {
  font-size: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: #f3f4f6;
}

.feature-text p {
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.3;
}

@keyframes scaleIn {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
