﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Cinematic styles for the Haplogroup Profile page.
 * Mirrors the visual language of SampleProfileCinematic.
 */

/* CSS Variables */
:root {
    --hg-primary: #1a5a3a;
    --hg-primary-light: #2d7a4d;
    --hg-accent: #c9a430;
    --hg-dark: #0f1419;
    --hg-light: #f8f9fa;
    --hg-text-dark: #1a1a1a;
    --hg-text-light: #ffffff;
    --hg-section-padding: 80px 0;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--hg-primary);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Page Navigation Dots */
.hg-page-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hg-page-nav a {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    position: relative;
}

.hg-page-nav a:hover,
.hg-page-nav a.active {
    background: var(--hg-accent);
    border-color: var(--hg-accent);
    transform: scale(1.2);
}

.hg-page-nav a::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.hg-page-nav a:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    .hg-page-nav {
        display: none;
    }
}

/* Hero Section */
.hg-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hg-hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--hg-dark) 0%, #1a2a35 50%, var(--hg-primary) 100%);
}

.hg-hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hg-hero-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.hg-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px;
    max-width: 900px;
}

/* Breadcrumb */
.hg-breadcrumb {
    margin-bottom: 24px;
}

.hg-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.hg-breadcrumb a:hover {
    color: var(--hg-accent);
}

.hg-breadcrumb-sep {
    color: rgba(255, 255, 255, 0.4);
    margin: 0 8px;
    font-size: 0.7rem;
}

/* Hero Badge */
.hg-hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    color: var(--hg-text-light);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hg-hero-title {
    font-size: 5rem;
    font-weight: 800;
    color: var(--hg-text-light);
    margin-bottom: 16px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    letter-spacing: -2px;
}

.hg-hero-subtitle {
    font-size: 1.5rem;
    color: var(--hg-accent);
    margin-bottom: 16px;
}

.hg-hero-headline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* Quick Facts */
.hg-quick-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.hg-quick-fact {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.hg-quick-fact i {
    color: var(--hg-accent);
}

.hg-fact-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Actions */
.hg-hero-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hg-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    background: var(--hg-accent);
    color: var(--hg-dark);
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hg-btn-primary:hover {
    background: #ddb740;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 164, 48, 0.4);
    color: var(--hg-dark);
    text-decoration: none;
}

.hg-btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 14px 32px;
    background: transparent;
    color: var(--hg-text-light);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.hg-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--hg-text-light);
    text-decoration: none;
}

/* Scroll Indicator */
.hg-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    animation: hg-bounce 2s infinite;
}

.hg-scroll-indicator span {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

/* Sections */
.hg-section {
    padding: var(--hg-section-padding);
}

.hg-section-dark {
    background: var(--hg-dark);
    color: var(--hg-text-light);
}

/* Ensure all headers in dark sections are visible */
.hg-section-dark h1,
.hg-section-dark h2 {
    color: var(--hg-text-light);
}

.hg-section-dark h3,
.hg-section-dark h4,
.hg-section-dark h5,
.hg-section-dark h6 {
    color: var(--hg-accent);
}

.hg-section-light {
    background: var(--hg-light);
    color: var(--hg-text-dark);
}

.hg-section-header {
    text-align: center;
    margin-bottom: 48px;
}

.hg-section-chapter {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--hg-accent);
    margin-bottom: 12px;
}

.hg-section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.hg-section-dark .hg-section-title {
    color: var(--hg-text-light);
}

.hg-section-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
}

.hg-section-dark .hg-section-subtitle {
    color: rgba(255, 255, 255, 0.9);
}

/* Story Content */
.hg-story-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.hg-story-content p {
    margin-bottom: 1.5rem;
}

.hg-story-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--hg-accent);
}

.hg-section-dark .hg-story-content h3 {
    color: var(--hg-accent);
}

.hg-key-takeaways {
    background: rgba(201, 164, 48, 0.1);
    border-left: 4px solid var(--hg-accent);
    padding: 24px 32px;
    border-radius: 8px;
    margin-top: 32px;
}

.hg-key-takeaways h4 {
    color: var(--hg-accent);
    margin-bottom: 16px;
}

.hg-key-takeaways ul {
    margin: 0;
    padding-left: 20px;
}

.hg-key-takeaways li {
    margin-bottom: 8px;
}

/* Tree Cards */
.hg-tree-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 24px;
    height: 100%;
}

.hg-section-light .hg-tree-card {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Dark theme tree cards (Chapter II) */
.hg-section-dark .hg-tree-card {
    background: rgba(15, 20, 25, 0.6);
    border-color: rgba(201, 164, 48, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hg-tree-card h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--hg-primary);
}

.hg-section-dark .hg-tree-card h4 {
    color: var(--hg-accent);
}

/* Ancestor Path */
.hg-ancestor-path {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hg-ancestor-node {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(26, 90, 58, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--hg-primary);
    transition: all 0.2s;
}

.hg-ancestor-node:hover {
    background: var(--hg-primary);
    color: #fff;
    text-decoration: none;
}

.hg-path-line {
    width: 2px;
    height: 16px;
    background: var(--hg-primary);
    margin-left: 20px;
    opacity: 0.3;
}

.hg-current-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--hg-primary);
    color: #fff;
    border-radius: 8px;
}

