/* Main CSS File */
/* AI Community Hub - Base Styles and Components */

/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1rem 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
}

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

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

/* Ghost Layout */
.gh-viewport {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.gh-main {
  flex: 1;
}

/* Header Styles */
.gh-head {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(10px);
}


.gh-head-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 24px;
}

.gh-head-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-right: auto;
}

.gh-head-menu {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.gh-head-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}

.gh-head-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

/* Branding colors inherit from layout-specific overrides */
.gh-site-title .gh-site-talentpros,
.gh-site-title .gh-site-period {
  color: inherit;
}

.gh-head-logo img {
  height: 40px;
  width: auto;
}

.gh-head-menu a {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.gh-head-menu a:hover {
  color: var(--primary-color);
}

.gh-head-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gh-head-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.gh-primary-btn {
  background: var(--primary-color);
  color: var(--text-inverse);
}

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

/* Footer Styles */
.gh-foot {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  margin-top: 4rem;
}

.gh-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.gh-foot-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.gh-foot-menu a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
}

.gh-foot-menu a:hover {
  color: var(--primary-color);
}

.gh-foot-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gh-foot-meta-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.gh-foot-meta-centered .gh-foot-copyright,
.gh-foot-meta-centered .gh-foot-powered {
  margin: 0;
}

.gh-foot-meta-centered a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.gh-foot-meta-centered a:hover {
  color: var(--accent-color);
}

/* Job Listings Styles */

.gh-jobs-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%; /* Force it to take full parent height */
}

.gh-jobs-container.gh-jobs-show-all {
  overflow-y: auto;
  height: 100%;
  max-height: none;
  padding-right: 0.25rem;
}

.gh-card-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
}

