/* ================================
   BJJ LINEAGE TREE PAGE
   ================================ */

.bjj-lineage-page {
    background: #111;
    min-height: 100vh;
}

/* Page Header */
.bjj-page-header {
    background: #000;
    padding: 4rem 0;
    text-align: center;
    border-bottom: 1px solid #222;
}

.bjj-page-header h1 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.bjj-page-intro {
    color: #888;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Tree Wrapper */
.bjj-tree-wrapper {
    position: relative;
    padding: 3rem 0 6rem;
}

.bjj-tree {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Generation Row */
.bjj-tree-generation {
    margin-bottom: 3rem;
    position: relative;
}

.bjj-generation-label {
    color: #cc3333;
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid #cc3333;
}

.bjj-generation-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

/* Tree Node */
.bjj-tree-node {
    position: relative;
}

/* Node Card */
.bjj-node-card {
    background: #000;
    border: 1px solid #222;
    width: 220px;
    transition: all 0.3s ease;
}

.bjj-node-card:hover {
    border-color: #cc3333;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.bjj-node-card.verified {
    border-color: #333;
}

.bjj-node-card.verified:hover {
    border-color: #cc3333;
}

.bjj-node-link {
    display: block;
    padding: 1.5rem;
    text-decoration: none;
    text-align: center;
}

/* Node Photo */
.bjj-node-photo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #222;
    background: #111;
}

.bjj-node-card:hover .bjj-node-photo {
    border-color: #cc3333;
}

.bjj-node-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bjj-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #cc3333;
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
}

/* Node Info */
.bjj-node-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bjj-node-name {
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.bjj-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #cc3333;
    color: #fff;
    font-size: 0.7rem;
    border-radius: 50%;
}

.bjj-node-rank {
    color: #888;
    font-size: 0.85rem;
}

.bjj-node-academy {
    color: #666;
    font-size: 0.8rem;
}

/* Connection Lines (SVG) */
.bjj-tree-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bjj-tree-lines line {
    stroke: #333;
    stroke-width: 2;
}

/* Generation Connector */
.bjj-tree-generation::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -1.5rem;
    width: 2px;
    height: 1.5rem;
    background: #333;
}

.bjj-tree-generation:first-child::before {
    display: none;
}

/* Alternate Layout - Staggered */
.bjj-tree-generation:nth-child(even) .bjj-generation-row {
    /* Slight offset for visual interest */
}

/* Search/Filter Bar (optional) */
.bjj-tree-filters {
    background: #000;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #222;
}

.bjj-tree-filters .container {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bjj-filter-label {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bjj-filter-select {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 0.5rem 2rem 0.5rem 1rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
}

.bjj-filter-select:focus {
    outline: none;
    border-color: #cc3333;
}

.bjj-search-input {
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 0.5rem 1rem;
    width: 250px;
}

.bjj-search-input::placeholder {
    color: #666;
}

.bjj-search-input:focus {
    outline: none;
    border-color: #cc3333;
}

/* Stats Bar */
.bjj-tree-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 2rem;
    background: #0a0a0a;
    border-bottom: 1px solid #222;
    justify-content: center;
}

.bjj-stat {
    text-align: center;
}

.bjj-stat-number {
    color: #cc3333;
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    line-height: 1;
}

.bjj-stat-label {
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hover Effects - Highlight Lineage */
.bjj-tree-node.highlight .bjj-node-card {
    border-color: #cc3333;
    box-shadow: 0 0 20px rgba(204, 51, 51, 0.3);
}

.bjj-tree-node.dimmed .bjj-node-card {
    opacity: 0.3;
}

/* Empty State */
.bjj-tree-empty {
    text-align: center;
    padding: 6rem 2rem;
    color: #666;
}

.bjj-tree-empty h2 {
    color: #fff;
    margin-bottom: 1rem;
}

/* Loading State */
.bjj-tree-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: #888;
}

.bjj-tree-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #cc3333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 991.98px) {
    .bjj-page-header h1 {
        font-size: 2.5rem;
    }
    
    .bjj-generation-row {
        gap: 1rem;
    }
    
    .bjj-node-card {
        width: 180px;
    }
    
    .bjj-node-photo {
        width: 60px;
        height: 60px;
    }
    
    .bjj-node-name {
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    .bjj-page-header {
        padding: 2rem 0;
    }
    
    .bjj-page-header h1 {
        font-size: 2rem;
    }
    
    .bjj-tree {
        padding: 0 1rem;
    }
    
    .bjj-generation-row {
        flex-direction: column;
        align-items: center;
    }
    
    .bjj-node-card {
        width: 100%;
        max-width: 280px;
    }
    
    .bjj-tree-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .bjj-stat {
        flex: 1 1 45%;
    }
}

/* ================================
   LINEAGE TREE - ALTERNATE STYLES
   ================================ */

/* Compact View */
.bjj-tree.compact .bjj-node-card {
    width: 160px;
}

.bjj-tree.compact .bjj-node-link {
    padding: 1rem;
}

.bjj-tree.compact .bjj-node-photo {
    width: 50px;
    height: 50px;
}

.bjj-tree.compact .bjj-node-name {
    font-size: 0.9rem;
}

.bjj-tree.compact .bjj-node-rank,
.bjj-tree.compact .bjj-node-academy {
    font-size: 0.75rem;
}

/* List View */
.bjj-tree.list-view .bjj-generation-row {
    flex-direction: column;
    align-items: stretch;
    max-width: 600px;
    margin: 0 auto;
}

.bjj-tree.list-view .bjj-node-card {
    width: 100%;
}

.bjj-tree.list-view .bjj-node-link {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.bjj-tree.list-view .bjj-node-photo {
    width: 50px;
    height: 50px;
    margin: 0;
    flex-shrink: 0;
}

.bjj-tree.list-view .bjj-node-info {
    align-items: flex-start;
}

.bjj-tree.list-view .bjj-node-name {
    justify-content: flex-start;
}