/* ==================== VARIÁVEIS E CONFIGURAÇÕES GLOBAIS ==================== */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary-color: #1e293b;
  --success-color: #16a34a;
  --warning-color: #f59e0b;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  --light-bg: #f8fafc;
  --dark-bg: #0f172a;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* ==================== RESET E BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: #fff;
}

/* ==================== NAVBAR ==================== */
.navbar {
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar-brand {
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark) !important;
  padding: 0.5rem 1rem !important;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
  min-height: 100vh;
  padding-top: 100px;
  background: linear-gradient(135deg, var(--light-bg) 0%, #fff 100%);
}

.hero-image {
  transform: perspective(1000px) rotateY(-5deg);
  transition: var(--transition);
}

.hero-image:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.search-box-hero {
  max-width: 600px;
}

/* ==================== STATS SECTION ==================== */
.stat-item {
  padding: 1rem;
}

/* ==================== PROPERTY CARDS ==================== */
.property-card {
  transition: var(--transition);
  border-radius: 1rem;
  overflow: hidden;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.property-card .card-img-top {
  height: 220px;
  object-fit: cover;
  transition: var(--transition);
}

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

.property-card .position-relative {
  overflow: hidden;
}

.favorite-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.favorite-btn:hover {
  background-color: var(--danger-color);
  color: #fff;
}

.favorite-btn.active {
  background-color: var(--danger-color);
  color: #fff;
}

.favorite-btn.active i {
  fill: currentColor;
}

/* ==================== CATEGORY CARDS ==================== */
.category-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.category-hover {
  transition: var(--transition);
}

.category-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow);
}

.category-card h5 {
  color: var(--text-dark);
}

/* ==================== PRICING CARDS ==================== */
.pricing-card {
  border-radius: 1rem;
  transition: var(--transition);
}

.pricing-card:hover {
  transform: translateY(-5px);
}

.popular-plan {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
}

/* ==================== TESTIMONIALS ==================== */
.avatar {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* ==================== FILTER SIDEBAR ==================== */
.filter-sidebar {
  position: sticky;
  top: 100px;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

/* ==================== PROPERTY DETAIL PAGE ==================== */
.property-gallery {
  position: relative;
}

.property-gallery .main-image {
  height: 500px;
  object-fit: cover;
  border-radius: 1rem;
}

.property-gallery .thumbnail {
  height: 100px;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: var(--transition);
}

.property-gallery .thumbnail:hover,
.property-gallery .thumbnail.active {
  opacity: 1;
  border: 2px solid var(--primary-color);
}

.property-info-card {
  position: sticky;
  top: 100px;
}

/* ==================== DASHBOARD STYLES ==================== */
.dashboard-sidebar {
  min-height: calc(100vh - 72px);
  background: var(--dark-bg);
  padding-top: 2rem;
}

.dashboard-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.7) !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.dashboard-sidebar .nav-link:hover,
.dashboard-sidebar .nav-link.active {
  background: var(--primary-color);
  color: #fff !important;
}

.dashboard-sidebar .nav-link i {
  width: 24px;
}

.dashboard-content {
  padding: 2rem;
  background: var(--light-bg);
  min-height: calc(100vh - 72px);
}

.stat-card {
  border-radius: 1rem;
  border: none;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow);
}

.stat-card .stat-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  font-size: 1.5rem;
}

/* ==================== DATA TABLE ==================== */
.data-table {
  border-radius: 1rem;
  overflow: hidden;
}

.data-table th {
  background: var(--light-bg);
  font-weight: 600;
  border: none;
}

.data-table td {
  vertical-align: middle;
  border-color: var(--border-color);
}

.property-thumb {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* ==================== SUBSCRIPTION CARDS ==================== */
.subscription-card {
  border-radius: 1rem;
}

.subscription-card.current-plan {
  border: 2px solid var(--primary-color);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 20px;
}

/* ==================== PAYMENT CARDS ==================== */
.payment-card {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--dark-bg) 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.payment-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.card-brand {
  font-size: 2rem;
}

/* ==================== FORM STYLES ==================== */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-label {
  font-weight: 500;
  color: var(--text-dark);
}

/* ==================== MODAL STYLES ==================== */
.modal-content {
  border-radius: 1rem;
  border: none;
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
}

/* ==================== PAGINATION ==================== */
.pagination .page-link {
  border: none;
  color: var(--text-dark);
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.5rem;
  transition: var(--transition);
}

.pagination .page-link:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.pagination .page-item.active .page-link {
  background: var(--primary-color);
  color: #fff;
}

/* ==================== BADGES ==================== */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
}

.bg-primary-subtle {
  background-color: var(--primary-light) !important;
}

