/* ========================================
   JOSHI FAMILY WEBSITE - STYLES
   Fresh & Modern Theme (Teals, Soft Blues, Whites)
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors - Deep Emerald Theme */
    --teal-900: #064e3b;
    --teal-800: #065f46;
    --teal-700: #047857;
    --teal-600: #059669;
    --teal-500: #10b981;
    --teal-400: #34d399;
    --teal-300: #6ee7b7;
    --teal-200: #a7f3d0;
    --teal-100: #d1fae5;
    --teal-50: #ecfdf5;

    /* Accent Colors - Gold */
    --blue-600: #b45309;
    --blue-500: #d97706;
    --blue-400: #f59e0b;
    --blue-300: #fbbf24;
    --blue-200: #fde68a;
    --blue-100: #fef3c7;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --section-padding: clamp(1.5rem, 3vw, 2.5rem);
    --container-max: 1200px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Section Base */
.section {
    padding: var(--section-padding) 0;
}

.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 600;
    color: var(--teal-800);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--gray-500);
    font-weight: 300;
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal-700);
    letter-spacing: 0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-600);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--teal-500);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--teal-700);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--gray-700);
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--teal-50) 0%, var(--white) 50%, var(--blue-100) 100%);
    overflow: hidden;
    padding-top: 70px;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, var(--teal-200) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--blue-200) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--teal-100) 0%, transparent 30%);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10px, -10px) scale(1.02); }
    66% { transform: translate(-5px, 5px) scale(0.98); }
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 2rem 2rem 2rem;
}

