/*
 * Filename: horizontal.css
 * Description: Common styles for left-to-right (horizontal) tree views.
 * Selectors are prefixed with 'horizontal-' to avoid conflicts.
 */

/* ============================
   BLUE BUBBLE TOOLTIP
============================ */


.tooltip_heading{
    font-size: 25px;
}
.tooltip_info{
    font-size: 20px;
    font-weight: bolder ;
}
.custom-tooltip {
    position: absolute !important;
    background: #004766;            /* dark blue bubble */
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 99999;
    display: none;
    white-space: normal !important; /* allows description to wrap */
    margin-top: 170px;
}

.custom-tooltip-b {
    position: absolute !important;
    background: #004766;            /* dark blue bubble */
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    max-width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 99999;
    display: none;
    white-space: normal !important; /* allows description to wrap */
    margin-top: 90px;
}

/* Arrow on left side */
.custom-tooltip::before,.custom-tooltip-b::before  {
    content: "";
    position: absolute;
    left: -14px;
    top: 18px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent #004766 transparent transparent;
}



#horizontal-tree-container {
    position: relative;
    padding: 20px;
    font-family: Arial, sans-serif;
    overflow:auto;
    white-space: nowrap;
    min-height: 60vh;
}

#horizontal-legend-container {
    margin-bottom: 15px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.horizontal-legend-item {
    display: flex;
    align-items: center;
}

.horizontal-legend-box {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid #777;
}

/* Tree Structure */
.horizontal-genealogy-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 150px;
    display: flex;
    flex-direction: column;
}

.horizontal-genealogy-tree > ul {
    padding-left: 0;
}

.horizontal-genealogy-tree li {
    display: flex;
    align-items: center;
    margin: 10px 0;
    position: relative;
}

/* Node Styling */
.node-container {
    display: flex;
    align-items: center;
    position: relative;
}

.horizontal-member-view-box {
    border: 1px solid #555;
    border-radius: 6px;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    min-width: 200px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 2px 15px;
    transition: background 0.2s;
    position: relative;
    gap: 10px;
}

.horizontal-member-view-box:hover {
    background: #f1f1f1;
}

/* Eye Icon inside node */
.eye-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    cursor: pointer;
    flex-shrink: 0;
}
.eye-icon:hover {
    fill: #0056b3;
}

/* Add Child Button */
.horizontal-add-child-btn {
    width: 24px;
    height: 24px;
    background-color: #070907;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    z-index: 10;
    margin-left: 10px;
}

.horizontal-add-child-btn:hover {
    background-color: #0a0b0a;
    transform: scale(1.1);
}

.horizontal-hidden-subtree {
    display: none !important;
}

.horizontal-error-message {
    font-size: 0.8em;
}


/* --- Modal Styles for Horizontal Trees --- */
.horizontal-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.horizontal-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: horizontal-fadeIn 0.3s;
}

@keyframes horizontal-fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}

.horizontal-modal-header {
    padding: 12px 20px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.horizontal-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.horizontal-modal-body {
    padding: 20px;
}

.horizontal-close-button {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.horizontal-close-button:hover {
    color: black;
}

/* --- Table Styles for Modal --- */
.horizontal-budget-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.horizontal-budget-table th,
.horizontal-budget-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.horizontal-budget-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.horizontal-budget-table td:not(:first-child) {
    text-align: right;
    font-family: monospace;
}












.horizontal-budget-view-box {
    border: 1px solid #555;
    border-radius: 6px;
    background: #fff;
    color: #000;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    min-width: 170px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 2px 15px;
    transition: background 0.2s;
    position: relative;
    gap: 10px;
}

.horizontal-hidden-subtree {
    display: none !important;
}

.node-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the boxes horizontally */
}

.budget-summary-box {
    /* Styles for the summary container */
    margin-top: 3px; /* Small vertical gap */
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #eaf2f8; /* Light background to make it stand out */
    font-size: 0.75em; /* Smaller font for a compact look */
    display: flex;
    justify-content: space-around; /* Distribute space evenly */
    gap: 10px; /* Space between the summary items */
    width: 100%; /* Keep it slightly narrower than the main box */
    max-width: 250px; /* Prevent it from getting too wide */
    text-align: left;
}

.summary-item {
    white-space: nowrap; /* Prevents values from wrapping */
}

.summary-item strong {
    font-weight: 1000;
    color: #333;
    margin-right: 2px;
}

.horizontal-budget-data-box {
    display: flex; /* Arranges children horizontally */
    flex-direction: row; /* Explicitly sets the row direction */
    align-items: center; /* Vertically centers content */
    border: 1px solid #ccc; /* Optional: for visual separation */
    padding: 5px; /* Prevent amounts from wrapping */
}

/* Style for individual budget lines */
/* .horizontal-budget-data-box .budget-row {
    line-height: 1.5;
} */

.budget-row {
    margin-right: 8px; /* Adds space between the budget figures */
    white-space: nowrap; /* Prevents wrapping of the budget figures */
}

.horizontal-budget-data-box {
    width: 100%; 
    box-sizing: border-box; /* Includes padding/border in the width calculation */
}