/* ================= ROOT & RESET ================= */

@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700&display=swap");

:root {
  --color-border-soft: #99c9e6;
  --color-bg-table-head: #f9fafd;
  --text-dark-muted: #5a5a5a;

  --focus-ring: rgba(11, 60, 193, 0.08);
  --sidebar-active-bg: rgba(11, 60, 193, 0.08);

  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.2);
}

body {
  font-family:
    "Nunito Sans",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background-color: #e8edf4;
  overflow-x: hidden;
}

html,
.d-flex,
.horizontal-scroll {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
.d-flex::-webkit-scrollbar,
.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

a {
  cursor: pointer;
}

/* ================= HERO ================= */

.hero {
  min-height: clamp(250px, 40vh, 500px);
  display: flex;
  align-items: center;
  background-color: rgb(10, 48, 145);
}

/* ================= TYPOGRAPHY ================= */

h3,
h4 {
  color: var(--bs-primary);
}

.float-end {
  font-size: 1rem;
  font-weight: 500;
}

.float-start {
  font-size: 0.938rem;
}

/* ================= NAVBAR ================= */

.navbar {
  box-shadow: inset 0 -0.7px 0 rgba(11, 60, 193, 0.06);
}

.nav-link {
  font-weight: 500;
}

.navbar .nav-link:hover,
.navbar .nav-link.active,
.navbar .nav-link:focus-visible {
  background-color: var(--sidebar-active-bg);
  border-radius: 0.3rem;
  outline: none;
}

.logo {
  width: 80px;
  height: 40px;
}

/* ================= BUTTONS ================= */

.btn-link {
  border-radius: 6px;
  text-decoration: none;
  box-shadow: none;
  font-size: 0.969rem;
  background-color: rgba(11, 60, 193, 0.08);
}

.flex-shrink-0 {
  padding: 0.5rem 1rem;
}

.btn-link:is(:hover, :active, :focus, :focus-visible) {
  background-color: rgba(11, 60, 193, 0.08);
  box-shadow: none;
}

.btn-primary {
  color: var(--bs-white);
}

/* ================= FORMS ================= */

.asteriskField {
  display: none;
}

.form-check-input {
  width: 20px;
}

.select2 {
  width: 100% !important;
}

.form-text {
  color: var(--bs-primary) !important;
}

.select2-selection__rendered {
  font-weight: 500;
  font-size: 0.9rem;
}

.textarea {
  height: 6.25rem !important;
}

textarea::-webkit-scrollbar {
  display: none;
}

.form-group {
  margin-bottom: 0.8rem;
}

/* ================= MEDIA / CARDS ================= */

.thumbnail-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.thumbnail-scroll {
  flex-wrap: nowrap;
}

.thumbnail-scroll::-webkit-scrollbar {
  height: 6px;
}

.thumbnail-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.thumbnail-img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.8;
  transition: 0.3s ease;
}

.thumbnail-img:hover {
  opacity: 1;
  transform: scale(1.05);
}

.dashboard {
  display: none;
}

.title-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.specs-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.spec-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: start;
  column-gap: 20px;
}

.spec-value .text-success.fw-semibold.fs-2 {
  word-break: break-word;
}

.carousel-counter {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 4px 10px;
  font-size: 14px;
  border-radius: 20px;
  font-weight: 600;
  backdrop-filter: blur(3px);
  z-index: 10;
}

.card,
.list-group,
.dashboard-card,
.shadow,
.house-card {
  box-shadow:
    0 4px 10px rgba(30, 60, 90, 0.05),
    0 2px 4px rgba(30, 60, 90, 0.04);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

.house-card {
  border-radius: 0.875rem;
}

.house-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}

.house-card img,
.property-carousel img {
  object-fit: cover;
}

.house-card img {
  width: 100%;
  aspect-ratio: 5/3;
  filter: saturate(1.15) contrast(1.05) brightness(1.02);
}

.property-carousel img {
  aspect-ratio: 4/3;
  filter: saturate(1.18) contrast(1.06) brightness(1.03);
}

.listing-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.horizontal-scroll {
  overflow-x: auto;
  scroll-behavior: smooth;
}

