/* ERA Private Directory Styles — extends public directory patterns */

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

body {
  font-family: 'Open Sans', sans-serif;
  background: #c5cfd8;
  color: #2d3b2d;
  min-height: 100vh;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #d0d8d0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link { display: flex; align-items: center; }
.logo { height: 44px; }

.nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav a {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #5a7a5a;
  text-decoration: none;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav a:hover { color: #1a5c2a; }
.nav a.active { color: #1a5c2a; border-bottom-color: #1a5c2a; }

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  padding: 0.45rem 1rem;
  border: 1px solid #b0bec5;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-primary {
  background: #1a5c2a;
  color: #fff;
  border-color: #1a5c2a;
}

.btn-primary:hover { background: #145221; }

.btn-secondary {
  background: #fff;
  color: #5a7a5a;
}

.btn-secondary:hover {
  border-color: #1a5c2a;
  color: #1a5c2a;
}

/* Hero — deeper green for private directory */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 1rem;
  background: linear-gradient(180deg, #1a5c2a 0%, #145221 100%);
  color: #fff;
}

.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.9);
  font-weight: 300;
  margin-top: 0.4rem;
}

/* Controls */
.controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8a9a8a;
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.5rem;
  border: 1px solid #b0bec5;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Open Sans', sans-serif;
  background: #fff;
  color: #2d3b2d;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#search:focus {
  outline: none;
  border-color: #1a5c2a;
  box-shadow: 0 0 0 3px rgba(26, 92, 42, 0.15);
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.45rem 1rem;
  border: 1px solid #b0bec5;
  border-radius: 20px;
  background: #fff;
  color: #5a7a5a;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { border-color: #1a5c2a; color: #1a5c2a; }
.filter-btn.active { background: #1a5c2a; color: #fff; border-color: #1a5c2a; }

.count {
  font-size: 0.85rem;
  color: #607d8b;
  margin-left: auto;
  white-space: nowrap;
}

/* Grid */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.loading, .no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #607d8b;
}

/* Card */
.card {
  background: #1f4a3a;
  border-radius: 14px;
  padding: 1.5rem 1.25rem 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.card-own {
  border: 2px solid rgba(143,212,164,0.5);
}

.card-own:hover {
  border-color: rgba(143,212,164,0.8);
}

.card-own-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8fd4a4;
  margin-bottom: 0.5rem;
}

.card-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  display: block;
  border: 3px solid rgba(255,255,255,0.2);
  background: #2a5a48;
}

.card-initials {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  border: 3px solid rgba(255,255,255,0.2);
}

.card-name {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.3rem;
}

.card-badges {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-board { background: rgba(255,255,255,0.15); color: #8fd4a4; }
.badge-donor { background: #d4a017; color: #fff; }

.card-bio {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  margin-bottom: 0.5rem;
  width: 100%;
}

.card-bio.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.read-more {
  font-size: 0.78rem;
  color: #8fd4a4;
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 600;
  padding: 0;
  margin-bottom: 0.5rem;
  display: none;
}

.read-more:hover { text-decoration: underline; color: #b0e8c0; }
.read-more.visible { display: inline; }

.card-email, .card-phone {
  font-size: 0.78rem;
  margin-bottom: 0.3rem;
}

.card-email a, .card-phone a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
}

.card-email a:hover, .card-phone a:hover { color: #fff; text-decoration: underline; }

.card-location {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.3rem;
}

.card-socials {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  width: 100%;
  flex-wrap: wrap;
}

.card-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.2s;
}

.card-socials a:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.card-socials svg { width: 14px; height: 14px; fill: currentColor; }

.card-attendance {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  margin-top: 0.4rem;
}

/* ===== Profile Editor Styles ===== */

.editor-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.editor-form {
  background: #fff;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.editor-form h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a5c2a;
  margin-bottom: 1.5rem;
}

.field-group {
  margin-bottom: 1.25rem;
}

.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3b2d;
  margin-bottom: 0.3rem;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #b0bec5;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Open Sans', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-group textarea {
  min-height: 100px;
  resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
  outline: none;
  border-color: #1a5c2a;
  box-shadow: 0 0 0 3px rgba(26, 92, 42, 0.15);
}

.field-group .hint {
  font-size: 0.75rem;
  color: #90a4ae;
  margin-top: 0.25rem;
}

.field-group input:read-only {
  background: #f5f5f5;
  color: #90a4ae;
  cursor: not-allowed;
}

/* Disclosure toggles */
.disclosure-section {
  background: #fff;
  border-radius: 14px;
  padding: 2rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.disclosure-section h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a5c2a;
  margin-bottom: 0.5rem;
}

.disclosure-section .section-desc {
  font-size: 0.85rem;
  color: #607d8b;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.disclosure-table {
  width: 100%;
  border-collapse: collapse;
}

.disclosure-table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem;
  color: #455a64;
  border-bottom: 2px solid #e0e0e0;
}

.disclosure-table th:first-child {
  text-align: left;
}

.disclosure-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
}

.disclosure-table td:not(:first-child) {
  text-align: center;
}

.disclosure-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1a5c2a;
}

/* Preview panel */
.preview-panel {
  position: sticky;
  top: 80px;
  align-self: start;
}

.preview-panel h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3b2d;
  margin-bottom: 1rem;
}

.preview-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #607d8b;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

.preview-label:first-of-type {
  margin-top: 0;
}

.preview-card-wrap {
  margin-bottom: 1rem;
}

/* Preview card: inactive state (has URL but disclosure off) */
.card-bio.inactive {
  opacity: 0.25;
  text-decoration: line-through;
}

.card-email.inactive,
.card-phone.inactive {
  opacity: 0.25;
  text-decoration: line-through;
}

.card-socials a.inactive {
  opacity: 0.3;
  border-color: rgba(255,255,255,0.15);
}

/* Preview card: empty state (no URL entered) */
.card-socials a.empty {
  opacity: 0.15;
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

/* Save area */
.save-area {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

.btn-save {
  padding: 0.75rem 2rem;
  background: #1a5c2a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover { background: #145221; }
.btn-save:disabled { background: #90a4ae; cursor: not-allowed; }

.save-status {
  font-size: 0.9rem;
  color: #607d8b;
}

.save-status.success { color: #155724; }
.save-status.error { color: #721c24; }

/* Publish toggle */
.publish-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f5f9f5;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.publish-toggle label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3b2d;
  cursor: pointer;
}

.publish-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1a5c2a;
  cursor: pointer;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
  color: #607d8b;
}

.footer a { color: #455a64; text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
  .editor-container {
    grid-template-columns: 1fr;
  }
  .preview-panel {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav { gap: 1rem; }
  .nav a { font-size: 0.8rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero-sub { font-size: 0.9rem; }
  .controls { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: none; }
  .count { margin-left: 0; }
  .grid { padding: 1rem; }
  .header-actions { gap: 0.5rem; }
  .btn { font-size: 0.75rem; padding: 0.35rem 0.75rem; }
}

@media (max-width: 480px) {
  .grid { padding: 0.75rem; gap: 1rem; }
  .header-inner { flex-direction: column; gap: 0.5rem; }
  .nav { flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
  .hero { padding: 1.5rem 1rem 0.75rem; }
  .hero h1 { font-size: 1.25rem; }
  .card { padding: 1.25rem 1rem 0.75rem; }
  .card-photo, .card-initials { width: 80px; height: 80px; }
  .editor-form, .disclosure-section { padding: 1.25rem; }
}
