/* Intracav Wiki - GitLab Handbook Style Design */

/* ============================================
   HANDBOOK LAYOUT STRUCTURE
   ============================================ */

.handbook-body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #ffffff;
}

.dark .handbook-body {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

/* Header */
.handbook-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark .handbook-header {
  background-color: #1e1e1e;
  border-bottom-color: #374151;
}

.handbook-header-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.handbook-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.handbook-logo {
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e40af;
}

.dark .handbook-logo {
  color: #60a5fa;
}

.handbook-logo:hover {
  opacity: 0.8;
}

.handbook-header-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.handbook-header-link {
  text-decoration: none;
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.dark .handbook-header-link {
  color: #9ca3af;
}

.handbook-header-link:hover {
  color: #1e40af;
}

.dark .handbook-header-link:hover {
  color: #60a5fa;
}

.handbook-theme-toggle {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  transition: all 0.2s;
  margin-left: 1rem;
}

.dark .handbook-theme-toggle {
  border-color: #374151;
  color: #9ca3af;
}

.handbook-theme-toggle:hover {
  background-color: #f3f4f6;
  border-color: #3b82f6;
  color: #1e40af;
}

.dark .handbook-theme-toggle:hover {
  background-color: #1f2937;
  border-color: #60a5fa;
  color: #60a5fa;
}

.handbook-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Container */
.handbook-container {
  display: flex;
  min-height: calc(100vh - 60px);
  max-width: 100%;
  margin: 0 auto;
}

/* Sidebar */
.handbook-sidebar {
  width: 280px;
  min-width: 280px;
  background-color: #f9fafb;
  border-right: 1px solid #e5e7eb;
  padding: 2rem 0;
  overflow-y: auto;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
}

.dark .handbook-sidebar {
  background-color: #111827;
  border-right-color: #374151;
}

.handbook-nav {
  padding: 0 1.5rem;
}

.handbook-nav-section {
  margin-bottom: 2rem;
}

.handbook-nav-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin: 0 0 0.75rem 0;
  padding: 0;
}

.dark .handbook-nav-title {
  color: #9ca3af;
}

.handbook-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.handbook-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all 0.2s;
  margin-bottom: 0.25rem;
}

.dark .handbook-nav-link {
  color: #d1d5db;
}

.handbook-nav-link:hover {
  background-color: #f3f4f6;
  color: #1e40af;
}

.dark .handbook-nav-link:hover {
  background-color: #1f2937;
  color: #60a5fa;
}

.handbook-nav-link.active {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 500;
}

.dark .handbook-nav-link.active {
  background-color: #1e3a8a;
  color: #93c5fd;
}

/* Main Content */
.handbook-main {
  flex: 1;
  padding: 3rem 4rem;
  max-width: 900px;
  min-width: 0;
}

@media (max-width: 1024px) {
  .handbook-main {
    padding: 2rem 2.5rem;
  }
}

@media (max-width: 768px) {
  .handbook-sidebar {
    display: none;
  }
  
  .handbook-main {
    padding: 1.5rem;
    max-width: 100%;
  }
}

/* ============================================
   CONTENT STYLES
   ============================================ */

/* Page Header */
.handbook-page-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.dark .handbook-page-header {
  border-bottom-color: #374151;
}

.handbook-page-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem 0;
  color: #111827;
}

.dark .handbook-page-title {
  color: #f9fafb;
}

.handbook-page-description {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.dark .handbook-page-description {
  color: #9ca3af;
}

/* Breadcrumbs */
.handbook-breadcrumbs {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dark .handbook-breadcrumbs {
  color: #9ca3af;
}

.handbook-breadcrumbs a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}

.dark .handbook-breadcrumbs a {
  color: #9ca3af;
}

.handbook-breadcrumbs a:hover {
  color: #1e40af;
}

.dark .handbook-breadcrumbs a:hover {
  color: #60a5fa;
}

.handbook-breadcrumbs-separator {
  color: #d1d5db;
}

.handbook-breadcrumbs-current {
  color: #111827;
  font-weight: 500;
}

.dark .handbook-breadcrumbs-current {
  color: #f9fafb;
}

/* Content */
.handbook-content {
  line-height: 1.8;
  color: #374151;
}

.dark .handbook-content {
  color: #e5e7eb;
}

.handbook-content h1,
.handbook-content h2,
.handbook-content h3,
.handbook-content h4,
.handbook-content h5,
.handbook-content h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #111827;
}

.dark .handbook-content h1,
.dark .handbook-content h2,
.dark .handbook-content h3,
.dark .handbook-content h4,
.dark .handbook-content h5,
.dark .handbook-content h6 {
  color: #f9fafb;
}