.hero-text {
    animation: slideInLeft 1s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--teal-600);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 5rem);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-devanagari {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--teal-700);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--gray-600);
    font-weight: 300;
    margin-bottom: 1.25rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--teal-600);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.hero-cta:hover {
    background: var(--teal-700);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.hero-image-container {
    animation: slideInRight 1s ease-out 0.3s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-image-frame {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 4px solid var(--teal-500);
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.hero-image-placeholder {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    gap: 1rem;
    color: var(--teal-700);
    background: var(--gray-100);
    border-radius: 16px;
}

.placeholder-icon {
    font-size: 4rem;
}

.placeholder-text {
    font-size: 1.25rem;
    font-weight: 500;
}

.placeholder-hint {
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.scroll-indicator {
    display: none;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--teal-500);
    border-bottom: 2px solid var(--teal-500);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text {
        order: 1;
    }

    .hero-image-container {
        order: 0;
        max-width: 500px;
        margin: 0 auto;
    }
}

/* ========================================
   FAMILY TREE SECTION
   ======================================== */
.family-section {
    background: var(--gray-50);
}

.tree-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.tree-search {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
}

.tree-actions {
    display: flex;
    gap: 0.5rem;
}

.tree-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.tree-btn:hover {
    border-color: var(--teal-500);
    color: var(--teal-600);
}

.generation-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.gen-label {
    font-weight: 500;
    color: var(--gray-600);
}

.gen-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gen-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--teal-100);
    color: var(--teal-700);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.gen-btn:hover,
.gen-btn.active {
    background: var(--teal-600);
    color: var(--white);
    transform: scale(1.1);
}

.tree-wrapper {
    overflow-x: auto;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
}

.tree-container {
    padding: 1.5rem 1rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: center;
    min-width: fit-content;
}

.tree-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--gray-500);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--teal-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Family Tree Nodes */
.tree-root {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-generation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.tree-generation::before {
    content: attr(data-gen);
    position: absolute;
    left: -3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal-600);
    background: var(--teal-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.tree-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tree-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.625rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 85px;
    max-width: 100px;
}

.tree-person:hover {
    border-color: var(--teal-500);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tree-person.highlight {
    border-color: var(--teal-500);
    background: var(--teal-50);
}

.person-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
    overflow: hidden;
    flex-shrink: 0;
}

.person-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.person-spouse {
    font-size: 0.6rem;
    color: var(--teal-600);
    font-weight: 500;
    margin-top: 0.2rem;
    padding: 0.1rem 0.35rem;
    background: var(--teal-50);
    border-radius: 8px;
    text-align: center;
    line-height: 1.2;
}

.person-relation {
    font-size: 0.6rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

.tree-expand {
    margin-top: 0.35rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--teal-100);
    color: var(--teal-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all var(--transition-fast);
}

.tree-expand:hover {
    background: var(--teal-500);
    color: var(--white);
}

.tree-expand.expanded {
    transform: rotate(180deg);
}

.tree-children {
    display: flex;
    gap: 0.75rem;
    padding-top: 1.75rem;
    position: relative;
    justify-content: center;
}

/* Vertical line from parent down to horizontal connector */
.tree-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 0.875rem;
    background: var(--gray-300);
    transform: translateX(-50%);
}

.tree-children.collapsed {
    display: none;
}

/* Tree Lines - connector for each child */
.tree-connector {
    position: relative;
}

/* Vertical line from child up to horizontal line */
.tree-connector::before {
    content: '';
    position: absolute;
    top: -0.875rem;
    left: 50%;
    width: 2px;
    height: 0.875rem;
    background: var(--gray-300);
    transform: translateX(-50%);
}

/* Horizontal line segments connecting siblings */
.tree-connector::after {
    content: '';
    position: absolute;
    top: -0.875rem;
    height: 2px;
    background: var(--gray-300);
    left: 0;
    right: 50%;
}

/* First child - line goes right only */
.tree-connector:first-child::after {
    left: 50%;
    right: 0;
}

/* Last child - line goes left only */
.tree-connector:last-child::after {
    left: 0;
    right: 50%;
}

/* Middle children - line goes both directions */
.tree-connector:not(:first-child):not(:last-child)::after {
    left: 0;
    right: 0;
}

/* Only child - no horizontal line needed */
.tree-connector:only-child::after {
    display: none;
}

/* Single child - extend vertical line */
.tree-children:has(> .tree-node:only-child)::before {
    height: 1.75rem;
}

.tree-connector:only-child::before {
    top: -1.75rem;
    height: 1.75rem;
}

/* Mobile responsive tree */
@media (max-width: 768px) {
    .tree-person {
        padding: 0.4rem 0.5rem;
        min-width: 70px;
        max-width: 85px;
        border-radius: 8px;
    }

    .person-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }

    .person-name {
        font-size: 0.6rem;
    }

    .person-spouse {
        font-size: 0.5rem;
        padding: 0.08rem 0.25rem;
    }

    .person-relation {
        font-size: 0.5rem;
    }

    .tree-expand {
        width: 14px;
        height: 14px;
        font-size: 0.5rem;
        margin-top: 0.25rem;
    }

    .tree-children {
        gap: 0.5rem;
        padding-top: 1.25rem;
    }

    .tree-children::before {
        height: 0.625rem;
    }

    .tree-connector::before {
        top: -0.625rem;
        height: 0.625rem;
    }

    .tree-connector::after {
        top: -0.625rem;
    }

    .tree-children:has(> .tree-node:only-child)::before {
        height: 1.25rem;
    }

    .tree-connector:only-child::before {
        top: -1.25rem;
        height: 1.25rem;
    }

    .tree-container {
        padding: 1rem 0.5rem;
    }
}

/* View Toggle Buttons */
.view-toggle {
    transition: all var(--transition-base);
}

.view-toggle.active {
    background: var(--teal-600);
    color: var(--white);
    border-color: var(--teal-600);
}

/* ========================================
   SPIRAL TIMELINE VIEW
   ======================================== */
.spiral-wrapper {
    padding: 1rem 0;
    overflow: hidden;
}

.spiral-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.spiral-timeline {
    position: relative;
    width: 100%;
    max-width: 900px;
}

/* Lineage Path (for single-child generations) */
.lineage-path {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--teal-50), var(--blue-50));
    border-radius: 16px;
    position: relative;
}

.lineage-path::after {
    content: '↓';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--teal-500);
}

.lineage-node {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--white);
    border: 2px solid var(--teal-200);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.lineage-node:hover {
    border-color: var(--teal-500);
    background: var(--teal-50);
    transform: scale(1.05);
}

.lineage-node .gen-badge {
    background: var(--teal-100);
    color: var(--teal-700);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
}

