/* Kaandorp Family Tree - Tailwind Dark Style */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background-color: #0f172a; /* slate-900 */
  color: #f8fafc; /* slate-50 */
  height: 100vh;
  overflow: hidden; /* Prevent page scrolling */
}

/* Application container */
.app-container {
  height: 100vh;
  background-color: #0f172a; /* slate-900 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Disclaimer bar */
.disclaimer-bar {
  background-color: #dc2626; /* red-600 */
  border-bottom: 1px solid #b91c1c; /* red-700 */
  padding: 0.5rem 1rem; /* py-2 px-4 */
  text-align: center;
  z-index: 60;
  flex-shrink: 0; /* Prevent shrinking */
  /* Prevent zoom on mobile */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.disclaimer-text {
  color: #fef2f2; /* red-50 */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  line-height: 1.25; /* leading-5 */
}

.disclaimer-text strong {
  font-weight: 700; /* font-bold */
  color: #ffffff; /* white */
}

/* Compact search header */
.search-container {
  background-color: #1e293b; /* slate-800 */
  border-bottom: 1px solid #334155; /* slate-700 */
  padding: 0.75rem 1rem; /* py-3 px-4 */
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(30, 41, 59, 0.95); /* semi-transparent slate-800 */
  flex-shrink: 0; /* Prevent shrinking */
  /* Prevent zoom on mobile */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.search-header {
  max-width: 1280px; /* max-w-7xl */
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.title-logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.search-title {
  font-size: 1.125rem; /* text-lg */
  font-weight: 600; /* font-semibold */
  color: #f8fafc; /* slate-50 */
  margin: 0;
  flex-shrink: 0;
}

.header-logo {
  height: 2rem; /* 32px */
  width: auto;
  flex-shrink: 0;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 40rem; /* Increased width to accommodate checkbox */
}

/* Search input styling */
.search-container input[type="text"] {
  background-color: #334155; /* slate-700 */
  border: 1px solid #475569; /* slate-600 */
  border-radius: 0.375rem; /* rounded-md */
  padding: 0.5rem 0.75rem; /* py-2 px-3 */
  font-size: 0.875rem; /* text-sm */
  color: #f8fafc; /* slate-50 */
  width: 100%;
  transition: all 0.15s ease-in-out;
  /* Prevent zoom on mobile */
  touch-action: manipulation;
}

.search-container input[type="text"]:focus {
  outline: none;
  border-color: #3b82f6; /* blue-500 */
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* blue-500 with opacity */
  background-color: #475569; /* slate-600 */
}

.search-container input[type="text"]::placeholder {
  color: #94a3b8; /* slate-400 */
}

/* Button styling */
.search-container button {
  background-color: #3b82f6; /* blue-500 */
  color: white;
  border: none;
  border-radius: 0.375rem; /* rounded-md */
  padding: 0.5rem 1rem; /* py-2 px-4 */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  /* Prevent zoom on mobile */
  touch-action: manipulation;
}

.search-container button:hover {
  background-color: #2563eb; /* blue-600 */
}

.search-container button:active {
  background-color: #1d4ed8; /* blue-700 */
  transform: scale(0.98);
}

/* Checkbox styling */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f8fafc; /* slate-50 */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.5rem 0.75rem; /* py-2 px-3 */
  background-color: #334155; /* slate-700 */
  border: 1px solid #475569; /* slate-600 */
  border-radius: 0.375rem; /* rounded-md */
  transition: all 0.15s ease-in-out;
}

.checkbox-label:hover {
  background-color: #475569; /* slate-600 */
  border-color: #64748b; /* slate-500 */
}

.checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  appearance: none;
  background-color: #1e293b; /* slate-800 */
  border: 2px solid #64748b; /* slate-500 */
  border-radius: 0.25rem; /* rounded */
  transition: all 0.15s ease-in-out;
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
  background-color: #3b82f6; /* blue-500 */
  border-color: #3b82f6; /* blue-500 */
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem; /* text-xs */
  font-weight: bold;
  line-height: 1;
}

.checkbox-label input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* blue-500 with opacity */
}

/* Chart container - maximized for full screen */
#chart {
  background-color: #0f172a; /* slate-900 */
  flex: 1; /* Take remaining space */
  padding: 3rem; /* Increased padding to accommodate node margins */
  overflow: hidden; /* Prevent chart from causing page scroll */
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Ensure SVG and dTree containers don't clip content */
#chart svg {
  overflow: visible;
}

#chart .dTree {
  overflow: visible;
}

