/* Portfolio Main Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
    sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  color: #121314;
  line-height: 1.6;
  scroll-behavior: smooth;
}

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

/* Navigation */
.navbar {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #121314;
  text-decoration: none;
}

.logo:after {
  display: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-menu li a {
  color: #121314;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-menu li a:after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #4fc08d;
  transition: width 0.3s ease;
  z-index: 1;
}

.nav-menu li a:hover:after,
.nav-menu li a.active:after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #121314;
  margin: 3px 0;
  transition: 0.3s;
}

/* Section Styling */
section {
  padding: 80px 0;
  min-height: 60vh;
}

section h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: #121314;
  text-align: center;
}

section h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: #4fc08d;
  margin: 0.5rem auto 0;
}

/* Hero Section */
#home {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../assets/images/my-photo/my-image.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
}

.hero-content {
  text-align: center;
}

.hero-content h1 {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  letter-spacing: 1px;
}

.hero-content .subtitle {
  font-size: 1.8rem;
  font-weight: 400;
  color: #ffffff;
  margin-bottom: 3rem;
  line-height: 1.6;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-content p {
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: #4fc08d;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-right: 1rem;
}

.btn:hover {
  background: #3da875;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 192, 141, 0.3);
}

.btn:after {
  display: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid #4fc08d;
  color: #4fc08d;
}

.btn-outline:hover {
  background: #4fc08d;
  color: #fff;
}

/* Transparent button for hero section */
.btn-transparent {
  background: transparent !important;
  border: 1px solid #ffffff !important;
  color: #ffffff !important;
  padding: 14px 35px;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}

.btn-transparent:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: #4fc08d !important;
  color: #4fc08d !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(79, 192, 141, 0.4);
}

/* About Section */
#about {
  background: #f8f9fa;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.about-text p {
  margin-bottom: 1rem;
}

.about-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-item strong {
  color: #4fc08d;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.service-card {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #121314;
}

/* Skills Section */
#skills {
  background: #f8f9fa;
}

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

.skill-category h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #4fc08d;
}

.skill-category h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #4fc08d;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-tag {
  background: rgba(79, 192, 141, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #121314;
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(79, 192, 141, 0.3);
  transform: translateY(-2px);
}

/* Education & Experience Section */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #4fc08d;
  transform: translateX(-50%);
}

.timeline-item {
  margin-bottom: 3rem;
  position: relative;
}

.timeline-item:nth-child(odd) {
  padding-right: calc(50% + 30px);
  text-align: right;
}

.timeline-item:nth-child(even) {
  padding-left: calc(50% + 30px);
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0;
  width: 20px;
  height: 20px;
  background: #4fc08d;
  border: 4px solid #fff;
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 4px rgba(79, 192, 141, 0.2);
}

.timeline-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #121314;
}

.timeline-content .date {
  color: #4fc08d;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.timeline-content .company {
  font-weight: 600;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Work/Portfolio Section */
#work {
  background: #f8f9fa;
}

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

.work-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.work-item:hover {
  transform: translateY(-10px);
}

.work-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #4fc08d, #3da875);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #fff;
}

.work-content {
  padding: 1.5rem;
}

.work-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.work-content p {
  color: #666;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.work-tag {
  background: rgba(79, 192, 141, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.85rem;
  color: #4fc08d;
}

/* Blog Section */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.blog-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  transform: translateY(-10px);
}

.blog-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
}

.blog-content {
  padding: 1.5rem;
}

.blog-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.blog-date {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  display: block;
}

.blog-content p {
  color: #666;
  font-size: 0.95rem;
}

/* Article Page */
.article-container {
  max-width: 800px;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: #4fc08d;
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.article-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.article-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.article-body {
  font-size: 1.05rem;
  color: #444;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-source {
  text-align: center;
  margin-bottom: 2.5rem;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #24292f;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s ease;
}

.btn-github:hover {
  background: #4fc08d;
}

.article-toc {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
}

.article-toc h4 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
}

.article-toc ul {
  margin: 0;
  padding-left: 1.2rem;
}

.article-toc a {
  color: #4fc08d;
  text-decoration: none;
}

.article-toc a:hover {
  text-decoration: underline;
}

.article-body h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  color: #121314;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 0.5rem;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.7rem;
  color: #121314;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body pre {
  background: #1e1e2e;
  color: #f8f8f2;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.article-body code {
  font-family: 'Fira Code', Menlo, Consolas, monospace;
}

