* { box-sizing: border-box; }

body {
  font-family: 'Sarabun', sans-serif;
  background-color: #f5f7fa;
  margin: 0;
  padding: 0;
  color: #2c3e50;
}

/* ===== NAVBAR ===== */
nav {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  min-height: 80px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav img {
  height: 50px;
  object-fit: contain;
}

nav a {
  font-size: 15px;
  font-weight: 600;
  height: 100%;
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  color: #2c3e50;
  transition: color 0.25s;
}

nav a:hover {
  color: #0066cc;
}

nav .flex-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}

.auth-menu {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #f0f4f8;
  border-radius: 20px;
}

.auth-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0066cc;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.btn-logout {
  background: #ef4444;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s;
  font-family: 'Sarabun', sans-serif;
}

.btn-logout:hover {
  background: #dc2626;
}

.btn-login {
  background: #0066cc;
  color: white;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-family: 'Sarabun', sans-serif;
  transition: all 0.25s;
}

.btn-login:hover {
  background: #0052a3;
}

/* ===== HERO SECTION ===== */
.hero-section {
  background: url('https://images.unsplash.com/photo-1568605114967-8130f3a36994?auto=format&fit=crop&w=1600') center/cover;
  height: 520px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 60px;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,0.85) 0%, rgba(30,58,138,0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  animation: fadeInDown 0.8s ease-out;
  max-width: 800px;
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 56px;
  margin: 0 0 16px 0;
  font-weight: 800;
  letter-spacing: -1px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
  line-height: 1.2;
}

.hero-content p {
  font-size: 20px;
  margin: 0;
  font-weight: 400;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

/* ===== FILTER SECTION ===== */
.filter-section {
  max-width: 1200px;
  margin: -80px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.glass-filter {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,1);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}

.filter-box select,
.filter-box input {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: 'Sarabun', sans-serif;
  transition: all 0.3s;
  width: 100%;
  background: #f8fafc;
  color: #1e293b;
}

.filter-box select:focus,
.filter-box input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.filter-box button {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.filter-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* ===== MAIN CONTENT ===== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

main h2 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 50px 0 40px;
  color: #2c3e50;
}

/* ===== PROPERTY LIST ===== */
#property-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.property-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.property-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.property-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 240px;
}

.property-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

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

.badge-status {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  backdrop-filter: blur(4px);
}

.badge-sell {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.badge-rent {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.property-img-count {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.property-info {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prop-type-tag {
  color: #3b82f6;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.property-info h3 {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-info .location {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.property-info .price {
  color: #0f172a;
  font-size: 26px;
  font-weight: 800;
  margin: 8px 0 16px 0;
  letter-spacing: -0.5px;
}

.price span {
  font-size: 14px;
  color: #64748b;
  font-weight: 400;
}

.no-result {
  text-align: center;
  color: #e74c3c;
  font-weight: 600;
  font-size: 16px;
  margin: 60px 0;
  grid-column: 1 / -1;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s;
  padding: 0;
}

.modal-close:hover {
  color: #333;
}

.modal-content h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
}

.modal-content .location-info {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===== IMAGE SLIDER ===== */
.image-slider {
  position: relative;
  margin-bottom: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.slider-main {
  position: relative;
  width: 100%;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.slider-main img.active {
  display: block;
}

.slider-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.slider-nav button {
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 10px 14px;
  font-size: 20px;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.25s;
  width: auto;
  height: auto;
}

.slider-nav button:hover {
  background: rgba(0,0,0,0.8);
}

/* ===== THUMBNAIL ===== */
.thumbnail-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px;
  background: #f9f9f9;
}

.thumbnail-container img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.25s;
  border: 2px solid transparent;
  flex-shrink: 0;
}

.thumbnail-container img:hover {
  opacity: 0.9;
}

.thumbnail-container img.active {
  opacity: 1;
  border-color: #0066cc;
}

/* ===== PROPERTY DETAILS ===== */
.property-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.8;
}

.property-details div {
  padding: 12px;
  background: #f5f7fa;
  border-radius: 8px;
  border-left: 3px solid #0066cc;
}

.property-details strong {
  color: #2c3e50;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.action-buttons button {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  transition: all 0.25s;
}

.btn-buy {
  background: #10b981;
  color: white;
}

.btn-buy:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-rent {
  background: #f59e0b;
  color: white;
}

.btn-rent:hover {
  background: #d97706;
  transform: translateY(-2px);
}

hr {
  margin: 24px 0;
  border: none;
  border-top: 1px solid #e8ecf1;
}

/* ===== ACTION MODAL ===== */
.action-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.action-modal.show {
  display: flex;
}

.action-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  padding: 32px;
  position: relative;
  margin: auto;
}

.action-modal-content h3 {
  margin: 0 0 20px 0;
  font-size: 22px;
  font-weight: 700;
  color: #2c3e50;
}

.action-modal-content input,
.action-modal-content textarea {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  transition: all 0.25s;
}

.action-modal-content input:focus,
.action-modal-content textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.action-modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.action-modal-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  transition: all 0.25s;
}

.btn-confirm {
  background: #10b981;
  color: white;
}

.btn-confirm:hover {
  background: #059669;
  transform: translateY(-2px);
}

.btn-cancel {
  background: #ef4444;
  color: white;
}

.btn-cancel:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ===== FLOATING BUTTONS ===== */
.line-float {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #06C755;
  color: white;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: floatBtn 2s infinite;
  transition: all 0.3s;
}

.call-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e53935;
  color: white;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  z-index: 9999;
  animation: floatBtn 2s infinite 0.3s;
  transition: all 0.3s;
}