.lineage-arrow {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Branch Section Title */
.branch-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

.branch-title h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--teal-800);
    margin-bottom: 0.25rem;
}

.branch-title p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Family Branches Grid */
.family-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.family-branch {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
    transition: all var(--transition-base);
}

.family-branch:hover {
    border-color: var(--teal-300);
    box-shadow: var(--shadow-md);
}

.branch-head-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: 0.75rem;
}

.branch-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
}

.branch-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    background: var(--teal-100);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.65rem;
    color: var(--teal-700);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.branch-toggle-btn:hover {
    background: var(--teal-200);
}

.branch-toggle-btn .toggle-icon {
    font-size: 0.6rem;
    transition: transform var(--transition-fast);
}

.branch-toggle-btn.expanded .toggle-icon {
    transform: rotate(0deg);
}

.branch-toggle-btn:not(.expanded) .toggle-icon {
    transform: rotate(-90deg);
}

.branch-toggle-btn .toggle-count {
    font-weight: 600;
}

.branch-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.branch-avatar.female {
    background: linear-gradient(135deg, #e879a9, #c084fc);
}

.branch-info h4 {
    font-size: 0.875rem;
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}

.branch-info .spouse {
    font-size: 0.7rem;
    color: var(--teal-600);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
}

.branch-children {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

.branch-children.collapsed {
    display: none;
}

.child-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-400), var(--blue-300));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.child-avatar.female {
    background: linear-gradient(135deg, #f9a8d4, #d8b4fe);
}

.child-info {
    flex: 1;
}

.child-info .name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
}

.child-info .spouse-name {
    font-size: 0.6rem;
    color: var(--teal-600);
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

/* Expandable Children */
.branch-child-wrapper {
    display: flex;
    flex-direction: column;
}

.branch-child-wrapper.nested {
    margin-left: 1rem;
    border-left: 2px solid var(--gray-200);
    padding-left: 0.75rem;
}

.branch-child {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.branch-child.has-children {
    padding-right: 2.5rem;
}

.expand-children-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    background: var(--teal-100);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.6rem;
    color: var(--teal-700);
}

.expand-children-btn:hover {
    background: var(--teal-200);
}

.expand-children-btn .expand-icon {
    font-size: 0.5rem;
    transition: transform var(--transition-fast);
}

.expand-children-btn.expanded .expand-icon {
    transform: rotate(90deg);
}

.expand-children-btn .child-count {
    font-weight: 600;
}

.nested-children {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

.nested-children.collapsed {
    display: none;
}

/* Nested depth styling */
.branch-child-wrapper[data-depth="1"] {
    margin-left: 0.75rem;
}

.branch-child-wrapper[data-depth="2"] {
    margin-left: 0.5rem;
}

.branch-child-wrapper.nested .branch-child {
    background: var(--white);
    border: 1px solid var(--gray-200);
}

.branch-child-wrapper.nested .branch-child:hover {
    border-color: var(--teal-300);
}

/* Spiral Mobile Responsive */
@media (max-width: 768px) {
    .lineage-node {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }
    
    .lineage-node .gen-badge {
        font-size: 0.5rem;
        padding: 0.1rem 0.3rem;
    }
    
    .family-branches {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lineage-path {
        gap: 0.35rem;
        padding: 1rem;
    }
    
    .lineage-node {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
    }
    
    .lineage-arrow {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .tree-person {
        padding: 0.3rem 0.4rem;
        min-width: 58px;
        max-width: 72px;
    }

    .person-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.6rem;
    }

    .person-name {
        font-size: 0.55rem;
    }

    .person-spouse {
        font-size: 0.45rem;
    }

    .tree-children {
        gap: 0.35rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: 2rem;
}

.modal-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-400), var(--blue-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

.modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 0.5rem;
}

.modal-details {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.modal-detail-icon {
    font-size: 1.25rem;
}

.modal-detail-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-detail-value {
    font-weight: 500;
    color: var(--gray-800);
}

/* ========================================
   EVENTS SECTION - REDESIGNED
   ======================================== */
.events-section {
    background: var(--white);
}

/* Upcoming Events */
.upcoming-events {
    margin-bottom: 1.5rem;
}

.upcoming-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.upcoming-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--teal-800);
    margin: 0;
}

.upcoming-badge {
    background: var(--teal-100);
    color: var(--teal-700);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.upcoming-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.upcoming-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--teal-50), var(--white));
    border: 2px solid var(--teal-200);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.upcoming-card:hover {
    border-color: var(--teal-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.upcoming-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 70px;
    background: var(--teal-600);
    color: white;
    border-radius: 12px;
    flex-shrink: 0;
}

.countdown-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.countdown-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.upcoming-card.today .upcoming-countdown {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.upcoming-info {
    flex: 1;
}

.upcoming-info .event-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.upcoming-info h4 {
    font-size: 1rem;
    color: var(--gray-800);
    margin: 0 0 0.25rem 0;
}

.upcoming-info .event-person {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0 0 0.35rem 0;
}

.upcoming-info .event-date-text {
    font-size: 0.75rem;
    color: var(--teal-600);
    font-weight: 500;
}

/* Year Calendar Grid - Compact View */
.events-by-month {
    margin-top: 1rem;
}

.year-calendar-header {
    text-align: center;
    margin-bottom: 0.75rem;
}

.year-calendar-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--teal-800);
    margin: 0 0 0.25rem 0;
}

.year-calendar-header p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

.year-calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.month-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    cursor: default;
    transition: all var(--transition-fast);
    min-height: 80px;
}