/* ==================== BUTTONS ==================== */
.btn {
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  transition: var(--transition);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ==================== ALERTS ==================== */
.alert {
  border-radius: 0.75rem;
  border: none;
}

/* ==================== PROGRESS BAR ==================== */
.progress {
  height: 8px;
  border-radius: 1rem;
  background-color: var(--border-color);
}

.progress-bar {
  border-radius: 1rem;
}

/* ==================== SEARCH RESULTS ==================== */
.search-results-header {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.view-toggle .btn {
  padding: 0.5rem 0.75rem;
}

.view-toggle .btn.active {
  background: var(--primary-color);
  color: #fff;
}

/* ==================== LIST VIEW ==================== */
.property-list-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 1rem;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.property-list-item:hover {
  box-shadow: var(--card-shadow);
}

.property-list-item img {
  width: 280px;
  height: 180px;
  object-fit: cover;
  border-radius: 0.75rem;
}

/* ==================== RANGE SLIDER ==================== */
.range-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991.98px) {
  .hero-section {
    padding-top: 80px;
    text-align: center;
  }

  .search-box-hero {
    max-width: 100%;
  }

  .dashboard-sidebar {
    min-height: auto;
    padding: 1rem;
  }

  .dashboard-content {
    padding: 1rem;
  }

  .property-list-item {
    flex-direction: column;
  }

  .property-list-item img {
    width: 100%;
    height: 200px;
  }
}

@media (max-width: 767.98px) {
  .display-4 {
    font-size: 2rem;
  }

  .display-5 {
    font-size: 1.75rem;
  }

  .display-6 {
    font-size: 1.5rem;
  }

  .stat-item h2 {
    font-size: 1.5rem;
  }

  .popular-plan {
    transform: none;
  }
}

/* ==================== UTILITIES ==================== */
.rounded-4 {
  border-radius: 1rem !important;
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}

.text-balance {
  text-wrap: balance;
}

/* ==================== LOADING SKELETON ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--light-bg) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 1100;
}

.toast {
  border-radius: 0.75rem;
  border: none;
  box-shadow: var(--card-shadow);
}

/* Adicionando estilos para o sistema de mensagens */

/* ==================== MESSAGES SYSTEM ==================== */

/* Lista de Conversas */
.conversations-list {
  display: flex;
  flex-direction: column;
}

.conversations-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.conversations-scroll::-webkit-scrollbar {
  width: 6px;
}

.conversations-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.conversations-scroll::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.conversation-item {
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.conversation-item:hover {
  background-color: var(--light-bg);
}

.conversation-item.active {
  background-color: var(--primary-light);
  border-left-color: var(--primary-color);
}

.conversation-item .avatar {
  flex-shrink: 0;
}

.conversation-item .min-width-0 {
  min-width: 0;
}

/* Área do Chat */
.chat-area {
  display: flex;
  flex-direction: column;
}

.chat-header {
  flex-shrink: 0;
}

.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 3px;
}

.chat-input {
  flex-shrink: 0;
}

/* Bolhas de Mensagem */
.message-wrapper {
  display: flex;
}

.message-wrapper.sent {
  justify-content: flex-end;
}

.message-wrapper.received {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 70%;
  word-wrap: break-word;
}

.message-bubble p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

/* Respostas Rápidas */
.quick-reply {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  transition: var(--transition);
}

.quick-reply:hover {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* Status Online */
.online-indicator {
  width: 10px;
  height: 10px;
  background-color: var(--success-color);
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  right: 0;
  border: 2px solid #fff;
}

/* Input de Mensagem */
.chat-input textarea {
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border-radius: 1.25rem;
  padding: 0.625rem 1rem;
}

.chat-input textarea:focus {
  box-shadow: none;
  border-color: var(--primary-color);
}

/* Botões do Chat */
.chat-input .btn-light {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-input .btn-primary {
  border-radius: 1.25rem;
}

/* Mensagens do Cliente */
.client-messages .message-sent {
  background: var(--primary-color);
  color: #fff;
  border-radius: 1rem 1rem 0 1rem;
}

.client-messages .message-received {
  background: #fff;
  border-radius: 1rem 1rem 1rem 0;
  box-shadow: var(--card-shadow);
}

/* ==================== MESSAGES RESPONSIVE ==================== */
@media (max-width: 991.98px) {
  .messages-container {
    flex-direction: column;
  }

  .conversations-list {
    width: 100% !important;
    min-width: 100% !important;
    height: auto !important;
    max-height: 300px;
  }

  .conversations-scroll {
    height: auto !important;
    max-height: 200px;
  }

  .chat-area {
    height: calc(100vh - 356px) !important;
  }
}

@media (max-width: 767.98px) {
  .message-bubble {
    max-width: 85%;
  }

  .conversations-list {
    max-height: 250px;
  }

  .chat-header .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* ==================== ACCOUNT PAGE STYLES ==================== */
.account-sidebar .nav-link {
  color: var(--text-dark);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: var(--transition);
}

.account-sidebar .nav-link:hover,
.account-sidebar .nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary-color) !important;
}

.account-sidebar .nav-link i {
  width: 24px;
}

/* ==================== NOTIFICATION BADGE ==================== */
.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 3rem;
}

.empty-state i {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