/* Ensure proper spacing around nodes */
#chart foreignObject {
  overflow: visible;
}

/* Tree connection lines */
.linage {
  fill: none;
  stroke: #64748b; /* slate-500 */
  stroke-width: 1.5;
  opacity: 0.8;
}

.marriage {
  fill: none;
  stroke: #94a3b8; /* slate-400 */
  stroke-width: 1.5;
  opacity: 0.7;
}

/* Generation indicators */
.halfrem {
  font-size: 0.75rem; /* text-xs */
  opacity: 0.8;
  font-weight: 400; /* font-normal */
  margin-top: 0.25rem; /* mt-1 */
  display: block;
}

/* Person node styling - Dark Tailwind theme */
.person {
  font-size: 0.875rem; /* text-sm */
  font-weight: 600; /* font-semibold */
  line-height: 1.4; /* leading-normal */
  padding: 0.875rem 1rem; /* py-3.5 px-4 */
  
  /* Kaandorp family - black background with white border */
  background: #000000; /* black background */
  border: 2px solid #ffffff; /* white border */
  border-radius: 0.75rem; /* rounded-xl */
  color: #f8fafc; /* slate-50 text */
  
  /* Modern shadow for depth */
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1); /* subtle white glow */
  
  cursor: pointer;
  
  /* Touch behavior */
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
  
  /* Subtle inner highlight */
  background-clip: padding-box;
}

.person:hover {
  border-color: #e5e7eb; /* gray-200 for subtle hover change */
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2); /* enhanced white glow */
  background: #111827; /* gray-900 for hover */
}

/* Non-Kaandorp family members - muted styling */
.non-kaandorp .person {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%); /* gray-700 to gray-600 gradient */
  border: 2px solid #6b7280; /* gray-500 border */
  color: #d1d5db; /* gray-300 text */
  
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.2),
    0 2px 4px -1px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(107, 114, 128, 0.1); /* subtle gray glow */
}

.non-kaandorp .person:hover {
  border-color: #9ca3af; /* gray-400 */
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%); /* gray-600 to gray-500 */
  
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(156, 163, 175, 0.15); /* enhanced gray glow */
}

/* Emphasis styling */
.emphasis {
  font-style: italic;
  font-weight: 600; /* font-semibold */
}

/* Reset paragraph margins */
p {
  padding: 0;
  margin: 0;
}

/* Graph interaction */
#graph {
  cursor: grab;
}

#graph:active {
  cursor: grabbing;
}

/* Error message styling - Dark theme */
p[style*="color: red"] {
  background-color: #7f1d1d; /* red-900 */
  color: #fecaca; /* red-200 */
  border: 1px solid #dc2626; /* red-600 */
  border-radius: 0.5rem; /* rounded-lg */
  padding: 0.75rem 1rem; /* py-3 px-4 */
  margin: 1rem;
  font-weight: 500; /* font-medium */
}

/* Responsive design */
@media (max-width: 768px) {
  .disclaimer-bar {
    display: none; /* Hide disclaimer on mobile */
  }
  
  .search-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .title-logo-container {
    justify-content: center;
  }
  
  .search-title {
    text-align: center;
    font-size: 1rem; /* text-base */
  }
  
  .header-logo {
    height: 1.5rem; /* Smaller on mobile */
  }
  
  .search-controls {
    max-width: none;
  }
  
  #chart {
    padding: 1rem; /* Keep adequate padding on mobile */
  }
}

@media (max-width: 480px) {
  .disclaimer-bar {
    display: none; /* Hide disclaimer on small mobile */
  }
  
  .search-container {
    padding: 0.5rem; /* p-2 */
  }
  
  .search-title {
    font-size: 0.875rem; /* text-sm */
  }
  
  .header-logo {
    height: 1.25rem; /* Even smaller on small mobile */
  }
  
  .search-container input[type="text"],
  .search-container button {
    padding: 0.375rem 0.75rem; /* py-1.5 px-3 */
    font-size: 0.75rem; /* text-xs */
  }
}

/* Utility classes for dark theme consistency */
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-700 { background-color: #334155; }
.text-slate-50 { color: #f8fafc; }
.text-slate-400 { color: #94a3b8; }
.border-slate-700 { border-color: #334155; }
.border-slate-600 { border-color: #475569; }

/* Print styles */
@media print {
  .search-container {
    display: none;
  }
  
  body, #chart {
    background-color: white !important;
    color: black !important;
  }
  
  .linage, .marriage {
    stroke: black !important;
  }
}