.handbook-content h1 {
  font-size: 2.25rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.dark .handbook-content h1 {
  border-bottom-color: #374151;
}

.handbook-content h2 {
  font-size: 1.875rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.dark .handbook-content h2 {
  border-bottom-color: #374151;
}

.handbook-content h3 {
  font-size: 1.5rem;
}

.handbook-content h4 {
  font-size: 1.25rem;
}

.handbook-content p {
  margin-bottom: 1.25rem;
}

.handbook-content ul,
.handbook-content ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.handbook-content li {
  margin-bottom: 0.5rem;
}

.handbook-content code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  color: #dc2626;
}

.dark .handbook-content code {
  background-color: #1f2937;
  color: #fca5a5;
}

.handbook-content pre {
  background-color: #1f2937;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid #374151;
}

.dark .handbook-content pre {
  background-color: #0f172a;
  border-color: #1e293b;
}

.handbook-content pre code {
  background-color: transparent;
  color: #e5e7eb;
  padding: 0;
}

.handbook-content blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: #6b7280;
  font-style: italic;
}

.dark .handbook-content blockquote {
  border-left-color: #60a5fa;
  color: #9ca3af;
}

/* Article Cards */
.handbook-article-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.handbook-article-card {
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s;
}

.dark .handbook-article-card {
  border-color: #374151;
  background-color: #1f2937;
}

.handbook-article-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.handbook-article-card h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  border: none;
  padding: 0;
}

.handbook-article-card h2 a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s;
}

.dark .handbook-article-card h2 a {
  color: #f9fafb;
}

.handbook-article-card h2 a:hover {
  color: #1e40af;
}

.dark .handbook-article-card h2 a:hover {
  color: #60a5fa;
}

.handbook-article-description {
  color: #6b7280;
  margin: 0.5rem 0 1rem 0;
  line-height: 1.6;
}

.dark .handbook-article-description {
  color: #9ca3af;
}

.handbook-article-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .handbook-article-meta {
  color: #9ca3af;
}

/* Badges */
.handbook-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.handbook-badge-policies {
  background-color: #dbeafe;
  color: #1e40af;
}

.dark .handbook-badge-policies {
  background-color: #1e3a8a;
  color: #93c5fd;
}

.handbook-badge-blog {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.dark .handbook-badge-blog {
  background-color: #5b21b6;
  color: #c4b5fd;
}

.handbook-badge-category {
  background-color: #f3f4f6;
  color: #374151;
}

.dark .handbook-badge-category {
  background-color: #374151;
  color: #d1d5db;
}

.handbook-badge-audience-clinician {
  background-color: #dbeafe;
  color: #1e40af;
}

.dark .handbook-badge-audience-clinician {
  background-color: #1e3a8a;
  color: #93c5fd;
}

.handbook-badge-audience-patient {
  background-color: #fef3c7;
  color: #92400e;
}

.dark .handbook-badge-audience-patient {
  background-color: #78350f;
  color: #fcd34d;
}

/* Pagination */
.handbook-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.dark .handbook-pagination {
  border-top-color: #374151;
}

.handbook-pagination-link {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
}

.dark .handbook-pagination-link {
  color: #d1d5db;
  border-color: #374151;
}

.handbook-pagination-link:hover {
  background-color: #f3f4f6;
  border-color: #3b82f6;
  color: #1e40af;
}

.dark .handbook-pagination-link:hover {
  background-color: #1f2937;
  border-color: #60a5fa;
  color: #60a5fa;
}

.handbook-pagination-info {
  color: #6b7280;
  font-size: 0.875rem;
}

.dark .handbook-pagination-info {
  color: #9ca3af;
}

/* Terms/Tags Grid */
.handbook-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Filter Controls */
.handbook-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.dark .handbook-filter-controls {
  background-color: #1f2937;
  border-color: #374151;
}

.handbook-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 150px;
}

.handbook-filter-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.dark .handbook-filter-label {
  color: #d1d5db;
}

.handbook-filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #111827;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.dark .handbook-filter-select {
  background-color: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.handbook-filter-select:hover {
  border-color: #3b82f6;
}

.handbook-filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.handbook-filter-clear {
  padding: 0.5rem 1rem;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.handbook-filter-clear:hover {
  background-color: #dc2626;
}

.dark .handbook-filter-clear {
  background-color: #991b1b;
}

.dark .handbook-filter-clear:hover {
  background-color: #7f1d1d;
}

.handbook-term-meta {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.handbook-term-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

@media (max-width: 768px) {
  .handbook-filter-controls {
    flex-direction: column;
  }
  
  .handbook-filter-group {
    width: 100%;
  }
  
  .handbook-filter-clear {
    width: 100%;
  }
}

.handbook-term-card {
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #ffffff;
  transition: all 0.2s;
}

.dark .handbook-term-card {
  border-color: #374151;
  background-color: #1f2937;
}

.handbook-term-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.handbook-term-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  border: none;
  padding: 0;
}

.handbook-term-card h2 a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s;
}

