/* --- GLOBAL STYLES --- */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0; padding: 0;
    background-color: #f4f4f4;
    color: #333;
}
h2 { text-align: center; color: #2c3e50; margin-top: 20px; }

/* --- MAIN CONTAINER (Scrollable) --- */
.main-container {
    width: 100%; height: 100vh;
    overflow: auto; /* Scrollable in both directions */
    padding: 20px;
    box-sizing: border-box;
}

/* --- VERTICAL TREE STRUCTURE --- */
ul.tree {
    list-style-type: none;
    padding-left: 20px; /* Indentation for the root */
    margin: 0;
}

/* The vertical line for children */
ul.tree ul {
    list-style-type: none;
    padding-left: 20px; /* Indentation for children */
    margin-left: 20px; /* Align with parent */
    border-left: 2px solid #ccc; /* THE VERTICAL LINE */
}

ul.tree li {
    margin: 0;
    padding-left: 20px; /* Space for the connector */
    position: relative;
    margin-top: 20px;
}

/* The Horizontal Connector ( --- ) */
ul.tree li::before {
    content: '';
    position: absolute;
    top: 35px; /* Aligns line to the middle of the card */
    left: 0;
    width: 20px;
    height: 2px;
    background-color: #ccc;
}

/* Fix for the last item in the list (Stop the vertical line) */
ul.tree li:last-child {
    background: #f4f4f4; /* Covers the overflowing vertical line */
    /* Note: This is a visual trick. For perfect lines, JS is sometimes needed, 
       but this works well for simple CSS trees. */
}

/* --- SUMMARY WRAPPER --- */
summary {
    cursor: pointer;
    list-style: none;
    display: inline-block;
}
summary::-webkit-details-marker { display: none; }
details > summary { list-style: none; }

/* Custom Plus/Minus Signs next to the card */
summary::after {
    content: "[ + ]"; 
    color: #888; 
    font-weight: bold; 
    margin-left: 10px;
    vertical-align: middle;
    font-size: 14px;
}
details[open] > summary::after { content: "[ - ]"; }
/* Hide sign if no children (Handled via JS class 'no-children' usually, 
   but for now we show it for consistency or hide via empty checks) */


/* --- CARD DESIGN (Unified Couple) --- */
.card {
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: inline-flex; /* Keeps husband/wife side-by-side */
    align-items: center;
    gap: 15px;
    vertical-align: middle;
    transition: 0.2s;
}
.card:hover {
    transform: translateX(5px);
    border-color: #3498db;
}

/* Divider between spouses */
.couple-divider {
    width: 1px; height: 40px; background-color: #eee;
}

/* Person Info */
.person-block {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
}
.person-block img {
    width: 40px; height: 40px; border-radius: 50%;
    object-fit: cover; border: 2px solid #f0f2f5;
}
.text-info { text-align: left; }
.text-info strong { display: block; font-size: 14px; }
.text-info small { font-size: 11px; color: #888; }

/* View Button */
.view-btn {
    background-color: #3498db; color: white;
    border: none; padding: 5px 10px;
    border-radius: 15px; font-size: 10px;
    cursor: pointer; margin-left: 5px;
}
.view-btn:hover { background-color: #2980b9; }


/* --- SIDE PANEL --- */
#side-panel {
    position: fixed; top: 0; right: -400px;
    width: 300px; height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    padding: 20px; transition: right 0.3s ease-in-out;
    z-index: 1000; overflow-y: auto;
}
#side-panel.open { right: 0; }
.close-btn {
    background: #e74c3c; color: white; border: none;
    padding: 5px 10px; border-radius: 5px; cursor: pointer; float: right;
}
.panel-profile {
    text-align: center; border-bottom: 2px dashed #eee;
    padding-bottom: 20px; margin-bottom: 20px;
}
.panel-profile img {
    width: 80px; height: 80px; border-radius: 50%;
    border: 4px solid #f0f2f5; object-fit: cover; margin-bottom: 10px;
}
.info-row {
    background: #f9f9f9; padding: 10px;
    margin-bottom: 8px; border-radius: 5px; text-align: left;
}
.info-label { font-size: 10px; font-weight: bold; color: #888; text-transform: uppercase; display: block; }
.info-value { font-size: 14px; color: #333; }