/* nswnats.team — Specialist Skills Directory */
/* Independent stylesheet — no AvBrains dependencies */

/* === Custom Properties === */
:root {
  --sd-primary: #00512d;
  --sd-primary-light: #0a5640;
  --sd-primary-dark: #003d21;
  --sd-accent: #ffce00;
  --sd-accent-dark: #e6b800;
  --sd-bg: #ffffff;
  --sd-bg-alt: #f8f9fa;
  --sd-bg-card: #ffffff;
  --sd-text: #212529;
  --sd-text-muted: #6c757d;
  --sd-border: #dee2e6;
  --sd-border-light: #e9ecef;
  --sd-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --sd-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --sd-radius: 6px;
  --sd-radius-lg: 10px;
  --sd-font: "Liberation Sans", "Helvetica Neue", Arial, sans-serif;
  --sd-max-width: 1100px;
  --sd-danger: #dc3545;
  --sd-danger-bg: #f8d7da;
  --sd-warning: #ffc107;
  --sd-warning-bg: #fff3cd;
  --sd-success: #00512d;
  --sd-success-bg: #e6f5ec;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Base Typography === */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sd-font);
  color: var(--sd-text);
  background: var(--sd-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a {
  color: var(--sd-primary);
  text-decoration: none;
}

a:hover {
  color: var(--sd-primary-light);
  text-decoration: underline;
}

/* === Layout === */
.container {
  width: 100%;
  max-width: var(--sd-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
}

/* === Header === */
.site-header {
  background: var(--sd-primary);
  color: #fff;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.site-header .brand:hover {
  text-decoration: none;
  color: var(--sd-accent);
}

.site-header .brand span {
  color: var(--sd-accent);
}

.site-header nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-left: 1.5rem;
}

.site-header nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* === Search Hero === */
.search-hero {
  background: var(--sd-bg-alt);
  border-bottom: 1px solid var(--sd-border);
  padding: 2rem 0;
  text-align: center;
}

.search-hero h1 {
  margin-bottom: 1.25rem;
  color: var(--sd-primary);
}

.search-input-wrap {
  max-width: 600px;
  margin: 0 auto 1.25rem;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  font-family: var(--sd-font);
  border: 2px solid var(--sd-border);
  border-radius: var(--sd-radius);
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrap input:focus {
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 3px rgba(0, 81, 45, 0.15);
}

.search-input-wrap input::placeholder {
  color: var(--sd-text-muted);
}

/* === Filter Groups === */
.filter-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto 1.25rem;
}

.filter-group {
  text-align: left;
}

.filter-group-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sd-text-muted);
  margin-bottom: 0.4rem;
}

.filter-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