.gh-card-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.gh-card-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.gh-job-filters,
.gh-job-counts,
.gh-job-count,
.gh-job-item {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.gh-job-count {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.gh-job-count p {
  margin: 0;
}

.gh-job-item {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
}

.gh-job-item:hover {
  background: var(--bg-secondary);
}

.gh-job-item:last-child {
  border-bottom: none;
}

.gh-job-header {
  margin-bottom: 1rem;
}

.gh-job-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gh-job-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.gh-job-title a:hover {
  color: var(--primary-color);
}

.gh-job-company {
  color: var(--text-secondary);
  font-weight: 500;
}

.gh-job-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gh-job-details > div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gh-job-icon {
  font-size: 0.875rem;
}

.gh-job-description {
  margin-bottom: 1rem;
}

.gh-job-summary {
  color: var(--text-secondary);
  line-height: 1.5;
}

.gh-job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gh-job-tag {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gh-job-tag:hover,
.gh-job-tag.selected {
  background: var(--accent-color);
  color: white;
}

.gh-job-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-job-posted {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gh-job-apply {
  font-size: 0.875rem;
}

#jobsViewAllButton[disabled] {
  opacity: 0.7;
  pointer-events: none;
}

/* Job Filter Styles */
.gh-filter-header {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gh-filter-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gh-popular-tag {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin: 0.25rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.gh-popular-tag:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.gh-popular-tag:active {
  transform: translateY(0);
}

.gh-active-filter {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  margin: 0.25rem;
  background: var(--primary-color);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.gh-remove-filter {
  margin-left: 0.5rem;
  cursor: pointer;
  font-weight: bold;
  opacity: 0.8;
}

.gh-remove-filter:hover {
  opacity: 1;
}

.gh-clear-filters {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gh-clear-filters:hover {
  background: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

.gh-loading-tags {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 0.875rem;
}

.gh-tags-error {
  color: var(--danger-color);
  font-size: 0.875rem;
}

/* News Feed Styles */
.gh-news-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
}

.gh-news-item:hover {
  background: var(--bg-secondary);
}

.gh-news-item:last-child {
  border-bottom: none;
}

.gh-news-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.gh-news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gh-news-source {
  font-weight: 500;
}

.gh-news-type-badge {
  padding: 0.25rem 0.5rem;
  background: var(--success-color);
  color: var(--text-inverse);
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: 4px;
  text-transform: uppercase;
}

.gh-news-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gh-news-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.gh-news-title a:hover {
  color: var(--primary-color);
}

.gh-news-summary {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.gh-news-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-news-engagement {
  display: flex;
  gap: 0.5rem;
}

.gh-news-action {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.gh-news-action:hover {
  background: var(--bg-secondary);
}

.gh-news-icon {
  font-size: 0.875rem;
}

/* Research Papers Styles */
.gh-research-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
}

.gh-research-item:hover {
  background: var(--bg-secondary);
}

.gh-research-item:last-child {
  border-bottom: none;
}

.gh-research-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.gh-research-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gh-research-venue {
  font-weight: 500;
}

.gh-research-badges {
  display: flex;
  gap: 0.5rem;
}

.gh-research-badge {
  padding: 0.25rem 0.5rem;
  background: var(--accent-color);
  color: var(--text-inverse);
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: 4px;
  text-transform: uppercase;
}

.gh-research-card-gpt5 {
  margin-top: 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.gh-research-card-header {
  margin-bottom: 1.25rem;
}

.gh-research-card-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.gh-research-card-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gh-research-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gh-form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.gh-form-group input,
.gh-form-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.gh-form-group select[multiple] {
  min-height: 8rem;
}

.gh-form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.gh-form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.gh-form-group-range {
  flex: 1 1 220px;
}

.gh-form-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gh-form-actions {
  display: flex;
  gap: 0.75rem;
}

.gh-research-feedback {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.gh-research-feedback.is-loading {
  color: var(--accent-color);
}

.gh-research-feedback.is-error {
  color: #ef4444;
}

.gh-research-feedback.is-success {
  color: #10b981;
}

.gh-research-feedback.is-notice {
  color: var(--text-muted);
}

.gh-research-results {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1; /* Take available space */
  min-height: 0; /* Allow flex to calculate height */
  overflow-y: auto; /* Allow scrolling of results */
}

.gh-research-result-card {
  background: var(--bg-primary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto; /* Don't grow to fill space */
}

.gh-research-result-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gh-research-result-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gh-research-result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.gh-research-result-title:hover {
  text-decoration: underline;
}

.gh-research-result-authors {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.gh-research-result-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.gh-research-result-actions {
  display: flex;
  gap: 0.75rem;
}

.gh-research-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1rem;
}

@media (max-width: 768px) {
  .gh-form-actions {
    flex-direction: column;
  }

  .gh-form-range-inputs {
    flex-direction: column;
    align-items: stretch;
  }

  .gh-research-result-meta {
    flex-wrap: wrap;
  }
}

.gh-research-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gh-research-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.gh-research-title a:hover {
  color: var(--primary-color);
}

.gh-research-authors {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.gh-research-authors-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.gh-research-authors-list {
  color: var(--text-muted);
}

.gh-research-abstract {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.gh-research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gh-research-tag {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gh-research-tag:hover,
.gh-research-tag.selected {
  background: var(--accent-color, #007cba);
  color: white;
  border-color: var(--accent-color, #007cba);
}

/* News Tags */
.gh-news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.gh-news-tag {
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.gh-news-tag:hover,
.gh-news-tag.selected {
  background: var(--accent-color);
  color: white;
}

.gh-research-metrics {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gh-research-metric {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.gh-research-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-research-actions {
  display: flex;
  gap: 0.5rem;
}

.gh-research-action {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color var(--transition-fast);
}

.gh-research-action:hover {
  background: var(--bg-secondary);
}

.gh-research-links {
  display: flex;
  gap: 0.5rem;
}

/* Modal Styles */
.gh-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gh-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.gh-modal-container {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
}

.gh-modal-small {
  max-width: 400px;
}

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

.gh-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.gh-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-muted);
}

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

.gh-modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

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

/* Filter Styles */
.gh-filter-group {
  margin-bottom: 1.5rem;
}

.gh-filter-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.gh-filter-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.gh-filter-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.gh-filter-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0;
  cursor: pointer;
}

.gh-filter-checkboxes input[type="checkbox"] {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gh-head-inner {
    padding: 1rem 16px;
  }

  .gh-head-menu {
    display: none;
  }

  .gh-foot-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 0 16px;
    justify-content: center;
  }

  .gh-foot-meta-centered {
    font-size: 0.8rem;
  }

  .gh-modal-container {
    width: 95%;
  }

  .gh-filter-checkboxes {
    grid-template-columns: 1fr;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus Styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Koenig Editor Support */
.kg-width-wide {
  width: 100vw;
  max-width: 1200px;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-width-full {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  max-width: 1040px;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.kg-gallery-image {
  margin: 0 5px;
}

.kg-gallery-image img {
  display: block;
  margin: 0;
  width: 100%;
  height: 100%;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border-light: #000000;
    --border-medium: #000000;
    --border-dark: #000000;
  }
}
