/* Constellation Detail Panel */

/* === Glass Cascade: Staggered content reveal === */
@keyframes panelCascadeIn {
    from {
        transform: translateY(12px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.constellation-panel.cascading .constellation-panel-header,
.constellation-panel.cascading .constellation-panel-section,
.constellation-panel.cascading .panel-connection {
    opacity: 0;
    transform: translateY(12px);
}

.constellation-panel.cascade-reveal .constellation-panel-header,
.constellation-panel.cascade-reveal .constellation-panel-section,
.constellation-panel.cascade-reveal .panel-connection {
    animation: panelCascadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--cascade-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
    .constellation-panel.cascading .constellation-panel-header,
    .constellation-panel.cascading .constellation-panel-section,
    .constellation-panel.cascading .panel-connection {
        opacity: 1;
        transform: none;
    }
    .constellation-panel.cascade-reveal .constellation-panel-header,
    .constellation-panel.cascade-reveal .constellation-panel-section,
    .constellation-panel.cascade-reveal .panel-connection {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.constellation-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(200, 180, 255, 0.1);
    z-index: 20;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(200, 180, 255, 0.2) transparent;
}

.constellation-panel.open {
    transform: translateX(0);
}

.constellation-panel::-webkit-scrollbar {
    width: 6px;
}

.constellation-panel::-webkit-scrollbar-track {
    background: transparent;
}

.constellation-panel::-webkit-scrollbar-thumb {
    background: rgba(200, 180, 255, 0.2);
    border-radius: 3px;
}

/* Close button */
.constellation-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.2s, color 0.2s;
}

.constellation-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Content */
.constellation-panel-content {
    padding: 24px 20px;
}

/* Header */
.constellation-panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-right: 36px;
}

.panel-coach-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(200, 180, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.panel-coach-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.panel-coach-avatar .avatar-initials {
    font-size: 20px;
    font-weight: 600;
    color: rgba(200, 180, 255, 0.7);
}

.panel-coach-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.panel-coach-team {
    font-size: 13px;
    color: rgba(200, 180, 255, 0.7);
}

.panel-coach-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section */
.constellation-panel-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(200, 180, 255, 0.08);
}

.constellation-panel-section:last-child {
    border-bottom: none;
}

.panel-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(200, 180, 255, 0.5);
    margin: 0 0 12px 0;
    font-weight: 600;
}

/* Stats grid */
.panel-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.panel-stat {
    text-align: center;
    padding: 10px 4px;
    background: rgba(200, 180, 255, 0.05);
    border-radius: 8px;
}

.panel-stat-value {
    font-family: var(--font-data, 'JetBrains Mono', monospace);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-data-primary, rgba(0, 255, 200, 0.85));
    line-height: 1;
    text-shadow: 0 0 8px var(--color-data-glow, rgba(0, 255, 200, 0.25));
    font-variant-numeric: tabular-nums;
}

.panel-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(200, 180, 255, 0.5);
    margin-top: 4px;
}

/* Philosophy tags */
.panel-philosophy-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-philosophy-tag {
    padding: 4px 10px;
    background: rgba(200, 180, 255, 0.1);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 12px;
    font-size: 12px;
    color: rgba(200, 180, 255, 0.8);
}

/* Career Timeline */
.panel-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panel-timeline-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}

.panel-timeline-entry:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 34px;
    bottom: -4px;
    width: 1px;
    background: rgba(200, 180, 255, 0.12);
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(200, 180, 255, 0.4);
    margin-top: 4px;
    flex-shrink: 0;
    margin-left: 14px;
}

.timeline-dot.hc { background: rgba(255, 215, 0, 0.7); }
.timeline-dot.oc { background: rgba(100, 200, 255, 0.7); }
.timeline-dot.dc { background: rgba(255, 100, 100, 0.7); }

.timeline-info {
    flex: 1;
    min-width: 0;
}

.timeline-school {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.timeline-role {
    font-size: 12px;
    color: rgba(200, 180, 255, 0.6);
}

.timeline-years {
    font-family: var(--font-data, 'JetBrains Mono', monospace);
    font-size: 11px;
    color: var(--color-data-secondary, rgba(0, 255, 200, 0.55));
    font-variant-numeric: tabular-nums;
}

.timeline-record {
    font-family: var(--font-data, 'JetBrains Mono', monospace);
    font-size: 12px;
    color: var(--color-data-secondary, rgba(0, 255, 200, 0.55));
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

/* Connections */
.panel-connections {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-connection {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(200, 180, 255, 0.04);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-connection:hover {
    background: rgba(200, 180, 255, 0.1);
}

.connection-type-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.connection-type-indicator.mentor_mentee { background: rgba(255, 215, 0, 0.7); }
.connection-type-indicator.coaching_tree { background: rgba(100, 200, 255, 0.7); }
.connection-type-indicator.shared_staff { background: rgba(180, 180, 180, 0.5); }
.connection-type-indicator.successor { background: rgba(100, 255, 100, 0.7); }
.connection-type-indicator.rivalry { background: rgba(255, 100, 100, 0.7); }

.connection-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.connection-detail {
    font-size: 11px;
    color: rgba(200, 180, 255, 0.5);
}

.connection-arrow {
    color: rgba(200, 180, 255, 0.3);
    font-size: 12px;
}

/* Responsive: tablet - bottom sheet */
@media (max-width: 992px) {
    .constellation-panel {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: 1px solid rgba(200, 180, 255, 0.1);
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .constellation-panel.open {
        transform: translateY(0);
    }
}

/* Responsive: mobile - full screen modal */
@media (max-width: 768px) {
    .constellation-panel {
        height: 70%;
        border-radius: 16px 16px 0 0;
    }

    .panel-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .constellation-panel {
        transition: none;
    }

    .panel-connection {
        transition: none;
    }
}
