/* ========================================
   RASHAN VILLAGE WEBSITE - CUSTOM STYLES
   Modern, Clean, and Performance-Focused
   ======================================== */

/* Hero Background Styles */
.hero-background {
  background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.15)),
    url("images/Deliqi.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  min-height: 40vh;
}

/* Hero Section for Family Tree */
.hero {
  background: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 15%,
    #f093fb 30%,
    #f5576c 45%,
    #4facfe 60%,
    #00f2fe 75%,
    #43e97b 90%,
    #38f9d7 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 25%,
    rgba(240, 147, 251, 0.1) 50%,
    rgba(245, 87, 108, 0.1) 75%,
    rgba(67, 233, 123, 0.1) 100%
  );
  animation: gradientShift 25s ease infinite reverse;
  z-index: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-text {
  color: white;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: #3b82f6;
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn-hero:hover::before {
  left: 100%;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.family-tree-preview {
  position: relative;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: float 6s ease-in-out infinite;
  overflow: hidden;
}

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  margin: 0.3rem;
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.7rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: absolute;
}

.tree-node.root {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  font-size: 0.9rem;
  z-index: 10;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tree-node.branch {
  position: absolute;
  animation: pulse 2s ease-in-out infinite;
}

.tree-node.branch.primary {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
}

.tree-node.branch.small {
  width: 40px;
  height: 40px;
  font-size: 0.6rem;
  color: #4a5568;
}

.tree-node.branch.other {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #16a085, #1abc9c);
  color: white;
  font-size: 0.6rem;
  font-weight: bold;
}

/* Positioning for all family nodes */
.tree-node.branch:nth-child(2) {
  /* Kërleshi - primary */
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 0.5s;
}

.tree-node.branch:nth-child(3) {
  /* Çela */
  top: 60px;
  left: 80px;
  animation-delay: 1s;
}

.tree-node.branch:nth-child(4) {
  /* Smakolli */
  top: 60px;
  right: 80px;
  animation-delay: 1.2s;
}

.tree-node.branch:nth-child(5) {
  /* Sadiku */
  top: 120px;
  left: 50px;
  animation-delay: 1.4s;
}

.tree-node.branch:nth-child(6) {
  /* Rrudhani */
  top: 120px;
  right: 50px;
  animation-delay: 1.6s;
}

.tree-node.branch:nth-child(7) {
  /* Bllata */
  bottom: 120px;
  left: 60px;
  animation-delay: 1.8s;
}

.tree-node.branch:nth-child(8) {
  /* Shartari */
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 2s;
}

.tree-node.branch:nth-child(9) {
  /* Sumiqi */
  bottom: 120px;
  right: 60px;
  animation-delay: 2.2s;
}

.tree-node.branch:nth-child(10) {
  /* Ibra */
  bottom: 80px;
  left: 100px;
  animation-delay: 2.4s;
}

.tree-node.branch:nth-child(11) {
  /* Kaqiku */
  bottom: 80px;
  right: 100px;
  animation-delay: 2.6s;
}

.tree-node.branch:nth-child(12) {
  /* Rrukeci */
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 2.8s;
}

.tree-node.branch:nth-child(13) {
  /* Other families */
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation-delay: 3s;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.5rem;
  animation: bounce 2s infinite;
  cursor: pointer;
  z-index: 10;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Responsive hero background for mobile */
@media (max-width: 768px) {
  .hero-background {
    background-attachment: scroll;
    min-height: 35vh;
    background-position: center center;
  }
}

/* Ensure smooth loading of background image */
.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.25));
  z-index: 1;
}

/* Force background image to load and position correctly */
.hero-background {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Typography - Modern Scale */
.text-heading-1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.text-heading-2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

.text-heading-3 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.text-body-large {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.text-body {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.text-lead {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Layout Components - Optimized */
.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section-alt {
  background-color: #f8fafc;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Card Components - Modern Design */
.card {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07),
    0 10px 20px -2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}

/* Feature Cards - Enhanced */
.feature-card {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 2rem;
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07),
    0 10px 20px -2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
}

.feature-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.feature-card:hover {
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-6px);
}

/* News Cards - Modern Design */
.news-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 2px 15px -3px rgba(0, 0, 0, 0.07),
    0 10px 20px -2px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  max-width: 400px; /* Prevent cards from becoming too wide */
  width: 100%;
}

.news-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.news-card:hover {
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-6px);
}

