/**
 * Bio Points Tree Core Components Styles
 * Full Interactive Family Tree, Timeline, and Action Modals
 */

:root {
    --bpt-tree-bg: #f8fafc;
    --bpt-node-stroke: #cbd5e1;
    --bpt-node-bg: #ffffff;
    --bpt-node-hover: #10b981;
    --bpt-spouse-color: #f43f5e;
    --bpt-parent-color: #6366f1;
}

/* ===================================================
   INTERACTIVE D3 / SVG FAMILY TREE
   =================================================== */
.bpt-tree-app {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin: 30px 0;
}

.bpt-tree-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #0f172a;
    color: #ffffff;
    border-bottom: 1px solid #1e293b;
    flex-wrap: wrap;
    gap: 12px;
}
.bpt-tree-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.bpt-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bpt-tbtn {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.bpt-tbtn:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.bpt-view-toggle-group {
    display: inline-flex;
    background: #0b1120;
    padding: 3px;
    border-radius: 9px;
    border: 1px solid #334155;
    gap: 3px;
}
.bpt-view-btn {
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}
.bpt-view-btn:hover {
    color: #ffffff !important;
}
.bpt-view-btn.active {
    background: #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.bpt-tb-divider {
    color: #334155;
    font-weight: 300;
    margin: 0 4px;
}

.bpt-tree-viewport {
    position: relative;
    width: 100%;
    height: 650px;
    background: radial-gradient(#cbd5e1 1.2px, transparent 1.2px), #f8fafc;
    background-size: 24px 24px;
    cursor: grab;
    overflow: hidden;
}
.bpt-tree-viewport:active {
    cursor: grabbing;
}

.bpt-tree-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #64748b;
    z-index: 10;
}
.bpt-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #cbd5e1;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: bpt-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes bpt-spin {
    to { transform: rotate(360deg); }
}

/* SVG Nodes & Connectors */
.bpt-link {
    fill: none;
    stroke-width: 2.2px;
    transition: stroke 0.3s;
}
.bpt-link-parent-child {
    stroke: #94a3b8;
}
.bpt-link-spouse {
    stroke: var(--bpt-spouse-color);
    stroke-dasharray: 4, 3;
    stroke-width: 2.5px;
}

/* Link Badge Pills (Separated from line so text never collides or overlaps) */
.bpt-link-badge-group {
    pointer-events: none;
}
.bpt-badge-pill-bg {
    fill: #ffffff;
    stroke: #cbd5e1;
    stroke-width: 1.2px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}
.bpt-badge-pill-bg.is-spouse {
    fill: #fff1f2;
    stroke: #fecdd3;
}
.bpt-badge-pill-text {
    font-size: 11px;
    font-weight: 700;
    fill: #475569;
    letter-spacing: 0.3px;
    font-family: inherit;
}
.bpt-badge-pill-text.text-spouse {
    fill: #e11d48;
}

/* Node Cards */
.bpt-svg-node {
    cursor: grab;
    user-select: none;
}
.bpt-svg-node:active {
    cursor: grabbing;
}
.bpt-node-card-bg {
    fill: #ffffff;
    stroke: #e2e8f0;
    stroke-width: 1.5px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.06));
    transition: all 0.25s ease;
}
.bpt-svg-node:hover .bpt-node-card-bg {
    stroke: #10b981;
    stroke-width: 2.5px;
    filter: drop-shadow(0 12px 24px rgba(16, 185, 129, 0.25));
}
.bpt-svg-node.is-root .bpt-node-card-bg {
    stroke: #10b981;
    stroke-width: 2.5px;
}
.bpt-svg-node text.node-name {
    font-size: 14px;
    font-weight: 800;
    fill: #0f172a;
}
.bpt-svg-node text.node-dates {
    font-size: 11.5px;
    font-weight: 600;
    fill: #64748b;
}
.bpt-svg-node text.node-prof {
    font-size: 10.5px;
    fill: #10b981;
    font-weight: 600;
}

/* Quick Bio Drawer */
.bpt-node-drawer {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 340px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(14px);
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.2);
    z-index: 50;
    animation: bpt-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bpt-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.bpt-drawer-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}
.bpt-drawer-close:hover { color: #0f172a; }
.bpt-drawer-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.bpt-drawer-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #10b981;
}
.bpt-drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bpt-drawer-header h3 {
    margin: 0;
    font-size: 1.18rem;
    color: #0f172a;
}
.bpt-drawer-dates {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: #64748b;
}
.bpt-drawer-bio {
    font-size: 13.5px;
    color: #334155;
    line-height: 1.55;
    margin-bottom: 18px;
}
.bpt-drawer-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Accessible Outline List */
.bpt-accessible-outline {
    padding: 30px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}
.bpt-accessible-outline ul {
    list-style: none;
    padding-left: 20px;
}
.bpt-accessible-outline li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

/* ===================================================
   GLOBAL SEARCH COMPONENT
   =================================================== */
.bpt-global-search-container {
    max-width: 860px;
    margin: 0 auto;
}
.bpt-global-search-form {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 8px 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}
.bpt-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.bpt-search-icon {
    font-size: 22px;
    color: #94a3b8;
    margin-left: 10px;
}
.bpt-search-field {
    flex-grow: 1;
    border: none;
    font-size: 16px;
    padding: 10px 6px;
    outline: none;
    font-family: inherit;
}
.bpt-search-type-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background: #f8fafc;
    color: #334155;
    outline: none;
}

/* ===================================================
   REPORT MODAL
   =================================================== */
.bpt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bpt-modal-content {
    background: #ffffff;
    border-radius: 18px;
    max-width: 520px;
    width: 100%;
    padding: 30px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: bpt-pop 0.25s ease-out;
}
@keyframes bpt-pop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.bpt-modal-close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}
.bpt-modal-content h3 {
    margin-top: 0;
    font-size: 1.35rem;
    color: #0f172a;
}
.bpt-modal-field {
    margin-bottom: 16px;
}
.bpt-modal-field label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #334155;
}
.bpt-modal-field select,
.bpt-modal-field input,
.bpt-modal-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}