.line-float:hover,
.call-float:hover {
  transform: scale(1.15);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

@keyframes floatBtn {
  0% { transform: translateY(0); }
  25% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

/* ===== AI CHAT WIDGET ===== */
.chat-toggle-ai {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  z-index: 10000;
  transition: transform 0.3s;
  border: none;
}

.chat-toggle-ai:hover {
  transform: scale(1.1);
}

.chat-container-ai {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 9999;
  font-family: 'Sarabun', sans-serif;
  animation: slideUp 0.3s ease-out;
}

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

.chat-box-ai {
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.header-ai {
  background: #2563eb;
  color: white;
  padding: 15px;
  font-size: 16px;
  font-weight: bold;
}

.messages-ai {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
}

.message-ai {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.5;
}

.user-ai {
  background: #2563eb;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.bot-ai {
  background: white;
  color: #1f2937;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.loading-ai {
  background: transparent;
  border: none;
  box-shadow: none;
  align-self: flex-start;
  font-style: italic;
  color: #6b7280;
  padding: 5px 0;
}

.input-area-ai {
  display: flex;
  background: white;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  gap: 10px;
  align-items: center;
}

.input-area-ai input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  font-family: 'Sarabun', sans-serif;
  width: 100%;
}

.input-area-ai input:focus {
  border-color: #2563eb;
}

.input-area-ai button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 16px;
  flex-shrink: 0;
}

.input-area-ai button:hover {
  background: #1d4ed8;
}

/* ===== PREMIUM CHAT & BUTTON STYLES ===== */
.card-action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-detail-pro, .btn-chat-pro {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-detail-pro {
  background: #f0f4f8;
  color: #0066cc;
}

.btn-detail-pro:hover {
  background: #e1e8f0;
  color: #0052a3;
  transform: translateY(-2px);
}

.btn-chat-pro {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-chat-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Modal Pro */
.chat-modal-pro {
  backdrop-filter: blur(8px);
}

.chat-content-pro {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 24px 48px rgba(0,0,0,0.2) !important;
  display: flex;
  flex-direction: column;
  max-width: 450px !important;
  height: 600px;
  max-height: 90vh;
}

.chat-header-pro {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #1e293b;
  border-radius: 50%;
}

.chat-header-pro h2 {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: white !important;
}

.chat-subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: #94a3b8;
}

.modal-close-pro {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-pro:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

.messages-container-pro {
  flex: 1;
  background: #f8fafc !important;
  padding: 24px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  height: auto !important;
  scroll-behavior: smooth;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.message-item {
  margin-bottom: 16px;
  display: flex;
  word-wrap: break-word;
}

.message-item.own {
  justify-content: flex-end;
}

.message-bubble {
  padding: 12px 16px !important;
  font-size: 15px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  animation: slideInUp 0.3s ease forwards;
  max-width: 75%;
  line-height: 1.5;
}

.message-bubble.own {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: white;
  border-bottom-right-radius: 4px !important;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
  border-bottom-left-radius: 16px !important;
}

.message-bubble.other {
  background: white !important;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px !important;
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
  border-bottom-right-radius: 16px !important;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 6px;
  display: block;
}

.message-bubble.own .message-time {
  color: #e2e8f0;
}

.message-bubble.other .message-time {
  color: #94a3b8;
}

.chat-input-area-pro {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-area-pro input[type="text"] {
  flex: 1;
  padding: 14px 20px;
  background: #f1f5f9;
  border: 1px solid transparent;
  border-radius: 24px;
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  transition: all 0.3s;
}

.chat-input-area-pro input[type="text"]:focus {
  outline: none;
  background: white;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.btn-image-pro {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-image-pro:hover {
  color: #3b82f6;
  background: #f1f5f9;
}

.btn-send-pro {
  background: #3b82f6;
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-send-pro:hover {
  background: #2563eb;
  transform: scale(1.05);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  nav {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 12px 16px;
  }

  nav .flex-nav {
    width: 100%;
    margin-left: 0;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  nav a { font-size: 14px; }

  .hero-section {
    height: 300px;
  }

  .hero-section h1 {
    font-size: 32px;
  }

  .filter-section {
    margin: -30px auto 40px;
  }

  .filter-box {
    padding: 20px;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  #property-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  main {
    padding: 0 16px 40px;
  }

  main h2 {
    font-size: 26px;
  }

  .property-details {
    grid-template-columns: 1fr;
  }

  .chat-container-ai {
    left: 10px;
    bottom: 90px;
    right: 10px;
  }

  .chat-box-ai {
    width: 100%;
    height: 60vh;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 10px 12px;
  }

  nav img { height: 42px; }
  nav a { font-size: 12px; }

  .hero-section {
    height: 240px;
  }

  .hero-section h1 {
    font-size: 24px;
  }

  .hero-section p {
    font-size: 14px;
  }

  .filter-box {
    padding: 16px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  #property-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .property-img-wrapper {
    height: 160px;
  }

  .property-info {
    padding: 16px;
  }

  .property-info h3 {
    font-size: 16px;
  }

  .property-info .price {
    font-size: 18px;
  }

  main h2 {
    font-size: 22px;
    margin: 40px 0 30px;
  }

  .modal-content {
    padding: 20px;
  }

  .modal-content h2 {
    font-size: 22px;
  }

  .slider-main {
    height: 200px;
  }

  .action-modal-content {
    padding: 20px;
  }

  .action-modal-content h3 {
    font-size: 18px;
  }

  .line-float, .call-float {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .chat-toggle-ai {
    width: 52px;
    height: 52px;
    font-size: 28px;
  }

  .chat-container-ai {
    left: 10px;
    bottom: 80px;
    right: 10px;
  }

  .chat-box-ai {
    width: 100%;
    height: 55vh;
  }
}
/* ===== AI INVESTMENT ANALYSIS ===== */
.btn-ai-analyze {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin-bottom: 12px;
  width: 100%;
}

.btn-ai-analyze:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.45);
  filter: brightness(1.1);
}

.glass-modal {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.analysis-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.analysis-header h2 {
  margin: 0;
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 32px !important;
}

.analysis-header .subtitle {
  color: #64748b;
  margin-top: 8px;
  font-size: 16px;
}

.analysis-body {
  min-height: 300px;
  position: relative;
}

.analysis-content {
  color: #334155;
  font-size: 16px;
  animation: fadeIn 0.5s ease-out;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.sparkle-loader {
  font-size: 48px;
  margin-bottom: 20px;
  animation: sparkleRotate 2s infinite linear;
}

@keyframes sparkleRotate {
  0% { transform: rotate(0) scale(1); filter: hue-rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.2); filter: hue-rotate(180deg); }
  100% { transform: rotate(360deg) scale(1); filter: hue-rotate(360deg); }
}

.error-state .btn-retry {
  transition: all 0.3s;
}

.error-state .btn-retry:hover {
  background: #2563eb !important;
  transform: scale(1.05);
}

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