.month-cell.has-events {
    cursor: pointer;
    background: var(--white);
}

.month-cell.has-events:hover {
    border-color: var(--teal-400);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.month-cell.current {
    border-color: var(--teal-500);
    background: var(--teal-50);
}

.month-cell.active {
    border-color: var(--teal-600);
    background: var(--teal-100);
}

.month-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.month-cell.current .month-label {
    color: var(--teal-700);
}

.event-dots {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
}

.dot.birthday {
    background: #f59e0b;
}

.dot.anniversary {
    background: #ec4899;
}

.dot.other {
    background: var(--teal-500);
}

.no-events {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Month Detail Panel */
.month-detail-panel {
    display: none;
    background: var(--white);
    border: 2px solid var(--teal-200);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: slideDown 0.2s ease-out;
}

.month-detail-panel.active {
    display: block;
}

.month-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.month-detail-header h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--teal-800);
    margin: 0;
}

.close-detail {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-detail:hover {
    background: var(--gray-200);
}

.month-detail-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.detail-event {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 10px;
    border-left: 4px solid var(--teal-500);
}

.detail-event.birthday {
    border-left-color: #f59e0b;
}

.detail-event.anniversary {
    border-left-color: #ec4899;
}

.detail-day {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-700);
    min-width: 30px;
}

.detail-icon {
    font-size: 1.25rem;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-info strong {
    font-size: 0.875rem;
    color: var(--gray-800);
}

.detail-info span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Responsive */
@media (max-width: 768px) {
    .year-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .month-cell {
        padding: 0.75rem 0.35rem;
        min-height: 70px;
    }
    
    .month-label {
        font-size: 0.75rem;
    }
    
    .dot {
        min-width: 14px;
        height: 14px;
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .year-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .month-detail-events {
        grid-template-columns: 1fr;
    }
}

/* No events state */
.no-events {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.no-events-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .upcoming-cards {
        grid-template-columns: 1fr;
    }
    
    .month-events {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .upcoming-card {
        padding: 1rem;
    }
    
    .upcoming-countdown {
        min-width: 60px;
        height: 60px;
    }
    
    .countdown-number {
        font-size: 1.25rem;
    }
}

/* Add Event Section */
.add-event-section {
    max-width: 600px;
    margin: 3rem auto 0;
    text-align: center;
}

.add-event-toggle {
    padding: 1rem 2rem;
    background: var(--teal-100);
    color: var(--teal-700);
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-base);
}

.add-event-toggle:hover {
    background: var(--teal-200);
}

.add-event-form {
    display: none;
    margin-top: 1.5rem;
    padding: 2rem;
    background: var(--gray-50);
    border-radius: 16px;
    text-align: left;
}

.add-event-form.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   STORY SECTION
   ======================================== */
.story-section {
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);
}

.story-content {
    display: grid;
    gap: 1.5rem;
}

.story-timeline {
    position: relative;
    padding-left: 2rem;
}

.story-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--teal-500), var(--blue-400));
}

