/**
 * TabNavigation Component Styles
 * 
 * Follows shadcn design patterns with a gray background and white sliding indicator.
 * Uses only var(--base-*) design tokens for utility/neutral styling.
 * 
 * Design Spec:
 * - Container: base-100 with 4px padding and 8px border radius
 * - Active Tab: white with subtle shadow, 6px border radius
 * - Inactive Tabs: transparent, base-600 text
 * - Hover: text darkens to base-900
 * - Animation: 300ms ease-out slide transition
 */

/* Tab Navigation Container */
.dc-tab-nav {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  background-color: var(--base-100);
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--base-300) transparent;
}

.dc-tab-nav::-webkit-scrollbar {
  height: 6px;
}

.dc-tab-nav::-webkit-scrollbar-track {
  background: transparent;
}

.dc-tab-nav::-webkit-scrollbar-thumb {
  background-color: var(--base-300);
  border-radius: 3px;
}

/* Sliding Indicator */
.dc-tab-nav__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: left 300ms ease-out, width 300ms ease-out;
  pointer-events: none;
  z-index: 0;
}

/* Tab Button — uses .dc-tab-nav scoping to beat Kadence's global button styles */
.dc-tab-nav .dc-tab-nav__tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--base-600);
  background: transparent;
  border: none;
  border-radius: 6px;
  box-shadow: none;
  cursor: pointer;
  transition: color 150ms ease-out;
  outline: none;
}

/* Override Kadence's button:hover/focus/active which sets
   color, background (shorthand), and box-shadow on all <button> elements */
.dc-tab-nav .dc-tab-nav__tab:hover,
.dc-tab-nav .dc-tab-nav__tab:focus,
.dc-tab-nav .dc-tab-nav__tab:active {
  color: var(--base-900);
  background: transparent;
  box-shadow: none;
}

.dc-tab-nav .dc-tab-nav__tab:focus-visible {
  outline: 2px solid var(--base-400);
  outline-offset: 2px;
}

.dc-tab-nav .dc-tab-nav__tab--active {
  color: var(--base-900);
}

/* Tab Label */
.dc-tab-nav__label {
  font-size: 14px;
  line-height: 1.25;
}

