.person-preview {
    border: 1px solid #ccc;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: inline-block;
}

.person-preview .hebrew-name {
    font-size: 18px;
    font-weight: bold;
    color: #2c5aa0;
    margin: 5px 0;
    direction: rtl;
}

.couple {
    border: 2px solid #666;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
    background-color: #e9e9e9;
    display: inline-block;
}

.single-person {
    display: inline-block;
    margin: 15px 0;
}

/* Mother-child color coding */
/* Jacob's wives */
.mother-leah {
    border: 3px solid #4A90E2 !important; /* Blue for Leah */
}

.mother-rachel {
    border: 3px solid #E24A90 !important; /* Pink for Rachel */
}

.mother-bilhah {
    border: 3px solid #4AE290 !important; /* Green for Bilhah */
}

.mother-zilpah {
    border: 3px solid #904AE2 !important; /* Purple for Zilpah */
}

/* David's wives */
.mother-ahinoam {
    border: 3px solid #FF8C42 !important; /* Orange for Ahinoam */
}

.mother-abigail {
    border: 3px solid #20B2AA !important; /* Teal for Abigail */
}

.mother-maacah {
    border: 3px solid #DC143C !important; /* Red for Maacah */
}

.mother-haggith {
    border: 3px solid #8B4513 !important; /* Brown for Haggith */
}

.mother-bathsheba {
    border: 3px solid #FFD700 !important; /* Gold for Bathsheba */
}

/* Connection lines */
.family-tree {
    position: relative;
}

.row {
    position: relative;
    z-index: 2;
    margin: 30px 0;
}

.connection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.connection-line {
    stroke: #333;
    stroke-width: 2;
}

.connection-line.dotted {
    stroke-dasharray: 5, 5;
    stroke: #666;
}

/* Person card hover effect */
.person-preview {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.person-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.person-modal {
    border: none;
    border-radius: 12px;
    padding: 0;
    max-width: 90vw;
    max-height: 95vh;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

.person-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    padding: 0;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-image-container {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-height: 500px;
}

.modal-info {
    padding: 20px 30px 30px;
}

.modal-info h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.modal-description {
    font-style: italic;
    color: #666;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.modal-summary {
    line-height: 1.6;
    color: #444;
    margin: 0 0 20px 0;
}

.modal-link {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.modal-link:hover {
    color: #0052a3;
    text-decoration: underline;
}
