/* WorthIt — Custom Styles */

/* Hide scrollbar utility (for horizontal scroll areas) */
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* Loading fade out */
.loading-fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

/* Flat type toggle active state */
.flat-type-btn.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

/* Price positive (more expensive) */
.price-positive { color: #ef4444; }
/* Price negative (cheaper) */
.price-negative { color: #10b981; }

/* Badge classes */
.badge-positive { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-negative { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.badge-neutral { background: rgba(100, 116, 139, 0.1); color: #94a3b8; }

/* Deal label colors */
.deal-amazing { color: #10b981; }
.deal-good { color: #22c55e; }
.deal-fair { color: #f59e0b; }
.deal-overpriced { color: #f97316; }
.deal-bad { color: #ef4444; }

/* Scrollable transactions table */
.scrollable-table-container {
  max-height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}

/* Fixed-layout transaction table — prevents horizontal overflow */
.scrollable-table-container table {
  table-layout: fixed;
  width: 100%;
}

.scrollable-table-container th,
.scrollable-table-container td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Location column (2nd) — allow wrapping since it has the link */
.scrollable-table-container td:nth-child(2),
.scrollable-table-container th:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Column widths: Date 9%, Location 26%, Type 13%, Floor 10%, Area 11%, Lease 8%, Price 12%, $/sqm 11% */
.scrollable-table-container th:nth-child(1), .scrollable-table-container td:nth-child(1) { width: 9%; }
.scrollable-table-container th:nth-child(2), .scrollable-table-container td:nth-child(2) { width: 26%; }
.scrollable-table-container th:nth-child(3), .scrollable-table-container td:nth-child(3) { width: 13%; }
.scrollable-table-container th:nth-child(4), .scrollable-table-container td:nth-child(4) { width: 10%; }
.scrollable-table-container th:nth-child(5), .scrollable-table-container td:nth-child(5) { width: 11%; }
.scrollable-table-container th:nth-child(6), .scrollable-table-container td:nth-child(6) { width: 8%; }
.scrollable-table-container th:nth-child(7), .scrollable-table-container td:nth-child(7) { width: 12%; }
.scrollable-table-container th:nth-child(8), .scrollable-table-container td:nth-child(8) { width: 11%; }

.scrollable-table-container::-webkit-scrollbar {
  width: 6px;
}

.scrollable-table-container::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-table-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 3px;
}

.scrollable-table-container::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* Mobile transaction cards */
.tx-card {
  background: rgba(51, 65, 85, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}
.tx-card:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Scrollable cards container */
.scrollable-cards-container {
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) transparent;
}
.scrollable-cards-container::-webkit-scrollbar {
  width: 4px;
}
.scrollable-cards-container::-webkit-scrollbar-track {
  background: transparent;
}
.scrollable-cards-container::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 2px;
}

/* Smooth section reveal */
#results-section {
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Comparable row hover */
.comparable-row:hover, tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Selection color */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: white;
}

/* Focus styles */
input:focus, select:focus {
  outline: none;
}

/* Number input hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Leaflet dark popup */
.dark-popup .leaflet-popup-content-wrapper {
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 260px;
}
.dark-popup .leaflet-popup-tip {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.dark-popup .leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 18px !important;
  padding: 6px 8px 0 0 !important;
}
.dark-popup .leaflet-popup-close-button:hover {
  color: #f1f5f9 !important;
}

/* Mobile: smaller Leaflet popups */
@media (max-width: 640px) {
  .dark-popup .leaflet-popup-content-wrapper {
    max-width: 200px;
  }
  .leaflet-popup-content {
    min-width: unset !important;
  }
}

/* Leaflet map controls dark theme */
.leaflet-control-zoom a {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
.leaflet-control-zoom a:hover {
  background-color: #334155 !important;
}
.leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.8) !important;
  color: #64748b !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a {
  color: #60a5fa !important;
}

/* MRT station tooltip */
.mrt-tooltip {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}
.mrt-tooltip::before {
  border-top-color: #1e293b !important;
}

/* Autocomplete dropdown */
#ac-dropdown .ac-item:hover {
  background: rgba(255,255,255,0.05);
}
#ac-dropdown .ac-item:last-child {
  border-radius: 0 0 0.75rem 0.75rem;
}
#ac-dropdown .ac-item:first-child {
  border-radius: 0.75rem 0.75rem 0 0;
}