/* Count Badge */
.dc-tab-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--base-600);
  background-color: var(--base-200);
  border-radius: 9999px;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.dc-tab-nav__badge--active {
  color: var(--base-700);
  background-color: var(--base-100);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .dc-tab-nav {
    padding: 3px;
    gap: 2px;
  }
  
  .dc-tab-nav__tab {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .dc-tab-nav__label {
    font-size: 13px;
  }
  
  .dc-tab-nav__badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
  }
  
  .dc-tab-nav__indicator {
    top: 3px;
    bottom: 3px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .dc-tab-nav {
    border: 2px solid var(--base-700);
  }
  
  .dc-tab-nav__tab:focus-visible {
    outline-width: 3px;
  }
  
  .dc-tab-nav__indicator {
    border: 2px solid var(--base-700);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .dc-tab-nav__indicator {
    transition: none;
  }
  
  .dc-tab-nav__tab {
    transition: none;
  }
  
  .dc-tab-nav__badge {
    transition: none;
  }
}

/* Print styles - hide tabs */
@media print {
  .dc-tab-nav {
    display: none;
  }
}

/* Person Modal Styles */
.person-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.person-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.person-modal-header {
  flex-shrink: 0;
}

.person-modal-headshot {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 1rem auto;
  display: block;
}

/* Modal headshot container for initials placeholder */
.person-modal-headshot-container {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
}

/* Modal initials placeholder styling */
.person-modal-headshot-container > div {
  border-radius: 50%;
  z-index: 1;
}

/* Ensure modal image has higher z-index */
.person-modal-headshot-container img {
  z-index: 10;
}

.person-modal-name {
  margin: 0.5rem 0 0.25rem 0;
  font-size: 1.75rem;
  font-weight: bold;
}

.person-modal-designation {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  color: #666;
}

.person-modal-socials {
  margin-bottom: 1.5rem;
}

.person-modal-bio {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 1.5rem;
  text-align: left;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Rich text formatting styles within bio */
.person-modal-bio p {
  margin-bottom: 1rem;
}

.person-modal-bio p:last-child {
  margin-bottom: 0;
}

.person-modal-bio h1,
.person-modal-bio h2,
.person-modal-bio h3,
.person-modal-bio h4,
.person-modal-bio h5,
.person-modal-bio h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.person-modal-bio h1:first-child,
.person-modal-bio h2:first-child,
.person-modal-bio h3:first-child,
.person-modal-bio h4:first-child,
.person-modal-bio h5:first-child,
.person-modal-bio h6:first-child {
  margin-top: 0;
}

.person-modal-bio ul,
.person-modal-bio ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.person-modal-bio li {
  margin-bottom: 0.25rem;
}

.person-modal-bio strong {
  font-weight: bold;
}

.person-modal-bio em {
  font-style: italic;
}

.person-modal-bio a {
  color: #2563eb;
  text-decoration: underline;
}

.person-modal-bio a:hover {
  color: #1d4ed8;
}

.person-modal-bio blockquote {
  border-left: 4px solid #e5e7eb;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #6b7280;
}

.person-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  color: #333;
}
.person-modal-close:hover {
  background: none;
  border: none;
  color: #333;
}
.person-modal-close:focus {
  outline: none;
  background: none;
  border: none;
  color: #333;
}

/* Social Icons - Hover Effects */
.dc-person-social:hover {
  background-color: var(--base-200) !important;
  color: var(--base-700) !important;
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

.dc-person-social-email:hover {
  background-color: #ea4335 !important;
  color: white !important;
}

.dc-person-social-facebook:hover {
  background-color: #1877f2 !important;
  color: white !important;
}

.dc-person-social-instagram:hover {
  background-color: #e4405f !important;
  color: white !important;
}

.dc-person-social-x:hover {
  background-color: #000 !important;
  color: white !important;
}

.dc-person-social-tiktok:hover {
  background-color: #000 !important;
  color: white !important;
}

.dc-person-social-linkedin:hover {
  background-color: #0a66c2 !important;
  color: white !important;
}

/* FontAwesome icons are handled by FontAwesome CSS */

/* Clickable elements - show pointer cursor */
.dc-person-modal-trigger {
  cursor: pointer;
}

/* Inline Person Component Spacing */
.dc-person-module .dc-person-headshot {
  margin-bottom: 1rem;
}

.dc-person-module .dc-person-name {
  margin-bottom: 0.5rem;
}

.dc-person-module .dc-person-designation {
  margin-bottom: 0;
}

/* Skeleton Loader Animation */
@keyframes skeleton-pulse {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.6;
  }
}

.animate-pulse {
  animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.dc-person-skeleton {
  pointer-events: none;
}

.dc-person-headshot-skeleton {
  min-height: 120px;
}

/* Aspect ratio utilities for skeleton */
.dc-person-headshot-skeleton.portrait {
  aspect-ratio: 3/4;
}

.dc-person-headshot-skeleton.square {
  aspect-ratio: 1/1;
}

.dc-person-headshot-skeleton.square.rounded-full {
  aspect-ratio: 1/1;
  border-radius: 50%;
}

/* People Archive Tabs */
.people-archive-tabs {
  border-bottom: 1px solid var(--base-200, #e2e8f0);
  padding-bottom: 1rem;
}

.people-archive-tabs .tab-button {
  transition: background-color 0.2s, color 0.2s;
}

.people-archive-tabs .tab-button:focus {
  outline: 2px solid var(--base-400, #94a3b8);
  outline-offset: 2px;
}

/* Family Card Styles */
.family-card {
  border: 1px solid var(--base-200, #e2e8f0);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.family-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--base-300, #cbd5e1);
}

.family-name {
  line-height: 1.3;
}

.family-avatars .person-avatar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.family-children a,
.family-household a {
  transition: background-color 0.2s, box-shadow 0.2s;
}

.family-children a:hover,
.family-household a:hover {
  background-color: var(--base-100, #f1f5f9);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Grid adjustments for families */
@media (max-width: 48rem) {
  .people-archive-content .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

