/* ==========================================================================
   1. Design Token System & Colour Schemes (EdIndex Blues & Whites)
   ========================================================================== */
:root[data-theme="light"] {
  --primary-brand: #003366;    /* Existing deep EdIndex blue */
  --accent-action: #0056b3;    /* Clear interactive link/button blue */
  --bg-main: #f4f7fa;          /* Soft neutral light grey background */
  --bg-surface: #ffffff;       /* Pure white crisp layout elements */
  --text-main: #1a2530;        /* Deep slate charcoal for highly readable text */
  --text-muted: #5a6b7c;       /* Secondary details text */
  --border-color: #d1dbe5;     /* Soft dividing boundaries */
  --shadow-sm: 0 2px 4px rgba(0, 51, 102, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 51, 102, 0.08);
}

:root[data-theme="dark"] {
  --primary-brand: #0a192f;    /* Muted night deep navy */
  --accent-action: #38bdf8;    /* High-contrast neon sky blue for readability */
  --bg-main: #0f172a;          /* Dark charcoal body canvas */
  --bg-surface: #1e293b;       /* Slightly lighter elevated panel surfaces */
  --text-main: #f8fafc;        /* Off-white fluid typography */
  --text-muted: #94a3b8;       /* Subtle text details */
  --border-color: #334155;     /* Dark contrasting boundaries */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   2. Global Typography, Reset, Base Layout
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.portal-container {
  display: flex;
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
}

/* ==========================================================================
   3. Sticky Left-Hand Navigation Sidebar
   ========================================================================== */
.sidebar {
  width: 300px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  transition: background-color 0.3s ease;
}

/* Fixes content relative to screen frame while scrolling */
.sidebar-sticky-wrapper {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4rem);
}

.logo-area {
  margin-bottom: 2.5rem;
}

.logo-placeholder {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-brand);
  background: linear-gradient(135deg, var(--border-color), var(--bg-main));
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
  border: 1px dashed var(--accent-action);
}

/* Menu links styling */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.nav-link {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover States */
.nav-link:hover {
  background-color: var(--bg-main);
  color: var(--accent-action);
  padding-left: 1.25rem; /* Micro-interaction forward shift */
}

.nav-link.active {
  background-color: var(--primary-brand);
  color: #ffffff;
}

/* Filters and Select Controls inside Sidebar */
.filter-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-bottom: auto;
}

.section-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Comfort Theme Box at Bottom */
.theme-selector-wrapper {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.theme-selector-wrapper label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* ==========================================================================
   4. Main Work Area Content Grid (70% Width)
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 3rem 2.5rem;
}

.content-header {
  margin-bottom: 2.5rem;
  max-width: 800px;
}

.content-header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* The Unified Structural Grid */
.property-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem; /* Controlled white space allocation */
}

/* Elegant Property Panel Components */
.property-card {
  display: flex;
  background-color: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-image-placeholder {
  width: 240px;
  min-height: 100%;
  background-color: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.card-content {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.badge {
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.badge-primary { background-color: rgba(0, 51, 102, 0.1); color: var(--primary-brand); }
.badge-association { background-color: rgba(0, 86, 179, 0.1); color: var(--accent-action); }

.card-content h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.property-specs {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.property-landlord {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Button Interaction Triggers */
.card-actions {
  margin-top: auto;
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--accent-action);
  color: #ffffff;
}

.btn-primary:hover {
  filter: brightness(1.15); /* Clean CSS interaction lift */
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-main);
}

/* ==========================================================================
   5. Clean Footer Architecture
   ========================================================================== */
.site-footer {
  background-color: var(--primary-brand);
  color: #ffffff;
  padding: 4rem 2rem 2rem;
  margin-top: 5rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-grid h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: #ffffff;
}

.footer-grid p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.75rem;
}

.footer-grid a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-grid a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.mobile-header { display: none; }

/* ==========================================================================
   6. Fluid Breakpoint Responsive Layouts (Mobile Optimisation)
   ========================================================================== */
@media (max-width: 960px) {
  .portal-container {
    flex-direction: column;
  }

  /* Fixed mobile header bar layout */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .menu-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    color: var(--text-main);
    cursor: pointer;
  }

  /* Sidebar configuration transformation for mobile tap interaction */
  .sidebar {
    width: 100%;
    display: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar.mobile-open {
    display: block;
  }

  .sidebar-sticky-wrapper {
    height: auto;
    position: static;
  }

  .logo-area { display: none; }

  .main-content {
    padding: 1.5rem;
  }

  .property-card {
    flex-direction: column;
  }

  .card-image-placeholder {
    width: 100%;
    height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}
/* Campaign alert strip */
.campaign-banner {
  background-color: #ef4444;
  color: #ffffff;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  position: relative;
}
/* Hidden pages by default */
.portal-page {
  display: none;
}
/* Display active page class triggered by JS */
.active-page {
  display: block;
}
.info-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.placeholder-text {
  font-family: monospace;
  background-color: var(--bg-main);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #ef4444;
}