.story-item {
    position: relative;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateX(-20px);
    animation: fadeInLeft 0.6s ease-out forwards;
}

.story-item:nth-child(1) { animation-delay: 0.1s; }
.story-item:nth-child(2) { animation-delay: 0.3s; }
.story-item:nth-child(3) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.story-marker {
    position: absolute;
    left: -2rem;
    top: 0;
    width: 16px;
    height: 16px;
    background: var(--teal-500);
    border: 3px solid var(--white);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: var(--shadow-md);
}

.story-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-left: 1rem;
}

.story-era {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--teal-600);
    background: var(--teal-100);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
}

.story-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.story-card p {
    color: var(--gray-600);
    line-height: 1.7;
}

/* Values Grid */
.story-values h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--teal-800);
    text-align: center;
    margin-bottom: 1.25rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.value-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.value-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.value-card h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.value-card p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========================================
   CONTACT SECTION
   ======================================== */
.contact-section {
    background: var(--teal-900);
    color: var(--white);
}

.contact-section .section-title {
    color: var(--white);
}

.contact-section .section-subtitle {
    color: var(--teal-300);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    transition: all var(--transition-base);
}

.contact-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.contact-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.contact-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.contact-card a {
    color: var(--teal-300);
}

.contact-card a:hover {
    color: var(--teal-200);
    text-decoration: underline;
}

.contact-card p {
    color: var(--teal-200);
    font-size: 0.875rem;
}

.contact-form-wrapper {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
}

.contact-form-wrapper h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background: var(--teal-600);
    color: var(--white);
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.submit-btn:hover {
    background: var(--teal-700);
}

@media (max-width: 768px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 2rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-800);
}

