/* ============================
   Mobile Drill-Down Tree
   ============================ */

.bjj-drilldown {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222;
}

/* ---- Header ---- */
.bjj-drill-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #151515;
    border-bottom: 1px solid #222;
}

.bjj-drill-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #222;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bjj-drill-back:hover {
    background: #c41e3a;
}

.bjj-drill-breadcrumb {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.bjj-drill-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bjj-drill-subtitle {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Search ---- */
.bjj-drill-search {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid #222;
}

.bjj-drill-search i {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    font-size: 13px;
    pointer-events: none;
}

.bjj-drill-search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.bjj-drill-search-input:focus {
    border-color: #c41e3a;
}

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

/* ============================
   Drilldown Global Search - Add to your bjj-bloodline.css
   ============================ */

/* Lineage path shown under name in search results */
.bjj-drill-lineage-path {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Empty state for search */
.bjj-drill-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    font-size: 14px;
    min-height: 120px;
}

.bjj-drill-empty strong {
    color: rgba(255, 255, 255, 0.6);
}

/* ---- Viewport (slides content) ---- */
.bjj-drill-viewport {
    position: relative;
    overflow: hidden;
    min-height: 200px;
}

/* ---- Slide panels ---- */
.bjj-drill-slide {
    padding: 8px 0;
    display: none;
}

.bjj-drill-slide.bjj-drill-active {
    display: block;
}

/* Slide animations */
.bjj-drill-slide.slide-out-left {
    animation: drillOutLeft 0.3s ease forwards;
}
.bjj-drill-slide.slide-in-right {
    animation: drillInRight 0.3s ease forwards;
}
.bjj-drill-slide.slide-out-right {
    animation: drillOutRight 0.3s ease forwards;
}
.bjj-drill-slide.slide-in-left {
    animation: drillInLeft 0.3s ease forwards;
}

@keyframes drillOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(-100%); opacity: 0; }
}
@keyframes drillInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes drillOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}
@keyframes drillInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ---- Parent card (shown when drilled in) ---- */
.bjj-drill-parent {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 12px 6px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #1e1015 0%, #181818 100%);
    border: 1px solid #c41e3a;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    transition: background 0.2s;
}

.bjj-drill-parent:hover {
    background: linear-gradient(135deg, #2a1520 0%, #202020 100%);
    color: #fff;
}

.bjj-drill-parent-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #c41e3a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.bjj-drill-parent-photo .bjj-initials {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.bjj-drill-parent-meta {
    flex: 1;
    min-width: 0;
}

.bjj-drill-parent-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #c41e3a;
    margin-bottom: 2px;
}

.bjj-drill-parent-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.bjj-drill-parent-rank {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 1px;
}

/* Students label */
.bjj-drill-count-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 16px 6px;
    margin: 0 12px;
}

/* ---- Individual teacher card ---- */
.bjj-drill-item {
    display: flex;
    align-items: stretch;
    margin: 0 12px 8px;
    background: #1a1a1a;
    border: 1px solid #252525;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.bjj-drill-item:active {
    border-color: #333;
}

/* Profile link (left side) */
.bjj-drill-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: #fff;
    flex: 1;
    min-width: 0;
}

/* Photo */
.bjj-drill-photo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: #c41e3a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid #333;
}

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

.bjj-drill-photo .bjj-initials {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

/* Info */
.bjj-drill-info {
    flex: 1;
    min-width: 0;
}

.bjj-drill-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
}

.bjj-drill-name .bjj-verified-sm {
    color: #28a745;
    font-size: 12px;
    flex-shrink: 0;
}

.bjj-drill-rank {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
    display: block;
}

/* Drill-in button (right side, for teachers with students) */
.bjj-drill-expand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    background: none;
    border: none;
    border-left: 1px solid #252525;
    color: #777;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.bjj-drill-expand:active {
    background: rgba(196, 30, 58, 0.15);
}

.bjj-drill-badge {
    background: #2a2a2a;
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    transition: background 0.2s;
}

.bjj-drill-expand:active .bjj-drill-badge {
    background: #c41e3a;
    color: #fff;
}

.bjj-drill-expand i {
    font-size: 12px;
    color: #555;
    transition: transform 0.2s;
}

/* ---- Empty/no results ---- */
.bjj-drill-empty {
    text-align: center;
    padding: 40px 20px;
    color: #555;
    font-size: 14px;
}

.bjj-drill-no-results {
    text-align: center;
    padding: 30px 20px;
    color: #555;
    font-size: 14px;
    display: none;
}

.bjj-drill-no-results.visible {
    display: block;
}