/* Load header styles early so nav never flashes unstyled */
@import url('/includes/header.css');

/* =============================
   RESET & VARIABLES
   ============================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color:  #5a6ea6;  /* base periwinkle — hsl(224, 30%, 50%) */
  --primary-dark:   #4a5e96;  /* hsl(224, 30%, 44%) — buttons, CTAs    */
  --primary-darker: #3a4e84;  /* hsl(224, 30%, 37%) — hover states      */
  --secondary-color: #eef1f8;
  --text-color: #1a1a1a;
  --link-color: var(--primary-dark);
  --link-hover-color: var(--primary-darker);
  --footer-bg: #5a6ea6;
  --footer-text: #ffffff;
  --card-bg: #fafafa;
  --border-light: #ddd;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* ── Header placeholder — reserves space + matches nav background colour
   so the page doesn't jump when the nav fetches and injects ─────────── */
#header-placeholder:empty {
  min-height: 56px;
  background: #5a6ea6;
}

/* =============================
   FORM INPUTS — LIGHT MODE BASE
   Always explicit so OS dark mode can't bleed through.
   ============================= */
input,
select,
textarea {
  background-color: #ffffff;
  color: #1a1a1a;
  border: 1.5px solid #d0d5e0;
  border-radius: 6px;
  font-family: inherit;
}

/* Chrome/Safari autofill override — light mode */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  -webkit-text-fill-color: #1a1a1a !important;
  transition: background-color 99999s ease-in-out 0s;
}

/* =============================
   TOP NAV / HEADER
   ============================= */
.top-nav {
  width: 100%;
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 25px;
}

.top-nav .logo a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.4rem;
}

.top-nav nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.top-nav nav ul li a,
.dropbtn {
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.top-nav nav ul li a:hover,
.dropbtn:hover {
  background-color: rgba(255,255,255,0.2);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 180px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 1000;
}

/* Last nav dropdown (gear/account) aligns to the right so it doesn't overflow */
#nav-links li:last-child .dropdown-content {
  left: auto;
  right: 0;
}

.dropdown-content a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
}

.dropdown-content a:hover {
  background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content,
.dropdown .dropdown-content[style*="display: block"] {
  display: block;
}

/* =============================
   PAGE LAYOUT
   ============================= */
.page-wrapper {
  display: flex;
  gap: 20px;
  margin: 20px;
}

/* Sidebar */
.sidebar-nav {
  width: 220px;
  background-color: #f9f9f9;
  border-right: 1px solid var(--border-light);
  padding: 20px;
  border-radius: 6px;
  flex-shrink: 0;
}

.sidebar-nav h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  border-bottom: 1px solid #ccc;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 10px;
}

.sidebar-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.sidebar-nav a:hover {
  color: var(--primary-color);
}

/* =============================
   PROJECT MAIN AREA
   ============================= */
.project-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-columns {
  display: flex;
  gap: 20px;
}

.left-col,
.right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* =============================
   PROJECT INFO BOXES
   ============================= */
#main-project-info {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  background-color: var(--card-bg);
  padding: 15px;
  border-radius: 6px;
}

.project-detail {
  background-color: var(--card-bg);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.project-detail label {
  font-weight: 600;
  font-size: 0.9rem;
}

.project-detail span,
.project-detail a {
  font-size: 0.9rem;
  color: #555;
  word-break: break-word;
}

#project-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

/* =============================
   MAP & IMAGES
   ============================= */
#project-map {
  width: 100%;
  height: 300px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.right-col img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 6px;
}

/* =============================
   SIMILAR OPPORTUNITIES
   ============================= */
#similar-opportunities h3 {
  margin-bottom: 10px;
}

#similar-list {
  list-style: none;
  display: flex;
  gap: 15px;
  overflow-x: auto;
}

#similar-list li {
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
}

#similar-list a {
  font-weight: bold;
  color: var(--link-color);
  text-decoration: none;
}

#similar-list a:hover {
  text-decoration: underline;
}

/* =============================
   BUTTONS
   ============================= */
button {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: var(--primary-darker);
}

/* =============================
   FOOTER
   ============================= */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

footer a {
  color: #cbd3f2;
}

/* ── Rightmove-style multi-column footer ── */
.ll-footer {
  background: #1a1f3c;
  color: #c5cae9;
  padding: 48px 0 0;
  margin-top: 0;
  text-align: left;
  font-size: 0.875rem;
}

.ll-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.ll-footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ll-footer-col h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff;
  margin: 0 0 14px;
}

.ll-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ll-footer-col ul li a {
  color: #9fa8da;
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.15s;
}

.ll-footer-col ul li a:hover {
  color: #ffffff;
}

.ll-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 0.8rem;
  color: #7986cb;
  flex-wrap: wrap;
  gap: 8px;
}

.ll-footer-bottom-links {
  display: flex;
  gap: 20px;
}

.ll-footer-bottom-links a {
  color: #7986cb;
  text-decoration: none;
  transition: color 0.15s;
}

.ll-footer-bottom-links a:hover {
  color: #ffffff;
}

@media (max-width: 900px) {
  .ll-footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .ll-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ll-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Dark mode — footer is already dark, just ensure link colours hold */
[data-theme="dark"] .ll-footer {
  background: #111526;
}

/* =============================
   RESPONSIVE
   ============================= */
@media (max-width: 1200px) {
  .project-columns {
    flex-direction: column;
  }

  #project-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-wrapper {
    flex-direction: column;
    margin: 10px;
  }

  .sidebar-nav {
    display: none;
  }

  .top-nav nav ul {
    gap: 10px;
  }
}