.news-image-container {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .news-image {
  transform: scale(1.05);
}

.news-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.news-category {
  background: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.news-content {
  padding: 1.5rem;
}

.news-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.news-date,
.news-author {
  display: flex;
  align-items: center;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.news-excerpt {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.news-link {
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-link:hover {
  color: #2563eb;
  transform: translateX(4px);
}

/* Form Input Styling */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: white;
}

.form-input:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Button Components - Modern Design */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: #2e7d32;
  color: white;
  box-shadow: 0 4px 25px -5px rgba(46, 125, 50, 0.1),
    0 10px 10px -5px rgba(46, 125, 50, 0.04);
}

.btn-primary:hover {
  background: #1b5e20;
  box-shadow: 0 10px 40px -10px rgba(46, 125, 50, 0.1),
    0 20px 25px -5px rgba(46, 125, 50, 0.04);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f8fafc;
  color: #1f2937;
  border: 2px solid #1f2937;
}

.btn-secondary:hover {
  background: #1f2937;
  color: white;
}

.btn-accent {
  background: #3b82f6;
  color: white;
  box-shadow: 0 4px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-accent:hover {
  background: #2563eb;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1),
    0 20px 25px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

/* Animations - Optimized */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in {
  animation: slideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  .section {
    padding: clamp(2rem, 6vw, 4rem) 0;
  }

  .card {
    padding: 1.5rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .news-content {
    padding: 1rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  .news-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: clamp(1.5rem, 4vw, 3rem) 0;
  }

  .card {
    padding: 1rem;
  }

  .feature-card {
    padding: 1rem;
  }
}

/* Accessibility - Enhanced */
.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;
}

.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #1f2937;
  color: white;
  border-radius: 0.5rem;
  z-index: 1000;
}

/* Focus styles - Modern */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card,
  .feature-card,
  .news-card {
    border: 2px solid #000;
  }

  .btn {
    border: 2px solid currentColor;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* Family Tree Specific Styles */

/* Section Headers */
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #1f2937, #3b82f6);
  border-radius: 2px;
}

.section-description {
  font-size: 1.2rem;
  color: #666;
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

/* Search Section */
.search-section {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.search-container {
  max-width: 800px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 50px;
  font-size: 1.1rem;
  background: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.search-clear {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.search-clear:hover {
  background: #f3f4f6;
  color: #2e7d32;
}

.search-filters {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #e5e7eb;
  background: white;
  color: #666;
  border-radius: 25px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* Tree Visualization */
.tree-visualization-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 3rem;
}

.tree-header {
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.tree-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.tree-subtitle {
  font-size: 1rem;
  opacity: 0.9;
  margin: 0.5rem 0 0 0;
}

.tree-controls {
  display: flex;
  gap: 0.5rem;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.tree-container {
  padding: 2rem;
  background: #f8fafc;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tree-svg-container {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  cursor: grab;
}

.tree-svg-container:active {
  cursor: grabbing;
}

/* Family Overview Section */
.family-overview-section {
  margin: 4rem 0;
}

.overview-card {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border-radius: 20px;
  padding: 3rem;
  color: #1f2937;
  position: relative;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.overview-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: rgba(31, 41, 55, 0.05);
  border-radius: 50%;
  transform: translate(50%, -50%);
}

.overview-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.overview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(31, 41, 55, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
  color: #1f2937;
}

.overview-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: #1f2937;
}

.overview-description {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0.8;
  color: #4b5563;
}

.overview-features {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4b5563;
}

.feature-item i {
  color: #3b82f6;
}

.overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(31, 41, 55, 0.1);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  background: rgba(31, 41, 55, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.2rem;
  color: #3b82f6;
}

.stat-content {
  color: #1f2937;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.7;
  font-weight: 500;
  color: #6b7280;
}

/* Add Family Section */
.add-family-section {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 4rem 0;
  margin-top: 4rem;
}

.add-family-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.add-family-content {
  text-align: center;
}

.add-family-header {
  margin-bottom: 3rem;
}

.add-family-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #1f2937, #374151);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 2rem;
  color: white;
  box-shadow: 0 10px 30px rgba(31, 41, 55, 0.3);
}

.add-family-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
}

.add-family-description {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

.add-family-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  min-width: 200px;
}

.add-family-features {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.add-family-features .feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

.add-family-features .feature-item i {
  font-size: 1.5rem;
  color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .overview-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .overview-stats {
    grid-template-columns: 1fr 1fr;
  }

  .add-family-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn-large {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .overview-stats {
    grid-template-columns: 1fr;
  }

  .search-filters {
    flex-direction: column;
    align-items: center;
  }

  .filter-btn {
    width: 100%;
    max-width: 200px;
  }
}

/* Contact Page Specific Styles */
.contact-form {
  position: relative;
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}

.contact-form .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #1f2937;
}

.contact-form .form-input,
.contact-form .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: white;
}

.contact-form .form-input:focus,
.contact-form .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form .form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .contact-form {
    padding: 1.5rem;
  }

  .contact-form .form-input,
  .contact-form .form-textarea {
    padding: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .contact-form .form-label {
    font-size: 0.875rem;
  }

  /* Stack contact info cards vertically on mobile */
  .contact-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Adjust testimonial grid for mobile */
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  /* Improve button touch targets */
  .btn {
    min-height: 44px;
    padding: 0.875rem 1.5rem;
  }

  /* Better spacing for mobile */
  .section {
    padding: 2rem 0;
  }

  .hero-section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .contact-form {
    padding: 1rem;
    margin: 0 -0.5rem;
  }

  .contact-form .form-input,
  .contact-form .form-textarea {
    padding: 0.875rem;
  }

  /* Stack social media buttons */
  .social-media-buttons {
    justify-content: center;
  }

  /* Adjust hero text for very small screens */
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }
}

/* Form Validation Styles */
.form-input.error,
.form-textarea.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success,
.form-textarea.success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.success-message {
  color: #10b981;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Loading State */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Enhanced Hover Effects */
.contact-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-pulse-slow,
  .animate-scale-in {
    animation: none;
  }

  .contact-card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .contact-form .form-input,
  .contact-form .form-textarea {
    border-width: 3px;
  }

  .contact-card {
    border: 2px solid #000;
  }
}

/* Print styles */
@media print {
  .card,
  .feature-card,
  .news-card {
    box-shadow: none;
    border: 1px solid #000;
  }

  .btn {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }

  .contact-form {
    background: white !important;
  }

  .hero-section {
    background: white !important;
    color: #000 !important;
  }
}

/* Family Surnames Section */
.family-surnames-section {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 4rem 0;
  margin: 4rem 0;
}

.surnames-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.surnames-header {
  text-align: center;
  margin-bottom: 3rem;
}

.surnames-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(31, 41, 55, 0.3);
}

.surnames-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  position: relative;
}

.surnames-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #1f2937, #3b82f6);
  border-radius: 2px;
}

.surnames-description {
  font-size: 1.2rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.surnames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.surname-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.surname-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1f2937, #3b82f6);
}

.surname-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.surname-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.surname-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #1f2937, #374151);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 4px 15px rgba(31, 41, 55, 0.3);
}

.surname-badge {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.surname-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.surname-origin {
  font-size: 1rem;
  color: #666;
  font-style: italic;
  margin-bottom: 1rem;
}

.surname-description {
  color: #555;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.surname-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.5rem 1rem;
  border-radius: 15px;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.stat i {
  color: #3b82f6;
  font-size: 1rem;
}

/* Responsive Design for Surnames Section */
@media (max-width: 768px) {
  .surnames-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .surname-card {
    padding: 1.5rem;
  }

  .surname-card-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .surname-stats {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .family-surnames-section {
    padding: 3rem 0;
  }

  .surnames-container {
    padding: 0 1rem;
  }

  .surname-card {
    padding: 1rem;
  }

  .surname-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}

/* iOS Safari Fixes for Hero Section Twitching */
/* Prevent hero section from twitching on iOS when scrolling */
.hero-background {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
  will-change: auto;
}

/* Disable momentum scrolling on iOS for hero section */
.hero-background {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

/* Fix for iOS Safari scroll bounce causing twitching */
@supports (-webkit-touch-callout: none) {
  .hero-background {
    position: relative;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  /* Prevent hero from moving during scroll on iOS */
  .hero-background::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    background-attachment: scroll;
    z-index: -1;
  }
}

/* Additional iOS fixes for smooth scrolling */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .hero-background {
    background-attachment: scroll !important;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
