/* ============================================================
   File:        directory-styles.css
   Purpose:     Styles for the Resident Business Directory page.
                Color theme: forest green + gold, matching the
                main site palette.
   ============================================================ */


/* ── COLOR VARIABLES ──────────────────────────────────────────*/
:root {
  --forest:    #2c3d2e;
  --moss:      #4a5e3a;
  --gold:      #c9a84c;
  --gold-light:#e0c270;
  --cream:     #f5f0e8;
  --parchment: #fdf8ef;
  --deep:      #1a2314;
  --soft-text: #5a6b4a;
  --muted:     #8a9a7a;
  --white:     #ffffff;
  --border:    rgba(44, 61, 46, 0.15);
}


/* ── RESET ────────────────────────────────────────────────────*/
* { box-sizing: border-box; margin: 0; padding: 0; }


/* ── BODY ─────────────────────────────────────────────────────*/
body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--cream);
  color: var(--deep);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -100px; right: -100px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -120px; left: -120px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(74,94,58,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}


/* ── NAVIGATION ───────────────────────────────────────────────*/
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--forest);
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nav-brand {
  color: var(--gold);
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand span { margin-right: 0.4em; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover,
.nav-links a.nav-active { background: rgba(201,168,76,0.18); color: var(--gold); }

.nav-cta {
  background: var(--gold) !important;
  color: var(--forest) !important;
  font-weight: 600 !important;
  border-radius: 20px !important;
  padding: 0.4rem 1rem !important;
}
.nav-cta:hover { background: var(--gold-light) !important; }

.nav-has-dropdown { position: relative; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  list-style: none;
  min-width: 200px;
  padding: 0.5rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 200;
}
.nav-has-dropdown:hover .nav-dropdown { display: block; }
.nav-dropdown li a {
  display: block;
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  white-space: nowrap;
  border-radius: 0;
}
.nav-caret { font-size: 0.65em; margin-left: 0.2em; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--forest);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    align-items: stretch;
    border-top: 1px solid rgba(201,168,76,0.2);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links li a { padding: 0.75rem 1rem; display: block; }
  .nav-dropdown {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    margin: 0.25rem 0;
    padding: 0;
  }
  .nav-has-dropdown:hover .nav-dropdown { display: none; }
  .nav-has-dropdown.nav-dd-open .nav-dropdown { display: block; }
}


/* ── PAGE WRAPPER ─────────────────────────────────────────────*/
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 1.5rem 3rem;
  position: relative;
  z-index: 1;
}


/* ── PAGE HEADER ──────────────────────────────────────────────*/
.page-header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}
.page-header .board-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}
.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--forest);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}
.page-header h1 em {
  font-style: italic;
  color: var(--gold);
}
.page-header .subtitle {
  font-size: 1rem;
  color: var(--soft-text);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}
.list-btn {
  display: inline-block;
  background: var(--gold);
  color: var(--forest);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.5rem;
  border-radius: 24px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.list-btn:hover { background: var(--gold-light); transform: translateY(-1px); }


/* ── FILTER BAR ───────────────────────────────────────────────*/
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0 auto 2.5rem;
  max-width: 800px;
}
.filter-btn {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--soft-text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.filter-btn:hover {
  border-color: var(--gold);
  color: var(--forest);
  background: rgba(201,168,76,0.08);
}
.filter-btn.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}


/* ── BUSINESS GRID ────────────────────────────────────────────*/
.biz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.biz-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.biz-card:hover {
  box-shadow: 0 6px 24px rgba(44,61,46,0.12);
  transform: translateY(-2px);
}

.biz-category-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  align-self: flex-start;
  margin-bottom: 0.25rem;
}
.cat-trades    { background: #e8f5e9; color: #1b5e20; }
.cat-childcare { background: #fff4de; color: #7a5400; }
.cat-petcare   { background: #fce4ec; color: #880e4f; }
.cat-landscaping { background: #e3f2fd; color: #0d47a1; }
.cat-other     { background: #f3e5f5; color: #4a148c; }

.biz-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--forest);
  line-height: 1.2;
}
.biz-owner {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: -0.25rem;
}
.biz-description {
  font-size: 0.88rem;
  color: var(--soft-text);
  line-height: 1.55;
  flex: 1;
}
.biz-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.biz-contact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--soft-text);
}
.biz-contact-row a {
  color: var(--moss);
  text-decoration: none;
  word-break: break-all;
}
.biz-contact-row a:hover { text-decoration: underline; color: var(--forest); }
.biz-contact-icon { font-size: 0.9rem; flex-shrink: 0; }


/* ── EMPTY STATE ──────────────────────────────────────────────*/
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  display: none;
}
.empty-state.visible { display: block; }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; color: var(--soft-text); line-height: 1.6; }
.empty-state a { color: var(--gold); font-weight: 600; }


/* ── SUBMIT FORM MODAL ────────────────────────────────────────*/
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}
.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest);
}
.modal-close-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--soft-text);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-close-btn:hover { background: var(--cream); }
.modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.form-group label .req { color: var(--gold); margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--deep);
  background: var(--parchment);
  transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 90px; }

.submit-btn {
  width: 100%;
  background: var(--forest);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.submit-btn:hover { background: var(--moss); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

/* Success state inside modal */
.modal-success {
  text-align: center;
  padding: 2rem 1rem;
}
.modal-success .success-icon { font-size: 3rem; margin-bottom: 1rem; }
.modal-success h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--forest);
  margin-bottom: 0.5rem;
}
.modal-success p { font-size: 0.9rem; color: var(--soft-text); line-height: 1.6; }


/* ── TOAST ────────────────────────────────────────────────────*/
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--forest);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 9999;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  max-width: 320px;
}
.toast.toast-show { transform: translateY(0); opacity: 1; }
.toast.toast-error { background: #8b3a2e; }


/* ── FOOTER ───────────────────────────────────────────────────*/
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}


/* ── RESPONSIVE ───────────────────────────────────────────────*/
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .biz-grid { grid-template-columns: 1fr; }
}
