/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --color-primary: #0f172a; /* Slate 900 */
  --color-primary-light: #334155; /* Slate 700 */
  --color-accent: #0ea5e9; /* Sky 500 */
  --color-accent-hover: #0284c7; /* Sky 600 */
  --color-bg: #f8fafc; /* Slate 50 */
  --color-surface: #ffffff;
  --color-border: #e2e8f0; /* Slate 200 */
  --color-text: #334155; /* Slate 700 */
  --color-text-muted: #64748b; /* Slate 500 */
  
  /* Dimensions */
  --topbar-height: 64px;
  --sidebar-width: 360px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Base Reset & Typography */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 0;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--color-accent-hover);
}

/* Layout */
#layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  position: relative;
  overflow: hidden;
}

/* Topbar */
#topbar {
  height: var(--topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  z-index: 20;
  position: relative;
}

#topbar h1 {
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--color-primary);
  display: flex;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
}

.logo-img {
  height: 40px;
  width: auto;
  transition: transform 0.2s ease;
}

.logo-container:hover .logo-img {
  transform: scale(1.05);
}

.logo-text {
  font-weight: 700;
}

/* Auth Buttons */
.auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}

.btn-modern-ghost {
  color: var(--color-text);
  background: transparent;
}

.btn-modern-ghost:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

.btn-modern-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.btn-modern-primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  padding: 24px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#sidebar p {
  line-height: 1.6;
  color: var(--color-text-muted);
}

.sidebar-alert {
  background-color: #f0f9ff;
  border-left: 4px solid var(--color-accent);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.sidebar-alert strong {
  display: block;
  margin-bottom: 4px;
  color: var(--color-primary);
}

.sidebar-alert p {
  font-size: 0.9375rem;
  margin: 0;
}


/* Map */
#map {
  flex: 1;
  background-color: #e5e7eb; /* Placeholder while loading */
}

/* Mapbox Customization */
.mapboxgl-popup-content {
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--color-border);
}

.mapboxgl-popup-close-button {
  padding: 4px;
  color: var(--color-text-muted);
}

.mapboxgl-popup-tip {
  border-top-color: var(--color-surface) !important;
}

/* Custom Popup Styles */
.popup-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: block;
}

.popup-detail {
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.popup-detail strong {
  font-weight: 500;
  color: var(--color-primary-light);
}

.mapboxgl-ctrl-group {
    border-radius: 8px !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
  #layout {
    flex-direction: column;
  }
  
  #sidebar {
    width: 100%;
    height: auto;
    max-height: 30vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }
}

/* Footer */
#site-footer {
    background: var(--color-primary);
    color: white;
    padding: 32px 24px;
    margin-top: auto;
    z-index: 30;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: #e2e8f0;
    font-size: 0.875rem;
    transition: color 0.2s;
}

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

.footer-section p {
    margin: 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

/* Detail Page Custom Styles */
.detail-container {
    padding: 32px;
    overflow-y: auto;
    height: 100%;
    background-color: var(--color-bg);
}

.detail-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.badge-status {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-available { background-color: #dcfce7; color: #166534; }
.status-reserved { background-color: #fef9c3; color: #854d0e; }
.status-sold { background-color: #fee2e2; color: #991b1b; }

.price-tag {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--color-surface);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.feature-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.feature-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Contact Card in Sidebar */
.contact-card {
    background: var(--color-surface);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.mini-map-container {
    height: 300px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

/* Adjust sidebar for detail view */
.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-weight: 500;
}

.nav-back:hover {
    color: var(--color-accent);
}

/* Auth Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--topbar-height));
    padding: 24px;
    background-color: var(--color-bg);
}

.auth-card {
    background: var(--color-surface);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1));
    border: 1px solid var(--color-border);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    font-size: 0.95rem;
}

.auth-link {
    color: var(--color-accent);
    font-weight: 500;
}

.auth-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Form Styles Override for Auth */
.asteriskField {
    color: #ef4444; /* Red 500 */
}