.filter-group-options label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.filter-group-options input[type="checkbox"] {
  accent-color: var(--sd-primary);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* === Search Button === */
.search-actions {
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  font-family: var(--sd-font);
  font-weight: 600;
  border: none;
  border-radius: var(--sd-radius);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

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

.btn-primary {
  background: var(--sd-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--sd-primary-light);
}

.btn-secondary {
  background: var(--sd-border);
  color: var(--sd-text);
}

.btn-secondary:hover {
  background: var(--sd-text-muted);
  color: #fff;
}

.btn-warning {
  background: var(--sd-accent);
  color: var(--sd-primary-dark);
  font-weight: 700;
}

.btn-warning:hover {
  background: var(--sd-accent-dark);
}

.btn-danger {
  background: var(--sd-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #bb2d3b;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* === Active Filter Tags === */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  min-height: 1.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--sd-accent);
  color: var(--sd-primary-dark);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-tag button {
  background: none;
  border: none;
  color: var(--sd-primary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
}

.filter-tag button:hover {
  color: var(--sd-primary-dark);
}

/* === Results === */
.results-section {
  padding: 1.5rem 0 3rem;
}

.results-count {
  font-size: 0.9rem;
  color: var(--sd-text-muted);
  margin-bottom: 1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.result-card {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border-light);
  border-radius: var(--sd-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--sd-shadow);
  transition: box-shadow 0.2s;
}

.result-card:hover {
  box-shadow: var(--sd-shadow-lg);
}

.result-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sd-primary);
  margin-bottom: 0.15rem;
}

.result-card-location {
  font-size: 0.85rem;
  color: var(--sd-text-muted);
  margin-bottom: 0.6rem;
}

.result-card-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.skill-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--sd-success-bg);
  color: var(--sd-primary);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.skill-badge.matched {
  background: var(--sd-accent);
  color: var(--sd-primary-dark);
  font-weight: 600;
}

.result-card-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.result-card-contact a {
  color: var(--sd-primary);
}

.result-card-notes {
  font-size: 0.85rem;
  color: var(--sd-text-muted);
  font-style: italic;
  border-top: 1px solid var(--sd-border-light);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* === Empty / No Results State === */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--sd-text-muted);
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.empty-state .hint {
  font-size: 0.9rem;
}

/* === Footer === */
.site-footer {
  background: var(--sd-bg-alt);
  border-top: 1px solid var(--sd-border);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--sd-text-muted);
}

/* === Admin Page === */
.admin-bar {
  background: var(--sd-bg-alt);
  border-bottom: 1px solid var(--sd-border);
  padding: 1rem 0;
}

.admin-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.admin-bar .record-count {
  font-size: 0.9rem;
  color: var(--sd-text-muted);
  margin-left: auto;
}

/* Taxonomy editor */
.taxonomy-section {
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  margin: 1.5rem 0;
  overflow: hidden;
}

.taxonomy-header {
  background: var(--sd-bg-alt);
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  user-select: none;
}

.taxonomy-header:hover {
  background: var(--sd-border-light);
}

.taxonomy-header .chevron {
  transition: transform 0.2s;
  font-size: 0.8rem;
}

.taxonomy-header.open .chevron {
  transform: rotate(90deg);
}

.taxonomy-body {
  display: none;
  padding: 1rem;
}

.taxonomy-body.open {
  display: block;
}

.taxonomy-category {
  margin-bottom: 1rem;
}

.taxonomy-category:last-child {
  margin-bottom: 0;
}

.taxonomy-category h3 {
  margin-bottom: 0.5rem;
  color: var(--sd-primary-dark);
}

.taxonomy-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.taxonomy-skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: var(--sd-bg-alt);
  border: 1px solid var(--sd-border);
  border-radius: 999px;
  font-size: 0.8rem;
}

.taxonomy-skill-tag button {
  background: none;
  border: none;
  color: var(--sd-danger);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
}

.taxonomy-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.taxonomy-add input {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  font-family: var(--sd-font);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
}

/* Admin table */
.admin-content {
  padding: 1.5rem 0 3rem;
}

.admin-filter {
  margin-bottom: 1rem;
}

.admin-filter input {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--sd-font);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  width: 100%;
  max-width: 300px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--sd-border-light);
}

.admin-table th {
  background: var(--sd-bg-alt);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.admin-table th:hover {
  background: var(--sd-border-light);
}

.admin-table th .sort-icon {
  margin-left: 0.3rem;
  font-size: 0.7rem;
  opacity: 0.4;
}

.admin-table th .sort-icon.active {
  opacity: 1;
}

.admin-table tr:hover td {
  background: var(--sd-bg-alt);
}

.admin-table .actions {
  white-space: nowrap;
  display: flex;
  gap: 0.4rem;
}

.admin-table .skills-cell {
  max-width: 250px;
}

.admin-table .skills-cell .skill-badge {
  margin: 0.1rem;
}

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--sd-bg-card);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sd-border-light);
}

.modal-header h2 {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--sd-text-muted);
  line-height: 1;
}

.modal-close:hover {
  color: var(--sd-text);
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sd-border-light);
}