.article-body :not(pre) > code {
  background: rgba(79, 192, 141, 0.1);
  color: #2f8f68;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.article-body th,
.article-body td {
  border: 1px solid #e5e5e5;
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.article-body th {
  background: #f8f9fa;
}

.article-body hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 2rem 0;
}

/* Contact Section */
#contact {
  background: #f8f9fa;
}

.contact-content {
  max-width: 800px;
  margin: 2rem auto;
  text-align: center;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.contact-item {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.contact-item h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #4fc08d;
}

/* QR Codes */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 3rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.qr-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  border: 3px solid transparent;
}

.qr-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 10px 35px rgba(79, 192, 141, 0.3);
  border-color: #4fc08d;
}

.qr-image-container {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-bottom: 3px solid #f0f0f0;
}

.qr-card img {
  width: 100%;
  height: 100%;
  max-width: 260px;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.qr-content {
  padding: 2rem 1.5rem;
}

.qr-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #121314;
}

.qr-card p {
  font-size: 1rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* Second row with 2 QR codes centered */
.qr-card:nth-child(4) {
  grid-column: 1 / 2;
  margin-left: auto;
  margin-right: 1.5rem;
}

.qr-card:nth-child(5) {
  grid-column: 2 / 3;
  margin-left: 1.5rem;
  margin-right: auto;
}

/* Social Media QR Section - Compact Bottom Section */
.social-qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.social-qr-card {
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.social-qr-card:hover {
  transform: scale(1.05);
}

.social-qr-image {
  width: 100%;
  /* max-width: 220px;
  height: 220px; */
  margin: 0 auto 1.5rem;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: 3px solid #f0f0f0;
}

.social-qr-card:hover .social-qr-image {
  box-shadow: 0 8px 30px rgba(79, 192, 141, 0.25);
  border-color: #4fc08d;
}

.social-qr-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.social-qr-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #121314;
  margin: 0;
}

/* Adjust for 2nd row with 2 items */
.social-qr-card:nth-child(4) {
  grid-column: 1 / 2;
  margin-left: auto;
  margin-right: 1.5rem;
}

.social-qr-card:nth-child(5) {
  grid-column: 2 / 3;
  margin-left: 1.5rem;
  margin-right: auto;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: 300;
  color: #666;
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #121314;
}

.modal-content h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #121314;
}

.modal-content p {
  color: #666;
  margin-bottom: 1.5rem;
}

.modal-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* CV Modal Styles */
.cv-modal-content {
  max-width: 90vw;
  max-height: 95vh;
  width: 1200px;
  padding: 2rem;
}

.cv-actions {
  margin: 1rem 0;
  text-align: right;
}

.btn-download-small {
  padding: 8px 20px;
  font-size: 0.9rem;
  background: #4fc08d;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-download-small:hover {
  background: #3da875;
  transform: translateY(-2px);
}

#cvFrame {
  width: 100%;
  height: 75vh;
  border: none;
  border-radius: 8px;
  background: #fff;
}
/* Family Tree Styles */
.tree-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-tree-control {
  padding: 10px 24px;
  background: #4fc08d;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Rubik', sans-serif;
}

.btn-tree-control:hover {
  background: #3da875;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 192, 141, 0.3);
}