.house-item {
  min-width: 280px;
  max-width: 280px;
  flex: 0 0 auto;
}

/* ================= RESPONSIVE CARD ================= */

.mycard {
  width: 100% !important;
}

@media (min-width: 768px) {
  .mycard {
    width: 97% !important;
  }
}

@media (min-width: 1200px) {
  .mycard {
    width: 55% !important;
  }
}

/* ================= TABLES ================= */
table tbody td {
  vertical-align: middle !important;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.919rem;
  font-weight: 600 !important;
  background: var(--color-bg-table-head) !important;
  border-bottom: 0.039rem solid var(--color-border-soft);
}

.pagination {
  margin-left: 10px;
}

table td {
  cursor: pointer;
  font-size: 0.919rem;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

table td .dropdown-toggle {
  font-size: 0.9rem !important;
}

.table-container {
  overflow: hidden;
  overflow-y: auto;
  height: 75vh;
  max-height: 95vh;
  border: 1.1px solid rgba(11, 60, 193, 0.14);
  border-radius: 0.875rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.table-container::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.table-success,
.table-danger,
.table-primary {
  border-radius: 0.5rem;
  padding: 0.2rem;
  color: var(--bs-dark);
}

.table-success {
  background: #d1f0db;
}

.table-danger {
  background: #fdeaea;
}

.table-primary {
  background: #dbe6ff;
}

@media (min-width: 768px) {
  .table-container {
    min-height: 73vh;
  }
}

@media (min-width: 992px) {
  .table-container {
    min-height: 75vh;
  }
}

@media (min-width: 1400px) {
  .table-container {
    min-height: 85vh;
  }
}

@media (max-width: 1023px) {
  table th,
  table td {
    white-space: nowrap !important;
  }
}

/* ================= MOBILE STACKED TABLE ================= */

@media screen and (max-width: 639px) {
  .spec-row {
    grid-template-columns: 120px 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 50px;
    align-items: flex-start;
  }

  .main-table thead {
    display: none;
  }

  .main-table tr {
    display: block;
    margin-bottom: 1em;
  }

  .main-table td {
    display: block;
    text-align: right;
    font-size: 1rem;
    border-bottom: 1px solid #ededed;
  }

  .main-table td:before {
    content: attr(data-label);
    font-size: 0.906rem;
    color: var(--text-dark-muted);
    float: left;
  }

  .main-table td:last-child {
    border-bottom: 1.2px solid var(--color-border-soft);
  }
}

/* ================= DASHBOARD ================= */

.dashboard-card {
  border: 0;
  border-radius: 0.875rem;
  overflow: hidden;
  height: 200px;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08);
}

.dashboard-icon {
  height: 70px;
}

.demo-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.demo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

iframe {
  border: 0;
}

/* ================= SPINNER ================= */

.dot-spinner {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.dot-spinner .dot {
  width: 15px;
  height: 15px;
  margin: 0 4px;
  border-radius: 50%;
  background-color: var(--bs-primary) !important;
  animation: dot-bounce 1.4s infinite ease-in-out both;
}

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

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

.dot-spinner .dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dot-bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

/* ================= HTMX ================= */

.container.htmx-added {
  opacity: 0;
  transform: translateX(30px);
}

.container.htmx-added.htmx-settling {
  opacity: 1;
  transform: translateX(0);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.container.htmx-swapping {
  opacity: 0;
  transform: translateX(-30px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

/* ================= UTILITIES ================= */

.feature {
  position: relative;
  padding-left: 28px;
  margin-bottom: 14px;
}

.feature::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--bs-success);
}

.description-box {
  max-height: 300px;
  overflow-y: auto;
}

.description-box::-webkit-scrollbar {
  display: none;
}

/* ================= FOOTER ================= */

.footer {
  background-color: rgb(10, 48, 145);
}

.footer a {
  color: var(--bs-light);
  font-size: 15px;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

* {
  caret-color: transparent;
}

input,
textarea,
[contenteditable="true"] {
  caret-color: auto;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.badge.rounded-4 {
  border-color: #c2c2c2 !important;
}

input[type="checkbox"] {
  caret-color: transparent;
}