.hg-node-label {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Siblings and Children */
.hg-sibling-list,
.hg-children-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hg-sibling-node,
.hg-child-node {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(26, 90, 58, 0.1);
    border-radius: 6px;
    text-decoration: none;
    color: var(--hg-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.hg-sibling-node:hover,
.hg-child-node:hover {
    background: var(--hg-primary);
    color: #fff;
    text-decoration: none;
}

.hg-more-siblings,
.hg-more-children {
    color: #666;
    font-size: 0.85rem;
    padding: 6px;
}

/* ==========================================
   ENHANCED TIMELINE STYLES
   ========================================== */

/* Timeline Container */
.hg-timeline {
    position: relative;
    padding-left: 40px;
}

.hg-timeline-card {
    min-height: 400px;
}

/* Timeline Node */
.hg-timeline-node {
    position: relative;
    display: flex;
    margin-bottom: 0;
}

/* Timeline Connector (Line and Dot) */
.hg-timeline-connector {
    position: absolute;
    left: -40px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.hg-timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hg-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--hg-primary);
    z-index: 2;
    flex-shrink: 0;
}

.hg-timeline-dot-current {
    width: 20px;
    height: 20px;
    background: var(--hg-accent);
    box-shadow: 0 0 0 4px var(--hg-accent), 0 0 20px rgba(201, 164, 48, 0.4);
    animation: pulse-glow 2s infinite;
}

.hg-timeline-line {
    width: 3px;
    flex-grow: 1;
    min-height: 24px;
    background: linear-gradient(180deg, var(--hg-primary) 0%, rgba(26, 90, 58, 0.3) 100%);
    margin-top: 4px;
}

/* Timeline Content */
.hg-timeline-content {
    display: block;
    background: rgba(26, 90, 58, 0.05);
    border: 1px solid rgba(26, 90, 58, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.hg-timeline-content:hover {
    background: rgba(26, 90, 58, 0.1);
    border-color: var(--hg-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(26, 90, 58, 0.15);
    text-decoration: none;
}

.hg-timeline-content-current {
    background: var(--hg-primary);
    border-color: var(--hg-primary);
    color: #fff;
}

.hg-timeline-content-current:hover {
    background: var(--hg-primary-light);
    transform: none;
}

/* Timeline Header */
.hg-timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.hg-timeline-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hg-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hg-timeline-content-current .hg-timeline-date {
    color: rgba(255, 255, 255, 0.9);
}

.hg-timeline-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: var(--hg-accent);
    color: #1a1a1a;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Timeline Code */
.hg-timeline-code {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hg-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hg-timeline-content-current .hg-timeline-code {
    color: #fff;
}

/* Timeline Meta */
.hg-timeline-place,
.hg-timeline-markers {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hg-timeline-place i,
.hg-timeline-markers i {
    color: var(--hg-primary);
    opacity: 0.7;
    width: 14px;
}

.hg-timeline-content-current .hg-timeline-place,
.hg-timeline-content-current .hg-timeline-markers {
    color: rgba(255, 255, 255, 0.8);
}

.hg-timeline-content-current .hg-timeline-place i,
.hg-timeline-content-current .hg-timeline-markers i {
    color: var(--hg-accent);
    opacity: 1;
}

/* ==========================================
   MINIMALIST ANCESTORS PATH (Redesigned)
   ========================================== */

.hg-ancestors-card {
    min-height: auto;
    padding: 24px;
}

.hg-ancestors-path {
    position: relative;
    padding-left: 24px;
}

/* Ancestor Item */
.hg-ancestor-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 0;
}

/* Ancestor Connector (Line and Dot) */
.hg-ancestor-connector {
    position: absolute;
    left: -24px;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.hg-ancestor-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--hg-primary);
    z-index: 2;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.hg-ancestor-item:hover .hg-ancestor-dot {
    background: var(--hg-primary);
    transform: scale(1.2);
}

.hg-ancestor-dot-current {
    width: 12px;
    height: 12px;
    background: transparent;
    border: 3px solid var(--hg-accent);
    box-shadow: 0 0 0 3px rgba(201, 164, 48, 0.2), 0 0 12px rgba(201, 164, 48, 0.3);
    animation: ancestorPulse 2.5s ease-in-out infinite;
}

@keyframes ancestorPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(201, 164, 48, 0.2), 0 0 12px rgba(201, 164, 48, 0.3);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(201, 164, 48, 0.15), 0 0 20px rgba(201, 164, 48, 0.4);
    }
}

.hg-ancestor-line {
    width: 1px;
    flex-grow: 1;
    min-height: 16px;
    background: linear-gradient(180deg, var(--hg-primary) 0%, rgba(26, 90, 58, 0.2) 100%);
    margin-top: 4px;
}

/* Ancestor Chip - Compact Lightweight Style */
.hg-ancestor-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: rgba(26, 90, 58, 0.03);
    border: 1px solid rgba(26, 90, 58, 0.08);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hg-ancestor-chip::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--hg-primary);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hg-ancestor-chip:hover {
    background: rgba(26, 90, 58, 0.08);
    border-color: rgba(26, 90, 58, 0.2);
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(26, 90, 58, 0.1);
    text-decoration: none;
}

.hg-ancestor-chip:hover::before {
    opacity: 1;
}

/* Ancestor Code - Primary element */
.hg-ancestor-code {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hg-primary);
    letter-spacing: -0.3px;
}

/* Ancestor Date - Secondary inline */
.hg-ancestor-date {
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Ancestor Origin - Tertiary, revealed more on hover */
.hg-ancestor-origin {
    display: block;
    width: 100%;
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
    opacity: 0.7;
    transition: opacity 0.25s ease;
}

.hg-ancestor-origin i {
    font-size: 0.65rem;
    color: var(--hg-primary);
    opacity: 0.5;
    margin-right: 4px;
}

.hg-ancestor-chip:hover .hg-ancestor-origin {
    opacity: 1;
    color: #666;
}

/* Current Ancestor Chip - Distinguished with accent ring */
.hg-ancestor-chip-current {
    background: rgba(201, 164, 48, 0.06);
    border-color: rgba(201, 164, 48, 0.25);
    cursor: default;
}

.hg-ancestor-chip-current::before {
    background: var(--hg-accent);
    opacity: 1;
    width: 3px;
}

.hg-ancestor-chip-current .hg-ancestor-code {
    color: var(--hg-primary);
    font-size: 1.2rem;
}

.hg-ancestor-chip-current .hg-ancestor-date {
    background: rgba(201, 164, 48, 0.15);
    color: #7a6520;
}

.hg-ancestor-chip-current:hover {
    transform: none;
    box-shadow: none;
}

/* Current Badge */
.hg-current-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: var(--hg-accent);
    color: #1a1a1a;
    border-radius: 10px;
}

/* Responsive adjustments for ancestors */
@media (max-width: 992px) {
    .hg-ancestors-path {
        padding-left: 20px;
    }
    
    .hg-ancestor-connector {
        left: -20px;
    }
}

@media (max-width: 768px) {
    .hg-ancestors-card {
        padding: 20px;
    }
    
    .hg-ancestor-chip {
        padding: 8px 12px;
    }
    
    .hg-ancestor-code {
        font-size: 1rem;
    }
    
    .hg-ancestor-chip-current .hg-ancestor-code {
        font-size: 1.1rem;
    }
}

/* ==========================================
   EVOLUTION PATH TABLE
   ========================================== */

.hg-evolution-card {
    padding: 28px;
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid rgba(201, 164, 48, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hg-evolution-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hg-accent);
    margin-bottom: 8px;
}

.hg-evolution-intro {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.hg-evolution-table-wrapper {
    overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px;
    -webkit-overflow-scrolling: touch;
}

.hg-evolution-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 900px;
}

.hg-evolution-table thead {
    background: rgba(201, 164, 48, 0.08);
    position: sticky;
    top: 0;
    z-index: 10;
}

.hg-evolution-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    border-bottom: 2px solid rgba(201, 164, 48, 0.2);
    white-space: nowrap;
    vertical-align: middle;
}

.hg-evolution-table th .hg-evo-info {
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    cursor: help;
}

.hg-evolution-table th .hg-evo-info:hover {
    color: var(--hg-accent);
}

.hg-evolution-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hg-evolution-table tbody tr:hover {
    background-color: rgba(201, 164, 48, 0.06);
}

.hg-evolution-table td {
    padding: 12px 14px;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.85);
}

