:root {
  --primary: #20262F;
  --primary-light: #2B333F;
  --black: #000000;
  --accent: #4A5568;
  --accent-light: #718096;
  --white: #FFFFFF;
  --light-bg: #FAFAFA;
  --gray: #6B7280;
  --gray-light: #E5E7EB;
  --text-dark: #20262F;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
  font-weight: 600;
}

.header {
  background: var(--primary);
  padding: 16px 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 24px;
  font-weight: 600;
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
}

.logo img {
  height: 22px;
  width: auto;
}

.logo-icon {
  color: var(--accent);
  font-size: 28px;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--gray-light);
}

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 160px 20px 100px;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero p {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 32px;
  white-space: nowrap;
}

.cta-button {
  background: var(--black);
  color: var(--white);
  border: none;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.cta-button:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stats {
  background: var(--white);
  padding: 60px 20px;
  border-bottom: 1px solid var(--gray-light);
}

.stats .container {
  display: flex;
  justify-content: center;
  gap: 80px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: var(--gray);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.properties-section {
  padding: 80px 20px;
  background: var(--light-bg);
}

.properties-section h2 {
  text-align: center;
  font-size: 36px;
  margin-bottom: 40px;
  color: var(--primary);
}

.filters {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filters select {
  padding: 12px 20px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  cursor: pointer;
  min-width: 160px;
}

.filters select:focus {
  outline: none;
  border-color: var(--accent);
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.property-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.property-image {
  height: 200px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 48px;
}

.property-info {
  padding: 20px;
}

.property-brand {
  font-size: 12px;
  color: var(--gray);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.property-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
}

.property-location {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.property-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--gray-light);
}

.property-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.property-status.completed {
  background: #D1FAE5;
  color: #065F46;
}

.property-status.under-construction {
  background: #FEF3C7;
  color: #92400E;
}

.property-status.announced {
  background: #DBEAFE;
  color: #1E40AF;
}

.property-units {
  font-size: 13px;
  color: var(--gray);
}

.load-more {
  display: block;
  margin: 40px auto 0;
  padding: 14px 32px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.load-more:hover {
  background: var(--primary-light);
}

.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--gray);
}

.about-section {
  padding: 80px 20px;
  background: var(--white);
}

.about-section h2 {
  text-align: center;
  font-size: 36px;
  margin-bottom: 24px;
  color: var(--primary);
}

.about-section p {
  max-width: 700px;
  margin: 0 auto 16px;
  text-align: center;
  color: var(--gray);
}

.contact-section {
  padding: 80px 20px;
  background: var(--primary);
  color: var(--white);
  text-align: center;
}

.contact-section h2 {
  font-size: 36px;
  margin-bottom: 16px;
}

.contact-section p {
  opacity: 0.9;
  margin-bottom: 24px;
}

.footer {
  background: var(--primary-light);
  color: var(--white);
  padding: 40px 20px;
  text-align: center;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer p {
  opacity: 0.8;
  margin-bottom: 8px;
}

.chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  overflow: visible;
}

.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--black);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: var(--primary);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
  color: var(--white);
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 520px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: var(--primary);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-header-logo {
  height: 18px;
  width: auto;
}

.chat-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.chat-subtitle {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message.user .message-content {
  background: var(--primary);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--light-bg);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}

/* Formatted message content styles */
.message-content p,
.message-content .chat-paragraph {
  margin: 0 0 12px 0;
  line-height: 1.6;
}

.message-content p:last-child,
.message-content .chat-paragraph:last-child {
  margin-bottom: 0;
}

.message-content br {
  display: block;
  margin: 8px 0;
  content: "";
}

.message-content strong {
  font-weight: 600;
  color: var(--primary);
}

.message.user .message-content strong {
  color: var(--white);
}

.message-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.message-content a:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.message.user .message-content a {
  color: var(--accent-light);
}

.message-content ul.property-list {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.message-content ul.property-list li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.message-content ul.property-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.message-content ul.property-list li:last-child {
  margin-bottom: 0;
}

.message.streaming .message-content::after {
  content: '▋';
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.chat-input-container {
  padding: 16px;
  border-top: 1px solid var(--gray-light);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-shrink: 0;
  min-height: 76px;
}

#chat-input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--gray-light);
  border-radius: 24px;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  max-height: 100px;
  display: flex;
  align-items: flex-start;
  min-height: 56px;
  height: 56px;
  font-family: inherit;
  box-sizing: border-box;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  align-items: center;
}

#chat-input::-webkit-scrollbar {
  display: none;
}

#chat-input.has-content {
  overflow-y: auto;
  scrollbar-width: thin;
  -ms-overflow-style: auto;
}

#chat-input.has-content::-webkit-scrollbar {
  display: block;
  width: 6px;
}

#chat-input.has-content::-webkit-scrollbar-thumb {
  background: var(--gray-light);
  border-radius: 3px;
}

#chat-input::placeholder {
  color: var(--gray);
  line-height: 20px;
  opacity: 1;
  position: relative;
  top: 0;
}

#chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.chat-disclaimer {
  padding: 8px 16px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.7;
  border-top: 1px solid var(--gray-light);
  background: var(--light-bg);
}

.send-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-button:hover {
  background: var(--accent-light);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.send-button svg {
  width: 20px;
  height: 20px;
  color: var(--white);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--light-bg);
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.modal-close:hover {
  background: var(--gray-light);
}

#modal-body {
  padding: 24px;
}

.modal-header {
  background: var(--primary);
  color: var(--white);
  padding: 24px;
  margin: -24px -24px 24px;
  border-radius: 16px 16px 0 0;
}

.modal-brand {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 24px;
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
  margin-bottom: 8px;
}

.modal-location {
  opacity: 0.9;
  font-size: 14px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-size: 16px;
  color: var(--primary);
  margin-bottom: 12px;
  font-family: 'Outfit', Arial, Helvetica, sans-serif;
}

.modal-detail {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-light);
  font-size: 14px;
}

.modal-detail-label {
  color: var(--gray);
}

.modal-detail-value {
  font-weight: 500;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions button {
  flex: 1;
  padding: 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-actions .primary-btn {
  background: var(--accent);
  color: var(--primary);
  border: none;
}

.modal-actions .primary-btn:hover {
  background: var(--accent-light);
}

.modal-actions .secondary-btn {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.modal-actions .secondary-btn:hover {
  background: var(--primary);
  color: var(--white);
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }
  
  .stats .container {
    flex-direction: column;
    gap: 32px;
  }
  
  .nav {
    display: none;
  }
  
  .properties-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-window {
    width: calc(100vw - 48px);
    right: -12px;
    bottom: 70px;
    height: 450px;
  }
  
  .filters {
    flex-direction: column;
    align-items: center;
  }
  
  .filters select {
    width: 100%;
    max-width: 300px;
  }
}

/* Login Gate Styles */
.login-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background: var(--light-bg);
}

.login-gate-content {
  width: 100%;
  max-width: 300px;
}

.login-gate-content h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 8px;
  text-align: center;
}

.login-gate-content > p {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-bottom: 20px;
}

.login-gate .form-group {
  margin-bottom: 16px;
}

.login-gate .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-gate .form-group input[type="text"],
.login-gate .form-group input[type="email"],
.login-gate .form-group input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-gate .form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.login-gate .checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.login-gate .checkbox-group input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.login-gate .checkbox-group label {
  margin-bottom: 0;
  font-size: 12px;
  color: var(--gray);
}

.login-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.login-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.login-submit-btn:hover {
  background: var(--accent-light);
}

.login-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.chat-interface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