.footer-devanagari {
    font-size: 2rem;
    color: var(--teal-400);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-logo p {
    font-size: 0.875rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--teal-400);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.875rem;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* ========================================
   GENERATIONAL COLOR CODING
   14 distinct colors for each generation
   ======================================== */

/* Generation Color Palette */
.gen-1 { --gen-color: #7c3aed; --gen-color-light: #a78bfa; }  /* Violet */
.gen-2 { --gen-color: #6366f1; --gen-color-light: #a5b4fc; }  /* Indigo */
.gen-3 { --gen-color: #3b82f6; --gen-color-light: #93c5fd; }  /* Blue */
.gen-4 { --gen-color: #0891b2; --gen-color-light: #67e8f9; }  /* Cyan */
.gen-5 { --gen-color: #0d9488; --gen-color-light: #5eead4; }  /* Teal */
.gen-6 { --gen-color: #059669; --gen-color-light: #6ee7b7; }  /* Emerald */
.gen-7 { --gen-color: #16a34a; --gen-color-light: #86efac; }  /* Green */
.gen-8 { --gen-color: #65a30d; --gen-color-light: #bef264; }  /* Lime */
.gen-9 { --gen-color: #ca8a04; --gen-color-light: #fde047; }  /* Yellow */
.gen-10 { --gen-color: #ea580c; --gen-color-light: #fdba74; } /* Orange */
.gen-11 { --gen-color: #dc2626; --gen-color-light: #fca5a5; } /* Red */
.gen-12 { --gen-color: #e11d48; --gen-color-light: #fda4af; } /* Rose */
.gen-13 { --gen-color: #db2777; --gen-color-light: #f9a8d4; } /* Pink */
.gen-14 { --gen-color: #9333ea; --gen-color-light: #d8b4fe; } /* Purple */

/* Apply generation colors to lineage nodes */
.lineage-node[data-gen] {
    border-color: var(--gen-color);
    background: linear-gradient(135deg, white, var(--gen-color-light));
}

.lineage-node[data-gen]:hover {
    background: var(--gen-color-light);
    border-color: var(--gen-color);
}

.lineage-node[data-gen] .gen-badge {
    background: var(--gen-color);
    color: white;
}

/* Apply generation colors to branch avatars */
.branch-avatar[data-gen],
.child-avatar[data-gen] {
    background: linear-gradient(135deg, var(--gen-color), var(--gen-color-light)) !important;
}

/* Modal avatar with generation color */
.modal-avatar[data-gen] {
    background: linear-gradient(135deg, var(--gen-color), var(--gen-color-light)) !important;
}

/* Family branch border accent by generation */
.family-branch[data-gen] {
    border-left: 4px solid var(--gen-color);
}

/* Generation Legend */
.generation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* ========================================
   GENDER-BASED AVATAR COLORS (Fallback)
   ======================================== */
.person-avatar.male:not([data-gen]) {
    background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
}

.person-avatar.female:not([data-gen]) {
    background: linear-gradient(135deg, #e879a9, #c084fc);
}

.modal-avatar.male:not([data-gen]) {
    background: linear-gradient(135deg, var(--teal-500), var(--blue-400));
}

.modal-avatar.female:not([data-gen]) {
    background: linear-gradient(135deg, #e879a9, #c084fc);
}

/* Modal Notes */
.modal-notes {
    text-align: center;
    color: var(--gray-500);
    font-style: italic;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

/* Event Recurring Badge */
.event-recurring {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

/* ========================================
   KULDEVI/KULDEVTA SECTION
   ======================================== */
.kuldevi-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 50%, #fef9e7 100%);
}

.kuldevi-content {
    display: flex;
    justify-content: center;
}

.kuldevi-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
    border: 2px solid #f59e0b;
}

.kuldevi-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-align: center;
    padding: 1.5rem;
}

.kuldevi-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.kuldevi-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.kuldevi-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.kuldevi-body {
    padding: 1.5rem;
}

.kuldevi-description {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    text-align: center;
}

.kuldevi-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kuldevi-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #fffbeb;
    border-radius: 10px;
    border-left: 3px solid #f59e0b;
}

.kuldevi-detail-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kuldevi-detail-content h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0 0 0.25rem 0;
}

.kuldevi-detail-content p {
    color: var(--gray-800);
    font-weight: 500;
    margin: 0;
}

.kuldevi-detail-content a {
    color: #d97706;
    text-decoration: underline;
}

.kuldevi-detail-content a:hover {
    color: #b45309;
}

.kuldevi-traditions {
    margin-top: 1.25rem;
}

.kuldevi-traditions h4 {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.traditions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.traditions-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.traditions-list li::before {
    content: '🪔';
    flex-shrink: 0;
}

.kuldevi-map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.kuldevi-map-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

/* Multiple deity cards */
.kuldevi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

@media (max-width: 480px) {
    .kuldevi-card {
        border-radius: 16px;
    }
    
    .kuldevi-header {
        padding: 1.25rem;
    }
    
    .kuldevi-icon {
        font-size: 2.5rem;
    }
    
    .kuldevi-name {
        font-size: 1.5rem;
    }
    
    .kuldevi-body {
        padding: 1.25rem;
    }
}

/* ========================================
   FESTIVAL THEMES
   ======================================== */

/* Festival Banner */
.festival-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    animation: slideDown 0.5s ease-out;
}

.festival-icon {
    font-size: 1.25rem;
    animation: bounce 1s ease-in-out infinite;
}

.festival-greeting {
    letter-spacing: 0.02em;
}

.festival-close {
    position: absolute;
    right: 1rem;
    background: rgba(255,255,255,0.2);
    border: none;
    color: inherit;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.festival-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Adjust navbar when banner is visible */
body.has-festival-banner .navbar {
    top: 44px;
}

body.has-festival-banner .hero {
    padding-top: 114px;
}

/* ===== UTTARAYAN THEME ===== */
.theme-uttarayan .festival-banner {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
}

.theme-uttarayan .hero {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 50%, #fef3c7 100%);
}

.theme-uttarayan .hero::after {
    content: '🪁';
    position: absolute;
    font-size: 4rem;
    top: 20%;
    right: 10%;
    animation: kiteFloat 4s ease-in-out infinite;
    opacity: 0.6;
}

.theme-uttarayan .hero::before {
    content: '🪁';
    position: absolute;
    font-size: 3rem;
    top: 40%;
    left: 5%;
    animation: kiteFloat 5s ease-in-out infinite 1s;
    opacity: 0.5;
    z-index: 0;
}

@keyframes kiteFloat {
    0%, 100% { transform: translate(0, 0) rotate(-5deg); }
    50% { transform: translate(20px, -30px) rotate(5deg); }
}

/* ===== HOLI THEME ===== */
.theme-holi .festival-banner {
    background: linear-gradient(135deg, #ec4899, #f97316, #eab308, #22c55e, #3b82f6, #8b5cf6);
    color: white;
}

.theme-holi .hero {
    background: linear-gradient(135deg, #fce7f3 0%, #fef3c7 25%, #d1fae5 50%, #dbeafe 75%, #ede9fe 100%);
}

.theme-holi .hero-bg-pattern {
    background-image: 
        radial-gradient(circle at 20% 30%, #f472b6 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, #facc15 0%, transparent 25%),
        radial-gradient(circle at 50% 80%, #4ade80 0%, transparent 30%),
        radial-gradient(circle at 30% 70%, #60a5fa 0%, transparent 25%),
        radial-gradient(circle at 70% 60%, #c084fc 0%, transparent 25%);
    opacity: 0.5;
    animation: colorBurst 3s ease-in-out infinite;
}

@keyframes colorBurst {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

/* ===== RAM NAVAMI THEME ===== */
.theme-ramNavami .festival-banner {
    background: linear-gradient(135deg, #f59e0b, #dc2626);
    color: white;
}

.theme-ramNavami .hero {
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 50%, #fef2f2 100%);
}

.theme-ramNavami .hero::after {
    content: '🏹';
    position: absolute;
    font-size: 3rem;
    top: 25%;
    right: 15%;
    opacity: 0.5;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== RAKSHA BANDHAN THEME ===== */
.theme-rakshaBandhan .festival-banner {
    background: linear-gradient(135deg, #db2777, #9333ea);
    color: white;
}

.theme-rakshaBandhan .hero {
    background: linear-gradient(135deg, #fce7f3 0%, #f5f3ff 50%, #fdf4ff 100%);
}

.theme-rakshaBandhan .hero::after {
    content: '🧵';
    position: absolute;
    font-size: 3rem;
    top: 20%;
    right: 10%;
    opacity: 0.6;
    animation: swing 2s ease-in-out infinite;
}

@keyframes swing {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* ===== JANMASHTAMI THEME ===== */
.theme-janmashtami .festival-banner {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
}

.theme-janmashtami .hero {
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 50%, #fefce8 100%);
}

.theme-janmashtami .hero::after {
    content: '🦚';
    position: absolute;
    font-size: 4rem;
    top: 15%;
    right: 8%;
    opacity: 0.6;
    animation: peacockDance 3s ease-in-out infinite;
}

.theme-janmashtami .hero::before {
    content: '🪈';
    position: absolute;
    font-size: 2.5rem;
    bottom: 25%;
    left: 5%;
    opacity: 0.5;
    z-index: 0;
}

@keyframes peacockDance {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(5deg) scale(1.05); }
    75% { transform: rotate(-5deg) scale(1.05); }
}

/* ===== NAVRATRI THEME ===== */
.theme-navratri .festival-banner {
    background: linear-gradient(135deg, #dc2626, #f59e0b, #16a34a);
    color: white;
}

.theme-navratri .hero {
    background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 50%, #f0fdf4 100%);
}

.theme-navratri .hero::after {
    content: '💃';
    position: absolute;
    font-size: 3.5rem;
    top: 20%;
    right: 10%;
    opacity: 0.6;
    animation: garba 1s ease-in-out infinite;
}

.theme-navratri .hero::before {
    content: '🕺';
    position: absolute;
    font-size: 3rem;
    top: 35%;
    left: 8%;
    opacity: 0.5;
    z-index: 0;
    animation: garba 1s ease-in-out infinite 0.5s;
}

@keyframes garba {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* ===== DIWALI THEME ===== */
.theme-diwali .festival-banner {
    background: linear-gradient(135deg, #7c3aed, #f59e0b);
    color: white;
}

.theme-diwali .hero {
    background: linear-gradient(135deg, #faf5ff 0%, #fefce8 50%, #fff7ed 100%);
}

.theme-diwali .hero-bg-pattern {
    background-image: 
        radial-gradient(circle at 20% 20%, #fbbf24 0%, transparent 15%),
        radial-gradient(circle at 80% 30%, #f59e0b 0%, transparent 10%),
        radial-gradient(circle at 40% 80%, #fcd34d 0%, transparent 12%),
        radial-gradient(circle at 60% 60%, #fbbf24 0%, transparent 8%),
        radial-gradient(circle at 90% 70%, #f59e0b 0%, transparent 10%);
    opacity: 0.4;
    animation: sparkle 2s ease-in-out infinite;
}

.theme-diwali .hero::after {
    content: '🪔';
    position: absolute;
    font-size: 3rem;
    top: 20%;
    right: 10%;
    opacity: 0.7;
    animation: diyaGlow 1.5s ease-in-out infinite;
}

.theme-diwali .hero::before {
    content: '✨';
    position: absolute;
    font-size: 2rem;
    top: 40%;
    left: 10%;
    opacity: 0.6;
    z-index: 0;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes diyaGlow {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.1); filter: brightness(1.3); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* ===== BHAI DOOJ THEME ===== */
.theme-bhaiDooj .festival-banner {
    background: linear-gradient(135deg, #3b82f6, #ec4899);
    color: white;
}

.theme-bhaiDooj .hero {
    background: linear-gradient(135deg, #dbeafe 0%, #fce7f3 100%);
}

.theme-bhaiDooj .hero::after {
    content: '👫';
    position: absolute;
    font-size: 3.5rem;
    top: 20%;
    right: 12%;
    opacity: 0.6;
}

/* Festival decorative elements for sections */
.theme-diwali .section-title::before,
.theme-diwali .section-title::after {
    content: '🪔';
    margin: 0 0.5rem;
}

.theme-navratri .section-title::before,
.theme-navratri .section-title::after {
    content: '💃';
    margin: 0 0.5rem;
}

.theme-holi .section-title::before,
.theme-holi .section-title::after {
    content: '🎨';
    margin: 0 0.5rem;
}

.theme-uttarayan .section-title::before,
.theme-uttarayan .section-title::after {
    content: '🪁';
    margin: 0 0.5rem;
}

.theme-janmashtami .section-title::before,
.theme-janmashtami .section-title::after {
    content: '🦚';
    margin: 0 0.5rem;
}

.theme-rakshaBandhan .section-title::before,
.theme-rakshaBandhan .section-title::after {
    content: '🧵';
    margin: 0 0.5rem;
}

.theme-ramNavami .section-title::before,
.theme-ramNavami .section-title::after {
    content: '🏹';
    margin: 0 0.5rem;
}

.theme-bhaiDooj .section-title::before,
.theme-bhaiDooj .section-title::after {
    content: '👫';
    margin: 0 0.5rem;
}

/* Mobile responsive for festival elements */
@media (max-width: 768px) {
    .festival-banner {
        padding: 0.5rem 2.5rem 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .festival-icon {
        font-size: 1rem;
    }
    
    body.has-festival-banner .navbar {
        top: 40px;
    }
    
    body.has-festival-banner .hero {
        padding-top: 110px;
    }
    
    .theme-diwali .hero::after,
    .theme-navratri .hero::after,
    .theme-holi .hero::after,
    .theme-janmashtami .hero::after,
    .theme-uttarayan .hero::after,
    .theme-rakshaBandhan .hero::after,
    .theme-ramNavami .hero::after,
    .theme-bhaiDooj .hero::after {
        font-size: 2rem;
        right: 5%;
    }
    
    .theme-diwali .hero::before,
    .theme-navratri .hero::before,
    .theme-janmashtami .hero::before,
    .theme-uttarayan .hero::before {
        font-size: 1.5rem;
        display: none;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