/* === Form Elements === */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--sd-text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: var(--sd-font);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--sd-primary);
  box-shadow: 0 0 0 3px rgba(0, 81, 45, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 4rem;
}

.form-skills-group {
  margin-bottom: 1rem;
}

.form-skills-group .filter-group-label {
  margin-bottom: 0.3rem;
}

.form-skills-group .filter-group-options {
  padding: 0.5rem;
  background: var(--sd-bg-alt);
  border-radius: var(--sd-radius);
  border: 1px solid var(--sd-border-light);
}

/* === Password Gate === */
.password-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.password-form {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.password-form h2 {
  margin-bottom: 1rem;
  color: var(--sd-primary-dark);
}

.password-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: var(--sd-font);
  border: 2px solid var(--sd-border);
  border-radius: var(--sd-radius);
  margin-bottom: 0.75rem;
  outline: none;
}

.password-form input:focus {
  border-color: var(--sd-primary);
}

.password-form .error {
  color: var(--sd-danger);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: none;
}

/* === Alert/Toast === */
.alert {
  padding: 0.6rem 1rem;
  border-radius: var(--sd-radius);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-warning {
  background: var(--sd-warning-bg);
  color: #664d03;
  border: 1px solid var(--sd-warning);
}

.alert-danger {
  background: var(--sd-danger-bg);
  color: #842029;
  border: 1px solid var(--sd-danger);
}

.alert-success {
  background: var(--sd-success-bg);
  color: #0f5132;
  border: 1px solid var(--sd-success);
}

/* === Utility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* === Responsive: Tablet (768px) === */
@media (max-width: 768px) {
  .filter-groups {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .filter-group {
    text-align: center;
  }

  .filter-group-options {
    justify-content: center;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .admin-bar .container {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-bar .record-count {
    margin-left: 0;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 0.4rem 0.5rem;
  }

  .modal {
    max-width: 100%;
    margin: 0.5rem;
  }
}

/* === Responsive: Mobile (480px) === */
@media (max-width: 480px) {
  h1 { font-size: 1.35rem; }

  .search-hero {
    padding: 1.25rem 0;
  }

  .filter-group-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .filter-group {
    text-align: left;
  }

  .result-card {
    padding: 1rem;
  }

  .result-card-contact {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* === Dark Mode (must be last) === */
@media (prefers-color-scheme: dark) {
  :root {
    --sd-primary: #40b77a;
    --sd-primary-light: #5ccc94;
    --sd-primary-dark: #2a9d5e;
    --sd-accent: #ffce00;
    --sd-accent-dark: #e6b800;
    --sd-bg: #121a14;
    --sd-bg-alt: #1a2a1e;
    --sd-bg-card: #1e3025;
    --sd-text: #e0e8e2;
    --sd-text-muted: #9eaa9e;
    --sd-border: #2a4a32;
    --sd-border-light: #243d2a;
    --sd-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --sd-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
    --sd-danger: #f77;
    --sd-danger-bg: #3a1a1a;
    --sd-warning: #ffc107;
    --sd-warning-bg: #3a3000;
    --sd-success: #40b77a;
    --sd-success-bg: #1a3a2a;
  }

  .site-header {
    background: #0a1a10;
  }

  .admin-table th {
    background: var(--sd-bg-alt);
  }

  .admin-table th:hover {
    background: var(--sd-border);
  }

  .admin-table tr:hover td {
    background: var(--sd-bg-alt);
  }

  .taxonomy-header {
    background: var(--sd-bg-alt);
  }

  .taxonomy-header:hover {
    background: var(--sd-border);
  }

  .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
  }

  .password-form input {
    background: var(--sd-bg-card);
    color: var(--sd-text);
  }

  .form-group input,
  .form-group textarea,
  .admin-filter input,
  .taxonomy-add input,
  .search-input-wrap input {
    background: var(--sd-bg-card);
    color: var(--sd-text);
  }
}
