:root {
  --bg-dark: #0a0e17;
  --card-bg: rgba(18, 26, 43, 0.85);
  --card-border: rgba(255, 255, 255, 0.1);
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  width: 100%;
}

/* Header & Navigation */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: #000;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.lang-btn.active, .lang-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

/* Forms & Inputs */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 1rem; /* 16px prevents automatic zoom on iOS Safari */
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  min-height: 48px;
}

.form-control:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

select.form-control option {
  background: #0f172a;
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.95rem 1.75rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  min-height: 50px;
  text-align: center;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Stats Summary Cards */
.score-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-top: 0.35rem;
  word-break: break-word;
}

.stat-box.highlight .stat-value {
  color: var(--accent-gold);
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-red {
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.badge-blue {
  background: rgba(6, 182, 212, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Property Cards Grid */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.property-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.property-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.property-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.6rem;
}

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

.property-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Tables */
.table-custom {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  min-width: 600px; /* Enables horizontal scroll on mobile */
}

.table-custom th, .table-custom td {
  padding: 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9rem;
}

.table-custom th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
}

footer {
  margin-top: auto;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--card-border);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 768px) {
  .container {
    padding: 0.85rem 0.75rem;
  }

  .glass-panel {
    padding: 1.15rem;
    border-radius: 14px;
    margin-bottom: 1.15rem;
  }

  .header-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .brand-logo {
    justify-content: flex-start;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links .lang-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.5rem;
    font-size: 0.82rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .score-card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-box {
    padding: 0.75rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .properties-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .property-image {
    height: 180px;
  }

  .btn-primary {
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .score-card-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-value {
    font-size: 1.35rem;
  }

  .brand-title {
    font-size: 1.2rem;
  }
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .glass-panel {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
  .lang-switch, .no-print {
    display: none !important;
  }
}
