@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Variáveis do Sistema de Design (Luxury Palette) */
:root {
  --bg-main: #070a13;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --accent-gold: #d4af37;
  --accent-gold-hover: #f3cd44;
  --accent-blue: #3b82f6;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-glass: rgba(255, 255, 255, 0.08);
  --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.2);
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold);
}

/* Header */
header {
  border-bottom: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 10, 19, 0.85);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo span {
  color: var(--accent-gold);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent-gold);
}

/* Hero Section */
.hero {
  padding: 5rem 2rem 3rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInDown 0.8s ease-out;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

/* Filtros Avançados */
.filter-bar {
  max-width: 1000px;
  margin: 0 auto 4rem;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  box-shadow: var(--shadow-premium);
  animation: fadeInUp 0.8s ease-out;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.filter-group select, 
.filter-group input {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  outline: none;
  transition: var(--transition-smooth);
}

.filter-group select:focus, 
.filter-group input:focus {
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-gold);
}

.filter-btn {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8922e 100%);
  border: none;
  border-radius: 10px;
  color: #070a13;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-top: 1.3rem;
  height: 2.9rem;
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  background: linear-gradient(135deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
}

/* Catálogo de Imóveis */
.catalog-container {
  max-width: 1200px;
  margin: 0 auto 6rem;
  padding: 0 2rem;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.catalog-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

/* Card de Imóvel */
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.property-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8);
}

.property-image-wrapper {
  position: relative;
  height: 230px;
  overflow: hidden;
}

.property-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

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

.property-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.badge-featured {
  background: rgba(214, 175, 55, 0.9);
  color: #070a13;
}

.badge-type {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
  background: rgba(7, 10, 19, 0.75);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.property-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.property-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.property-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.property-location {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.property-details {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-item svg {
  color: var(--accent-gold);
  width: 16px;
  height: 16px;
}

.view-details-btn {
  display: block;
  text-align: center;
  padding: 0.85rem;
  background: rgba(31, 41, 55, 0.5);
  border-top: 1px solid var(--border-glass);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.view-details-btn:hover {
  background: var(--accent-gold);
  color: #070a13;
}

/* Chat Widget do Agente Virtual */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8922e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4), var(--shadow-premium);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.chat-trigger:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 30px rgba(212, 175, 55, 0.6);
}

.chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: #070a13;
}

.chat-badge-alert {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border: 3px solid var(--bg-main);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Chat Box */
.chat-box {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 580px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-premium);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
  backdrop-filter: blur(20px);
}

.chat-box.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.agent-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(214, 175, 55, 0.1);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-avatar svg {
  width: 22px;
  height: 22px;
  fill: var(--accent-gold);
}

.agent-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: #10b981;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
}

.agent-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.agent-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chat-close-btn:hover {
  color: var(--accent-gold);
  transform: scale(1.1);
}

/* Chat Mensagens */
.chat-messages {
  flex-grow: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.4;
  animation: slideInMessage 0.3s ease-out;
}

.message-agent {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-user {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8922e 100%);
  color: #070a13;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* Cards de Imóveis no Chat */
.chat-property-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
}

.chat-property-card {
  background: rgba(7, 10, 19, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem;
  transition: var(--transition-smooth);
}

.chat-property-card:hover {
  border-color: var(--accent-gold);
}

.chat-property-img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

.chat-property-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
  min-width: 0;
}

.chat-property-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-property-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin-top: 0.15rem;
}

.chat-property-link {
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.chat-property-link:hover {
  text-decoration: underline;
}

/* Input do Chat */
.chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 0.5rem;
  background: rgba(17, 24, 39, 0.9);
}

.chat-input-area input {
  flex-grow: 1;
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-smooth);
}

.chat-input-area input:focus {
  border-color: var(--accent-gold);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.chat-send-btn:hover {
  background: var(--accent-gold-hover);
  transform: translateY(-1px);
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #070a13;
}

/* Indicador de Digitação (Typing Indicator) */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem 1rem;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  align-items: center;
  height: 32px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Página de Detalhes do Imóvel (imovel.php) */
.details-container {
  max-width: 1100px;
  margin: 2rem auto 6rem;
  padding: 0 2rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 2rem;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  color: var(--accent-gold);
  transform: translateX(-4px);
}

.details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

.gallery-container {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  box-shadow: var(--shadow-premium);
  margin-bottom: 2rem;
}

.main-image-wrapper {
  height: 480px;
  overflow: hidden;
  position: relative;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbs-container {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.5);
  border-top: 1px solid var(--border-glass);
}

.thumb-img {
  width: 90px;
  height: 65px;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition-smooth);
  opacity: 0.6;
}

.thumb-img.active,
.thumb-img:hover {
  border-color: var(--accent-gold);
  opacity: 1;
}

.property-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.5rem;
}

.property-info-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.property-info-header .price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.spec-box {
  text-align: center;
}

.spec-box-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.spec-box-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.description-box h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.description-box p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Sidebar de Contato */
.contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 90px;
  height: fit-content;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-premium);
}

.contact-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--accent-gold);
}

.agent-profile-large {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.agent-avatar-large {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(214, 175, 55, 0.1);
  border: 2px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-avatar-large svg {
  width: 32px;
  height: 32px;
  fill: var(--accent-gold);
}

.agent-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.agent-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.share-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  margin-bottom: 1rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp svg {
  fill: #ffffff;
  width: 20px;
  height: 20px;
}

.btn-share {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
}

.btn-share:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

/* Animações Keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes typingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Responsividade */
@media (max-width: 900px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
  .contact-sidebar {
    position: static;
  }
  .specs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.25rem;
  }
  .header-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .chat-box {
    width: calc(100vw - 2rem);
    height: 500px;
    right: -1rem;
  }
}