/* Current row highlighting */
.hg-evo-row-current {
    background: linear-gradient(90deg, rgba(201, 164, 48, 0.08) 0%, rgba(201, 164, 48, 0.02) 100%) !important;
    border-left: 3px solid var(--hg-accent) !important;
}

.hg-evo-row-current:hover {
    background: linear-gradient(90deg, rgba(201, 164, 48, 0.12) 0%, rgba(201, 164, 48, 0.04) 100%) !important;
}

/* Column Styles */
.hg-evo-step {
    font-weight: 700;
    color: var(--hg-accent);
    font-size: 1rem;
    text-align: center;
    width: 60px;
}

.hg-evo-haplo {
    font-weight: 600;
}

.hg-evo-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--hg-accent);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(201, 164, 48, 0.08);
    transition: all 0.2s ease;
}

a.hg-evo-code:hover {
    background: rgba(201, 164, 48, 0.18);
    color: #e8d080;
    text-decoration: none;
}

.hg-evo-code-current {
    background: rgba(201, 164, 48, 0.2);
    color: #e8d080;
    font-weight: 700;
}

.hg-evo-current-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: var(--hg-accent);
    color: #1a1a1a;
    border-radius: 8px;
}

.hg-evo-age,
.hg-evo-time {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.hg-evo-unknown {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Era Badge Styles */
.hg-evo-era-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.hg-era-icon {
    font-size: 0.9rem;
}

/* Fine-grained archaeological era badges */
.hg-era-modern {
    background: rgba(108, 92, 231, 0.2);
    color: #a29bfe;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

.hg-era-medieval {
    background: rgba(155, 89, 182, 0.2);
    color: #c39bd3;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.hg-era-roman {
    background: rgba(214, 48, 49, 0.2);
    color: #e17055;
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.hg-era-classical {
    background: rgba(232, 67, 147, 0.2);
    color: #fd79a8;
    border: 1px solid rgba(232, 67, 147, 0.3);
}

.hg-era-iron {
    background: rgba(99, 110, 114, 0.25);
    color: #b2bec3;
    border: 1px solid rgba(99, 110, 114, 0.4);
}

.hg-era-bronze {
    background: rgba(201, 164, 48, 0.2);
    color: #e8d080;
    border: 1px solid rgba(201, 164, 48, 0.3);
}

.hg-era-chalcolithic {
    background: rgba(205, 127, 50, 0.2);
    color: #dda15e;
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.hg-era-neolithic {
    background: rgba(0, 184, 148, 0.2);
    color: #55efc4;
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.hg-era-mesolithic {
    background: rgba(9, 132, 227, 0.2);
    color: #74b9ff;
    border: 1px solid rgba(9, 132, 227, 0.3);
}

.hg-era-paleolithic {
    background: rgba(141, 110, 99, 0.25);
    color: #bcaaa4;
    border: 1px solid rgba(141, 110, 99, 0.4);
}

.hg-era-unknown {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Legacy era classes (backward compatibility) */
.hg-era-imperial { background: rgba(155, 89, 182, 0.2); color: #c39bd3; border: 1px solid rgba(155, 89, 182, 0.3); }
.hg-era-metal { background: rgba(201, 164, 48, 0.2); color: #e8d080; border: 1px solid rgba(201, 164, 48, 0.3); }
.hg-era-transition { background: rgba(0, 184, 148, 0.2); color: #55efc4; border: 1px solid rgba(0, 184, 148, 0.3); }
.hg-era-stone { background: rgba(141, 110, 99, 0.25); color: #bcaaa4; border: 1px solid rgba(141, 110, 99, 0.4); }

/* Numeric columns */
.hg-evo-imm,
.hg-evo-modern,
.hg-evo-ancient {
    text-align: center;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.hg-evo-modern {
    color: var(--hg-accent);
    font-weight: 700;
}

.hg-evo-ancient {
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 1200px) {
    .hg-evolution-table {
        font-size: 0.85rem;
    }
    
    .hg-evolution-table th,
    .hg-evolution-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 768px) {
    .hg-evolution-card {
        padding: 20px;
        margin: 0 -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .hg-evolution-table-wrapper {
        margin: 0 -20px;
        padding: 0 20px;
    }
    
    .hg-evolution-table th,
    .hg-evolution-table td {
        padding: 8px 10px;
    }
    
    .hg-evolution-table th .hg-evo-info {
        display: none;
    }
    
    .hg-evo-era-badge {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
    
    /* Hide less important columns on mobile */
    .hg-evo-col-time {
        display: none;
    }
}

@media (max-width: 576px) {
    .hg-evolution-intro {
        font-size: 0.85rem;
    }
    
    .hg-evolution-table {
        font-size: 0.8rem;
    }
}

/* ==========================================
   SUBCLADE CARDS GRID
   ========================================== */

.hg-subclades-card h4 {
    margin-bottom: 20px;
}

.hg-subclade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.hg-subclade-item {
    display: flex;
    flex-direction: column;
    background: rgba(201, 164, 48, 0.04);
    border: 1px solid rgba(201, 164, 48, 0.12);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hg-subclade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--hg-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.hg-subclade-item:hover {
    background: rgba(201, 164, 48, 0.1);
    border-color: var(--hg-accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(201, 164, 48, 0.15);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.95);
}

.hg-subclade-item:hover::before {
    transform: scaleX(1);
}

.hg-subclade-code {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hg-accent);
    margin-bottom: 8px;
}

.hg-subclade-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.hg-subclade-date,
.hg-subclade-samples,
.hg-subclade-children {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 3px;
}

.hg-subclade-date i,
.hg-subclade-samples i,
.hg-subclade-children i {
    font-size: 0.65rem;
    color: var(--hg-accent);
    opacity: 0.6;
}

.hg-subclade-place {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: auto;
}

.hg-subclade-place i {
    color: var(--hg-accent);
    opacity: 0.5;
    margin-right: 4px;
}

.hg-subclade-more {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(26, 90, 58, 0.2);
}

.hg-no-subclades {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.hg-no-subclades i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--hg-accent);
    opacity: 0.3;
}

.hg-no-subclades p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==========================================
   SIBLINGS GRID
   ========================================== */

.hg-siblings-card {
    margin-top: 8px;
}

.hg-siblings-intro {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 16px;
}

.hg-siblings-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hg-sibling-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(201, 164, 48, 0.06);
    border: 1px solid rgba(201, 164, 48, 0.15);
    border-radius: 24px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
    color: var(--hg-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.hg-sibling-pill:hover {
    background: rgba(201, 164, 48, 0.15);
    border-color: var(--hg-accent);
    color: #e8d080;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 164, 48, 0.2);
    text-decoration: none;
}

.hg-sibling-code {
    font-weight: 700;
}

.hg-sibling-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(201, 164, 48, 0.15);
    border-radius: 10px;
    color: var(--hg-primary);
}

.hg-sibling-pill:hover .hg-sibling-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.hg-siblings-more {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    padding: 8px 14px;
    font-style: italic;
}

/* ==========================================
   TOOLTIP STYLES
   ========================================== */

.hg-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: 280px;
    background: rgba(26, 26, 26, 0.96);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.hg-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.hg-tooltip-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hg-accent);
    margin-bottom: 10px;
}

.hg-tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
}

.hg-tooltip-row i {
    width: 14px;
    color: var(--hg-accent);
    opacity: 0.8;
    margin-top: 2px;
}

.hg-tooltip-row span {
    flex: 1;
}

.hg-tooltip-summary {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.4;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 4px var(--hg-accent), 0 0 20px rgba(201, 164, 48, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px var(--hg-accent), 0 0 30px rgba(201, 164, 48, 0.6);
    }
}

.animate-timeline {
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInTimeline 0.5s ease forwards;
}

@keyframes slideInTimeline {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-card {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeInCard 0.4s ease forwards;
}

@keyframes fadeInCard {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-pill {
    opacity: 0;
    transform: scale(0.9);
    animation: popInPill 0.3s ease forwards;
}

@keyframes popInPill {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 992px) {
    .hg-subclade-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .hg-timeline {
        padding-left: 30px;
    }
    
    .hg-timeline-connector {
        left: -30px;
    }
    
    .hg-timeline-dot {
        width: 12px;
        height: 12px;
    }
    
    .hg-timeline-dot-current {
        width: 16px;
        height: 16px;
    }
    
    .hg-timeline-code {
        font-size: 1.2rem;
    }
    
    .hg-timeline-content {
        padding: 12px 14px;
    }
    
    .hg-subclade-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .hg-subclade-item {
        padding: 12px;
    }
    
    .hg-subclade-code {
        font-size: 1rem;
    }
    
    .hg-siblings-grid {
        gap: 8px;
    }
    
    .hg-sibling-pill {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .hg-subclade-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hg-timeline-card {
        min-height: auto;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-timeline,
    .animate-card,
    .animate-pill {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .hg-timeline-dot-current {
        animation: none;
    }
    
    .hg-timeline-content,
    .hg-subclade-item,
    .hg-sibling-pill {
        transition: none;
    }
}

/* Origin Card */
.hg-origin-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: rgba(201, 164, 48, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.hg-origin-icon {
    width: 48px;
    height: 48px;
    background: var(--hg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hg-dark);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.hg-origin-content h4 {
    color: var(--hg-accent);
    margin-bottom: 8px;
}

/* Distribution Content */
.hg-distribution-content {
    margin-bottom: 32px;
}

.hg-distribution-content h4 {
    margin-bottom: 16px;
}

.hg-section-dark .hg-distribution-content h4 {
    color: var(--hg-accent);
}

/* Region Signals */
.hg-signal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hg-signal-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
}

.hg-signal-freq {
    background: var(--hg-accent);
    color: var(--hg-dark);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Timeline Card */
.hg-timeline-card {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.hg-timeline-marker {
    width: 64px;
    height: 64px;
    background: var(--hg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.hg-timeline-content h4 {
    color: var(--hg-primary);
    margin-bottom: 8px;
}

.hg-timeline-date {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hg-text-dark);
    margin-bottom: 8px;
}

.hg-timeline-context {
    color: #666;
}

/* Era Chips */
.hg-era-chips {
    margin-top: 32px;
}

.hg-era-chip {
    display: inline-block;
    padding: 6px 16px;
    background: var(--hg-primary);
    color: #fff;
    border-radius: 50px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* Sample Cards */
.hg-sample-card {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--hg-text-light);
    transition: all 0.3s ease;
}

.hg-sample-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    color: var(--hg-text-light);
    text-decoration: none;
}

.hg-sample-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hg-sample-id {
    font-weight: 700;
    color: var(--hg-accent);
}

.hg-sample-name {
    font-size: 1rem;
    margin-bottom: 8px;
}

.hg-sample-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Publication Cards */
.hg-publication-card {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.hg-pub-icon {
    width: 48px;
    height: 48px;
    background: var(--hg-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.hg-pub-content h5 {
    color: var(--hg-text-dark);
    margin-bottom: 8px;
}

.hg-pub-meta {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.hg-pub-claim {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.hg-pub-link {
    color: var(--hg-primary);
    font-weight: 600;
}

/* Provenance Grid */
.hg-provenance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 24px;
}

.hg-provenance-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hg-prov-full {
    grid-column: 1 / -1;
}

.hg-prov-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.hg-prov-value {
    font-weight: 600;
}

/* Data Source Explanation */
.hg-data-source-explanation {
    margin-top: 32px;
}

.hg-data-source-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: rgba(201, 164, 48, 0.1);
    border-left: 4px solid var(--hg-accent);
    border-radius: 8px;
    padding: 20px 24px;
}

.hg-data-source-content i {
    color: var(--hg-accent);
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.hg-data-source-content h5 {
    color: var(--hg-accent);
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.hg-data-source-content p {
    margin: 0;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.hg-data-source-content a {
    color: var(--hg-accent);
    text-decoration: underline;
    transition: color 0.2s;
}

.hg-data-source-content a:hover {
    color: #ddb740;
}

/* Celebrities Section */
.hg-celebrities-section {
    margin-top: 32px;
    padding: 24px;
    background: rgba(201, 164, 48, 0.1);
    border-radius: 12px;
}

.hg-celebrities-section h4 {
    color: var(--hg-accent);
    margin-bottom: 16px;
}

/* Mobile Bottom Navigation */
.hg-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hg-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.2s;
}

.hg-mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.hg-mobile-nav-item.active,
.hg-mobile-nav-item:hover {
    color: var(--hg-accent);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hg-hero-title {
        font-size: 3rem;
    }
    
    .hg-hero-headline {
        font-size: 1rem;
    }
    
    .hg-quick-facts {
        flex-direction: column;
        gap: 12px;
    }
    
    .hg-fact-divider {
        display: none;
    }
    
    .hg-section-title {
        font-size: 1.8rem;
    }
    
    .hg-cinematic-page {
        padding-bottom: 80px;
    }
}

/* Animation on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   ANCIENT DNA MATCHES SECTION
   ========================================== */

.hg-ancient-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.hg-ancient-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: rgba(201, 164, 48, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hg-ancient-icon {
    width: 48px;
    height: 48px;
    background: var(--hg-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hg-dark);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.hg-ancient-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--hg-text-light);
}

.hg-ancient-body {
    padding: 24px;
}

.hg-ancient-intro {
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

/* Ancient Samples Table */
.hg-ancient-table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hg-ancient-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.hg-ancient-table thead {
    background: rgba(26, 90, 58, 0.3);
}

.hg-ancient-table th {
    padding: 14px 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hg-accent);
    border-bottom: 2px solid rgba(201, 164, 48, 0.3);
}

.hg-ancient-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.hg-ancient-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.hg-ancient-table td {
    padding: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
}

/* Sample Portrait in Table */
.hg-sample-portrait {
    position: relative;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
}

.hg-sample-portrait img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hg-rank-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--hg-accent);
    color: var(--hg-dark);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Sample Name Cell */
.hg-sample-name-cell a {
    color: var(--hg-accent);
    text-decoration: none;
    transition: color 0.2s;
}

.hg-sample-name-cell a:hover {
    color: #ddb740;
    text-decoration: underline;
}

/* Haplogroup Code */
.hg-haplo-code {
    background: rgba(26, 90, 58, 0.3);
    color: #7ccc8f;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
}

/* Match Type Badges */
.hg-match-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.hg-match-exact {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}

.hg-match-base {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.hg-match-subclade {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
}

.hg-match-parent {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}

.hg-match-close {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #ffffff;
}

.hg-match-related {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mapping MatchType Badges (Direct, Downstream, Upstream) */
.hg-match-direct {
    background: linear-gradient(135deg, #c9a430, #b8941f);
    color: #ffffff;
}

.hg-match-downstream {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: #ffffff;
}

.hg-match-upstream {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #ffffff;
}

/* View Toggle */
.hg-view-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.hg-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(201, 164, 48, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hg-view-toggle-btn:hover {
    background: rgba(15, 20, 25, 0.8);
    border-color: rgba(201, 164, 48, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.hg-view-toggle-btn.active {
    background: linear-gradient(135deg, rgba(201, 164, 48, 0.2), rgba(201, 164, 48, 0.15));
    border-color: var(--hg-accent);
    color: var(--hg-accent);
}

.hg-view-toggle-btn i {
    font-size: 0.85rem;
}

/* View Visibility */
.hg-view-table,
.hg-view-cards {
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .hg-view-toggle {
        flex-direction: column;
        gap: 8px;
    }
    
    .hg-view-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Legend */
.hg-ancient-legend {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px 24px;
}

.hg-ancient-legend h5 {
    color: var(--hg-accent);
    margin-bottom: 16px;
    font-size: 1rem;
}

.hg-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.hg-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hg-legend-item span:last-child {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Empty State */
.hg-empty-state {
    text-align: center;
    padding: 48px 24px;
}

.hg-empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
}

.hg-empty-state h4 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.hg-empty-state p {
    color: rgba(255, 255, 255, 0.6);
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive for Ancient Table */
@media (max-width: 992px) {
    .hg-ancient-table-wrapper {
        margin: 0 -12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 768px) {
    .hg-legend-grid {
        grid-template-columns: 1fr;
    }
    
    .hg-ancient-header {
        padding: 16px;
    }
    
    .hg-ancient-body {
        padding: 16px;
    }
}

/* ==========================================
   ERA TIMELINE SECTION
   ========================================== */

.hg-era-timeline-section {
    margin-top: 32px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(26, 90, 58, 0.05), rgba(201, 164, 48, 0.05));
    border-radius: 16px;
    border: 1px solid rgba(26, 90, 58, 0.1);
}

.hg-era-timeline-section h4 {
    color: var(--hg-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.hg-era-timeline-intro {
    color: var(--hg-text-dark);
    opacity: 0.8;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Era Timeline */
.hg-era-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.hg-era-node {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(26, 90, 58, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.hg-era-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26, 90, 58, 0.15);
    border-color: var(--hg-primary);
}

.hg-era-node-primary {
    background: linear-gradient(135deg, var(--hg-primary), var(--hg-primary-light));
    border-color: transparent;
}

.hg-era-node-primary .hg-era-node-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.hg-era-node-primary .hg-era-node-type,
.hg-era-node-primary .hg-era-node-title,
.hg-era-node-primary .hg-era-node-date {
    color: #ffffff;
}

.hg-era-node-primary .hg-era-node-type {
    opacity: 0.85;
}

.hg-era-node-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hg-primary), var(--hg-primary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hg-era-node-icon i {
    font-size: 1rem;
}

.hg-era-node-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hg-era-node-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hg-primary);
    opacity: 0.8;
    font-weight: 600;
}

.hg-era-node-title {
    font-weight: 600;
    color: var(--hg-text-dark);
    font-size: 0.95rem;
    line-height: 1.2;
}

.hg-era-node-date {
    font-size: 0.8rem;
    color: var(--hg-text-dark);
    opacity: 0.7;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   ERA CONTEXT CARDS
   ========================================== */

.hg-era-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.hg-era-context-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(26, 90, 58, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.hg-era-context-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(26, 90, 58, 0.15);
}

.hg-era-card-image {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.hg-era-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hg-era-context-card:hover .hg-era-card-image img {
    transform: scale(1.05);
}

.hg-era-card-body {
    padding: 20px;
}

.hg-era-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.hg-era-card-header i {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hg-primary), var(--hg-primary-light));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.hg-era-card-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hg-primary);
    font-weight: 600;
}

.hg-era-card-title {
    color: var(--hg-text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0 0 0;
    line-height: 1.2;
}

.hg-era-card-date {
    font-size: 0.85rem;
    color: var(--hg-accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.hg-era-card-region {
    font-size: 0.8rem;
    color: var(--hg-text-dark);
    opacity: 0.7;
    margin-bottom: 12px;
}

.hg-era-card-description {
    font-size: 0.9rem;
    color: var(--hg-text-dark);
    opacity: 0.85;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   CULTURES SECTION
   ========================================== */

.hg-cultures-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
}

.hg-cultures-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: rgba(201, 164, 48, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hg-cultures-icon {
    width: 48px;
    height: 48px;
    background: var(--hg-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hg-cultures-icon i {
    font-size: 1.25rem;
    color: var(--hg-dark);
}

.hg-cultures-header h3 {
    color: var(--hg-text-light);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.hg-cultures-body {
    padding: 28px;
}

.hg-cultures-intro {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.hg-cultures-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.hg-culture-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(201, 164, 48, 0.2), rgba(201, 164, 48, 0.1));
    border: 1px solid rgba(201, 164, 48, 0.4);
    border-radius: 20px;
    color: var(--hg-accent);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.hg-culture-tag:hover {
    background: linear-gradient(135deg, rgba(201, 164, 48, 0.3), rgba(201, 164, 48, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 164, 48, 0.2);
}

.hg-cultures-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hg-cultures-note i {
    color: var(--hg-accent);
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.hg-cultures-note span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==========================================
   CLICKABLE TABLE ROWS
   ========================================== */

.hg-clickable-row {
    transition: all 0.2s ease;
}

.hg-clickable-row:hover {
    background: rgba(26, 90, 58, 0.05) !important;
}

.hg-section-dark .hg-clickable-row:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* ==========================================
   RESPONSIVE - ERA & CULTURES
   ========================================== */

@media (max-width: 768px) {
    .hg-era-timeline-section {
        padding: 16px;
        margin-top: 24px;
    }
    
    .hg-era-timeline {
        flex-direction: column;
        gap: 12px;
    }
    
    .hg-era-node {
        width: 100%;
    }
    
    .hg-era-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .hg-era-card-image {
        height: 120px;
    }
    
    .hg-era-card-body {
        padding: 16px;
    }
    
    .hg-cultures-header {
        padding: 20px;
    }
    
    .hg-cultures-body {
        padding: 20px;
    }
    
    .hg-cultures-tags {
        gap: 8px;
    }
    
    .hg-culture-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hg-era-timeline-section h4 {
        font-size: 1rem;
    }
    
    .hg-era-node {
        padding: 10px 12px;
    }
    
    .hg-era-node-icon {
        width: 36px;
        height: 36px;
    }
    
    .hg-era-node-title {
        font-size: 0.9rem;
    }
    
    .hg-era-card-title {
        font-size: 1rem;
    }
}

/* ==========================================
   CARRIER MAP
   ========================================== */

.hg-carrier-map-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(201, 164, 48, 0.15);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.hg-carrier-map {
    width: 100%;
    height: 520px;
    background: #0f1419;
    z-index: 1;
}

.hg-map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(15, 20, 25, 0.9);
    border-top: 1px solid rgba(201, 164, 48, 0.1);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.hg-map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hg-accent);
    box-shadow: 0 0 6px rgba(201, 164, 48, 0.5);
}

/* Override Leaflet cluster styles for dark/gold theme */
.marker-cluster-small {
    background-color: rgba(201, 164, 48, 0.25) !important;
}
.marker-cluster-small div {
    background-color: rgba(201, 164, 48, 0.55) !important;
    color: #fff !important;
    font-weight: 600;
}
.marker-cluster-medium {
    background-color: rgba(201, 164, 48, 0.35) !important;
}
.marker-cluster-medium div {
    background-color: rgba(201, 164, 48, 0.7) !important;
    color: #fff !important;
    font-weight: 600;
}
.marker-cluster-large {
    background-color: rgba(201, 164, 48, 0.45) !important;
}
.marker-cluster-large div {
    background-color: rgba(201, 164, 48, 0.85) !important;
    color: #1a1a1a !important;
    font-weight: 700;
}

/* Leaflet popup theming */
.hg-carrier-map .leaflet-popup-content-wrapper {
    background: rgba(15, 20, 25, 0.95);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(201, 164, 48, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
}
.hg-carrier-map .leaflet-popup-tip {
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid rgba(201, 164, 48, 0.2);
}
.hg-carrier-map .leaflet-popup-content {
    margin: 10px 14px;
    line-height: 1.5;
}
.hg-carrier-map .leaflet-popup-content strong {
    color: var(--hg-accent);
}

@media (max-width: 768px) {
    .hg-carrier-map {
        height: 350px;
    }
}

/* ==========================================
   TIMELINE FILTER SLIDER
   ========================================== */
.hg-timeline-filter {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.95) 0%, rgba(26, 30, 35, 0.95) 100%);
    border-bottom: 1px solid rgba(201, 164, 48, 0.15);
}

.hg-timeline-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.hg-timeline-filter-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.hg-timeline-filter-title i {
    color: var(--hg-accent);
}

.hg-timeline-filter-range-display {
    flex: 1;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hg-accent);
    min-width: 200px;
}

.hg-timeline-reset-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid rgba(201, 164, 48, 0.3);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hg-timeline-reset-btn:hover {
    border-color: var(--hg-accent);
    color: var(--hg-accent);
    background: rgba(201, 164, 48, 0.1);
}

.hg-timeline-slider-wrapper {
    padding: 0.5rem 0;
}

/* noUiSlider Custom Styles */
.hg-timeline-slider {
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hg-timeline-slider .noUi-connect {
    background: linear-gradient(90deg, rgba(201, 164, 48, 0.6), var(--hg-accent), rgba(201, 164, 48, 0.8));
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(201, 164, 48, 0.4);
}

.hg-timeline-slider .noUi-handle {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: var(--hg-accent) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 8px rgba(201, 164, 48, 0.5) !important;
    cursor: grab;
    top: -6px !important;
    right: -12px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

.hg-timeline-slider .noUi-handle:before,
.hg-timeline-slider .noUi-handle:after {
    display: none;
}

.hg-timeline-slider .noUi-handle:hover {
    background: rgba(201, 164, 48, 0.9) !important;
    transform: scale(1.1);
    width: 24px !important;
    height: 24px !important;
    aspect-ratio: 1 !important;
}

.hg-timeline-slider .noUi-handle:active {
    cursor: grabbing;
}

.hg-timeline-slider .noUi-tooltip {
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid var(--hg-accent);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.hg-timeline-filter-stats {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
}

.hg-timeline-filter-stats #hgTimelineVisibleCount {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Mobile Styles for Timeline Filter */
@media (max-width: 767.98px) {
    .hg-timeline-filter {
        padding: 1rem;
    }
    
    .hg-timeline-filter-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hg-timeline-filter-title {
        justify-content: center;
    }
    
    .hg-timeline-filter-range-display {
        min-width: unset;
    }
    
    .hg-timeline-reset-btn {
        justify-content: center;
    }
    
    .hg-timeline-slider .noUi-handle {
        width: 28px !important;
        height: 28px !important;
        top: -8px !important;
        right: -14px !important;
        max-width: 28px !important;
        max-height: 28px !important;
    }
}

/* ==========================================
   UNIFIED TOOLTIP/POPUP OVERRIDES FOR DARK THEME
   ========================================== */

/* Tooltip portrait badge styling */
.hg-carrier-map .unified-tooltip-portrait {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    object-fit: cover;
    object-position: top center;
    border: 2px solid rgba(201, 164, 48, 0.4) !important;
    flex-shrink: 0;
    background-color: rgba(201, 164, 48, 0.1);
}

.hg-carrier-map .unified-tooltip-content {
    background: rgba(15, 20, 25, 0.95);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(201, 164, 48, 0.2);
    border-radius: 8px;
    padding: 0;
    min-width: 200px;
}

.hg-carrier-map .unified-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(201, 164, 48, 0.1);
}

.hg-carrier-map .unified-tooltip-title {
    font-weight: 600;
    color: var(--hg-accent);
    font-size: 0.875rem;
}

.hg-carrier-map .unified-tooltip-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
}

.hg-carrier-map .unified-tooltip-body {
    padding: 0.75rem;
}

.hg-carrier-map .unified-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.hg-carrier-map .unified-tooltip-label {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-carrier-map .unified-tooltip-label i {
    color: var(--hg-accent);
    font-size: 0.75rem;
}

.hg-carrier-map .unified-tooltip-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.hg-carrier-map .unified-tooltip-footer {
    padding: 0.5rem 0.75rem;
    background: rgba(201, 164, 48, 0.1);
    border-top: 1px solid rgba(201, 164, 48, 0.1);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.hg-carrier-map .unified-tooltip-footer i {
    margin-right: 0.25rem;
    color: var(--hg-accent);
}

/* Popup portrait section styling */
.hg-carrier-map .unified-popup-portrait-section {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #1a1c1e;
}

.hg-carrier-map .unified-popup-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 0;
    display: block;
}

.hg-carrier-map .unified-popup-portrait-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(15, 20, 25, 0.95) 0%, transparent 100%);
    pointer-events: none;
}

.hg-carrier-map .unified-popup-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(201, 164, 48, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--hg-accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(201, 164, 48, 0.3);
    z-index: 10;
}

.hg-carrier-map .unified-popup-content {
    background: rgba(15, 20, 25, 0.95);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    overflow: hidden;
}

.hg-carrier-map .unified-popup-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(201, 164, 48, 0.1);
}

.hg-carrier-map .unified-popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hg-accent);
    margin: 0 0 0.25rem 0;
}

.hg-carrier-map .unified-popup-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.hg-carrier-map .unified-popup-body {
    padding: 1rem;
}

.hg-carrier-map .unified-popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.hg-carrier-map .unified-popup-row:last-child {
    margin-bottom: 0;
}

.hg-carrier-map .unified-popup-label {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hg-carrier-map .unified-popup-label i {
    color: var(--hg-accent);
    font-size: 0.75rem;
}

.hg-carrier-map .unified-popup-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: right;
}

.hg-carrier-map .unified-popup-value code {
    background: rgba(201, 164, 48, 0.2);
    color: var(--hg-accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.hg-carrier-map .unified-popup-footer {
    padding: 1rem;
    border-top: 1px solid rgba(201, 164, 48, 0.1);
    background: rgba(201, 164, 48, 0.05);
}

.hg-carrier-map .unified-popup-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--hg-accent);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.hg-carrier-map .unified-popup-btn:hover {
    background: rgba(201, 164, 48, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 164, 48, 0.4);
}

.hg-carrier-map .unified-popup-btn:active {
    transform: translateY(0);
}

/* Leaflet tooltip container override for rich HTML content */
.hg-carrier-map .leaflet-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.hg-carrier-map .leaflet-tooltip-top:before,
.hg-carrier-map .leaflet-tooltip-bottom:before,
.hg-carrier-map .leaflet-tooltip-left:before,
.hg-carrier-map .leaflet-tooltip-right:before {
    border-color: rgba(201, 164, 48, 0.2) transparent transparent transparent !important;
}

/* ==========================================
   ERA TOGGLE (TEMPORAL DISTRIBUTION)
   ========================================== */

.hg-era-toggle-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

.hg-era-toggle {
    display: inline-flex;
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(201, 164, 48, 0.15);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.hg-era-toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
}

.hg-era-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.hg-era-toggle-btn.active {
    background: var(--hg-accent);
    color: var(--hg-dark);
    box-shadow: 0 2px 8px rgba(201, 164, 48, 0.3);
}

.hg-era-toggle-btn:focus {
    outline: 2px solid var(--hg-accent);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .hg-era-toggle-wrapper {
        margin-bottom: 16px;
    }
    
    .hg-era-toggle-btn {
        padding: 6px 14px;
        font-size: 0.8125rem;
    }
}

@media print {
    .hg-era-toggle-wrapper {
        display: none;
    }
}

/* ==========================================
   CHART WRAPPER (ERA & COUNTRY)
   ========================================== */

.hg-chart-wrapper {
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(201, 164, 48, 0.12);
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hg-chart-wrapper canvas {
    /* Height is set dynamically by JavaScript based on number of bars */
    min-height: 250px;
}

@media (max-width: 768px) {
    .hg-chart-wrapper {
        padding: 16px 12px;
    }
    .hg-chart-wrapper canvas {
        /* Height is set dynamically by JavaScript based on number of bars */
        min-height: 200px;
    }
}

/* ==========================================
   SAMPLE CATALOG (CARD LIST)
   ========================================== */

.hg-catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.hg-catalog-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.hg-catalog-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
}

.hg-catalog-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(15, 20, 25, 0.6);
    border: 1px solid rgba(201, 164, 48, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.hg-catalog-search input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.hg-catalog-search input:focus {
    border-color: var(--hg-accent);
}

.hg-catalog-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.hg-catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 992px) {
    .hg-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .hg-catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.hg-sample-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(15, 20, 25, 0.5);
    border: 1px solid rgba(201, 164, 48, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hg-sample-card:hover {
    background: rgba(201, 164, 48, 0.06);
    border-color: rgba(201, 164, 48, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hg-sample-hidden {
    display: none !important;
}

.hg-card-portrait {
    width: 100%;
    aspect-ratio: 1;
    max-width: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(201, 164, 48, 0.2);
}

.hg-card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hg-sample-info {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.hg-sample-id {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--hg-accent);
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.hg-sample-name {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
    word-wrap: break-word;
}

.hg-sample-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    align-items: center;
}

.hg-sample-meta-item {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hg-sample-meta-item i {
    font-size: 0.65rem;
    color: var(--hg-accent);
    opacity: 0.6;
}

.hg-sample-haplo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.hg-sample-haplo-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(201, 164, 48, 0.15);
    color: #e8d080;
    border-radius: 10px;
    border: 1px solid rgba(201, 164, 48, 0.2);
}

.hg-sample-match-badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: capitalize;
}

/* Card match badges with mapping MatchType classes */
.hg-sample-match-badge.hg-match-direct,
.hg-sample-match-badge.hg-match-downstream,
.hg-sample-match-badge.hg-match-upstream {
    background: inherit;
    color: inherit;
    border: none;
}

.hg-catalog-loadmore,
.hg-table-loadmore {
    text-align: center;
    margin-top: 24px;
}

.hg-btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: rgba(201, 164, 48, 0.1);
    color: var(--hg-accent);
    border: 1px solid rgba(201, 164, 48, 0.25);
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hg-btn-gold:hover {
    background: rgba(201, 164, 48, 0.2);
    border-color: var(--hg-accent);
    box-shadow: 0 4px 16px rgba(201, 164, 48, 0.15);
}

@media (max-width: 768px) {
    .hg-catalog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .hg-catalog-search {
        max-width: 100%;
    }

    .hg-sample-card {
        padding: 12px 14px;
        gap: 12px;
    }

    .hg-card-portrait {
        max-width: 80px;
    }

    .hg-sample-meta {
        gap: 6px;
    }
}

@media (max-width: 576px) {
    .hg-sample-meta-item:nth-child(n+3) {
        display: none;
    }
}

/* Print styles */
@media print {
    .hg-page-nav,
    .hg-mobile-nav,
    .hg-scroll-indicator,
    .hg-hero-actions,
    .hg-catalog-controls,
    .hg-catalog-loadmore,
    .hg-table-loadmore {
        display: none !important;
    }
    
    .hg-hero {
        min-height: auto;
        padding: 40px 0;
    }
    
    .hg-section {
        page-break-inside: avoid;
    }
    
    .hg-ancient-table {
        font-size: 0.8rem;
    }
    
    .hg-match-badge {
        background: #f0f0f0 !important;
        color: #333 !important;
        border: 1px solid #ccc;
    }

    .hg-sample-hidden {
        display: flex !important;
    }

    .hg-carrier-map-wrapper,
    .hg-chart-wrapper {
        page-break-inside: avoid;
    }

    .hg-carrier-map {
        height: 300px;
    }

    .hg-heatmap-container {
        page-break-inside: avoid;
    }
}

/* ========================================
   COUNTRY x ERA HEATMAP
   ======================================== */

.hg-heatmap-container {
    padding: 1.5rem;
    position: relative;
}

.hg-heatmap-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.hg-heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    min-width: 500px;
}

.hg-heatmap-corner {
    background: transparent;
}

.hg-heatmap-col-header,
.hg-heatmap-row-header {
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.hg-heatmap-col-header {
    text-align: center;
    vertical-align: bottom;
}

.hg-heatmap-row-header {
    text-align: right;
    padding-right: 1rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hg-heatmap-cell {
    position: relative;
    width: 60px;
    height: 50px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    text-align: center;
    vertical-align: middle;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hg-heatmap-cell-active {
    background: color-mix(
        in srgb,
        #c9a430 calc(var(--intensity, 0) * 100%),
        rgba(255, 255, 255, 0.04)
    );
    cursor: pointer;
}

.hg-heatmap-cell-active:hover {
    transform: scale(1.12);
    z-index: 10;
    box-shadow: 0 4px 16px rgba(201, 164, 48, 0.35);
}

.hg-heatmap-cell-animated {
    animation: hgHeatmapPulse 0.4s ease;
}

@keyframes hgHeatmapPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.hg-heatmap-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.hg-heatmap-total-cell {
    background: rgba(255, 255, 255, 0.08) !important;
}

.hg-heatmap-grand-total {
    background: rgba(201, 164, 48, 0.25) !important;
}

.hg-heatmap-total-row .hg-heatmap-row-header {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

.hg-heatmap-col-header.hg-heatmap-total {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
}

/* Heatmap Legend */

.hg-heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.hg-heatmap-legend-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.hg-heatmap-gradient {
    width: 120px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0.04),
        #c9a430
    );
}

/* Heatmap Tooltip */

.hg-heatmap-tooltip {
    position: absolute;
    background: rgba(15, 20, 25, 0.95);
    border: 1px solid rgba(201, 164, 48, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    max-width: 280px;
    transform: translateX(-50%) translateY(-100%);
    backdrop-filter: blur(8px);
}

.hg-heatmap-tooltip.visible {
    opacity: 1;
}

.hg-heatmap-tooltip-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.hg-heatmap-tooltip-content {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.hg-heatmap-tooltip-content strong {
    color: #c9a430;
    font-size: 1rem;
}

/* Heatmap Empty State */

.hg-heatmap-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.875rem;
}

.hg-heatmap-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Responsive: smaller cells on mobile */

@media (max-width: 768px) {
    .hg-heatmap-container {
        padding: 0.75rem;
    }

    .hg-heatmap-cell {
        width: 44px;
        height: 38px;
    }

    .hg-heatmap-col-header,
    .hg-heatmap-row-header {
        font-size: 0.625rem;
        padding: 0.5rem;
    }

    .hg-heatmap-value {
        font-size: 0.6875rem;
    }
}