.dark .handbook-term-card h2 a {
  color: #f9fafb;
}

.handbook-term-card h2 a:hover {
  color: #1e40af;
}

.dark .handbook-term-card h2 a:hover {
  color: #60a5fa;
}

.handbook-term-count {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0.5rem 0;
}

.dark .handbook-term-count {
  color: #9ca3af;
}

.handbook-term-description {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0.5rem 0 0 0;
  line-height: 1.5;
}

.dark .handbook-term-description {
  color: #9ca3af;
}

/* Empty State */
.handbook-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.dark .handbook-empty-state {
  color: #9ca3af;
}

.handbook-empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

.dark .handbook-empty-state h2 {
  color: #d1d5db;
}

.handbook-empty-state p {
  margin: 0;
}

/* Page Footer */
.handbook-page-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.dark .handbook-page-footer {
  border-top-color: #374151;
}

.handbook-footer-section {
  margin-bottom: 1.5rem;
}

.handbook-footer-section:last-child {
  margin-bottom: 0;
}

.handbook-footer-label {
  display: block;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .handbook-footer-label {
  color: #9ca3af;
}

.handbook-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.handbook-footer-badges .handbook-badge {
  text-decoration: none;
  transition: all 0.2s;
}

.handbook-footer-badges .handbook-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Home Page */
.handbook-home-intro {
  margin-bottom: 4rem;
}

.handbook-home-intro h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
}

.handbook-home-intro p {
  font-size: 1.25rem;
  color: #6b7280;
  line-height: 1.8;
}

.dark .handbook-home-intro p {
  color: #9ca3af;
}

.handbook-home-sections {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.handbook-home-section {
  margin-bottom: 2rem;
}

.handbook-section-title {
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.75rem;
  color: #111827;
}

.dark .handbook-section-title {
  border-bottom-color: #374151;
  color: #f9fafb;
}

.handbook-section-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.handbook-section-title a:hover {
  color: #1e40af;
}

.dark .handbook-section-title a:hover {
  color: #60a5fa;
}

.handbook-section-description {
  color: #6b7280;
  font-size: 1rem;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
}

.dark .handbook-section-description {
  color: #9ca3af;
}

.handbook-section-more {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.dark .handbook-section-more {
  border-top-color: #374151;
}

.handbook-section-more a {
  color: #1e40af;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.dark .handbook-section-more a {
  color: #60a5fa;
}

.handbook-section-more a:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

.dark .handbook-section-more a:hover {
  color: #93c5fd;
}

.handbook-article-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  border: none;
  padding: 0;
}

.handbook-article-card h3 a {
  color: #111827;
  text-decoration: none;
  transition: color 0.2s;
}

.dark .handbook-article-card h3 a {
  color: #f9fafb;
}

.handbook-article-card h3 a:hover {
  color: #1e40af;
}

.dark .handbook-article-card h3 a:hover {
  color: #60a5fa;
}

/* Footer */
.handbook-footer {
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 0;
  margin-top: 4rem;
}

.dark .handbook-footer {
  background-color: #111827;
  border-top-color: #374151;
}

.handbook-footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.handbook-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.handbook-footer-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

.dark .handbook-footer-text {
  color: #9ca3af;
}

.handbook-footer-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.handbook-footer-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s;
  padding: var(--space-1) var(--space-2);
  border-radius: 4px;
}

.dark .handbook-footer-link {
  color: #9ca3af;
}

.handbook-footer-link:hover {
  color: #1e40af;
  background-color: #f3f4f6;
}

.dark .handbook-footer-link:hover {
  color: #60a5fa;
  background-color: #1f2937;
}

.handbook-footer-link svg {
  opacity: 0.5;
  transition: all 0.2s;
}

.handbook-footer-link:hover svg {
  opacity: 1;
  transform: translateX(2px);
}

@media (max-width: 768px) {
  .handbook-footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .handbook-footer-links {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .handbook-header-nav {
    display: none;
  }
  
  .handbook-main {
    padding: 1.5rem;
  }
  
  .handbook-page-title {
    font-size: 2rem;
  }

  .handbook-terms-grid {
    grid-template-columns: 1fr;
  }

  .handbook-home-intro h1 {
    font-size: 2.25rem;
  }
}