.family-tree-container {
  overflow-x: auto;
  overflow-y: visible;
  padding: 2rem 1rem;
  margin: 0 auto;
  background: #f8f9fa;
  border-radius: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.family-tree-container::after {
  content: '← Scroll horizontally to explore →';
  position: sticky;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  background: rgba(79, 192, 141, 0.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: inline-block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  z-index: 100;
}

.family-tree-container.has-scroll::after {
  opacity: 1;
}

@media (max-width: 768px) {
  .family-tree-container::after {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  
  .family-tree-container.has-scroll::after {
    opacity: 1; /* Always show on mobile to guide users */
  }
}

.tree-root {
  display: inline-flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
  min-width: 100%;
  padding: 0 20%;
}

.tree-loading {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-size: 1.1rem;
}

.tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.5rem;
  position: relative;
  flex-shrink: 0;
}

.tree-node-content {
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  min-width: 140px;
  text-align: center;
  border: 2px solid transparent;
  margin-bottom: 1rem;
}

.tree-node-content:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  border-color: #4fc08d;
}

.tree-node-content.has-children {
  cursor: pointer;
}

.tree-node-name {
  font-weight: 600;
  color: #121314;
  font-size: 0.95rem;
  line-height: 1.4;
}

.tree-node-spouse {
  font-size: 0.85rem;
  color: #555;
  margin-top: 4px;
  font-style: italic;
}

.tree-node-household {
  font-size: 0.85rem;
  color: #2c3e50;
  margin-top: 4px;
  font-weight: 500;
  background: rgba(52, 152, 219, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.tree-node-note {
  font-size: 0.8rem;
  color: #e67e22;
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(230, 126, 34, 0.1);
  border-radius: 4px;
  border-left: 3px solid #e67e22;
}

.node-expand-icon {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: #4fc08d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 2px 6px rgba(79, 192, 141, 0.4);
  transition: all 0.3s ease;
  z-index: 10;
}

.node-expand-icon:hover {
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 3px 10px rgba(79, 192, 141, 0.6);
}

.node-expand-icon.collapsed::after {
  content: '+';
}

.node-expand-icon.expanded::after {
  content: '−';
}

.tree-node-children {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 2rem;
  position: relative;
  transition: all 0.4s ease;
  opacity: 1;
  max-height: 5000px;
  flex-wrap: nowrap;
}

.tree-node-children.collapsed {
  display: none;
  opacity: 0;
  max-height: 0;
}

.tree-node-children::before {
  content: '';
  position: absolute;
  top: -2rem;
  left: 50%;
  width: 2px;
  height: 2rem;
  background: #4fc08d;
  transform: translateX(-50%);
}

.tree-node-children .tree-node::before {
  content: '';
  position: absolute;
  top: -2rem;
  left: 50%;
  width: 2px;
  height: 2rem;
  background: #4fc08d;
  transform: translateX(-50%);
}

.tree-node-children .tree-node::after {
  content: '';
  position: absolute;
  top: -2rem;
  left: -0.5rem;
  right: -0.5rem;
  height: 2px;
  background: #4fc08d;
}

.tree-node-children .tree-node:only-child::after {
  display: none;
}

.tree-node-children .tree-node:first-child::after {
  left: 50%;
}

.tree-node-children .tree-node:last-child::after {
  right: 50%;
}

/* Mother/Spouse label */
.tree-branch-label {
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1.5rem;
  font-style: italic;
  background: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: inline-block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .family-tree-container {
    padding: 1.5rem 0.5rem;
  }
  
  .tree-root {
    padding: 0 10px; /* Reduce padding on mobile to show more content */
    min-width: max-content; /* Ensure tree can expand fully */
  }
  
  .tree-node {
    margin: 0 0.5rem;
  }
  
  .tree-node-content {
    min-width: 100px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  
  .tree-node-name {
    font-size: 0.85rem;
  }
  
  .tree-controls {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .btn-tree-control {
    width: 100%;
    max-width: 200px;
  }
  
  .tree-node-children {
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
  
  .node-expand-icon {
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
  }
}
/* CV Button Styles */
.btn-cv {
  background: #2c3e50;
}

.btn-cv:hover {
  background: #1a252f;
  box-shadow: 0 5px 15px rgba(44, 62, 80, 0.3);
}

.btn-download {
  background: #e74c3c;
  color: #fff;
}

.btn-download:hover {
  background: #c0392b;
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Footer */
footer {
  background: #121314;
  color: #fff;
  text-align: center;
  padding: 2rem 0;
}

footer p {
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: #fff;
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 2rem 0;
  }

  .nav-menu.active {
    left: 0;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content .subtitle {
    font-size: 1.5rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    padding-left: 60px;
    padding-right: 0;
    text-align: left;
  }

  .timeline-item::before {
    left: 20px;
    transform: none;
  }

  section h2 {
    font-size: 2rem;
  }

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

  .qr-card:nth-child(4),
  .qr-card:nth-child(5) {
    grid-column: auto;
    margin-left: 0;
    margin-right: 0;
  }

  .qr-image-container {
    height: 280px;
  }

  .qr-card img {
    max-width: 240px;
    max-height: 240px;
  }

  .social-qr-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .social-qr-card:nth-child(4),
  .social-qr-card:nth-child(5) {
    grid-column: auto;
    margin-left: 0;
    margin-right: 0;
  }

  .social-qr-image {
    max-width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .btn {
    display: block;
    margin-bottom: 1rem;
  }

  .qr-image-container {
    height: 250px;
  }

  .qr-card img {
    max-width: 200px;
    max-height: 200px;
  }

  .qr-content {
    padding: 1.5rem 1rem;
  }

  .social-qr-image {
    max-width: 180px;
    height: 180px;
    padding: 1rem;
  }

  .social-qr-card h3 {
    font-size: 1.1rem;
  }
}
