/* Constellation Controls - Search, Filters, Legend */

/* Controls container */
.constellation-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 320px;
}

/* Search */
.constellation-search {
    position: relative;
}

.constellation-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(200, 180, 255, 0.4);
    font-size: 13px;
    pointer-events: none;
}

.constellation-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.constellation-search-input::placeholder {
    color: rgba(200, 180, 255, 0.35);
}

.constellation-search-input:focus {
    border-color: rgba(200, 180, 255, 0.4);
}

/* Search results dropdown */
.constellation-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: rgba(15, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 10px;
    overflow: hidden;
    display: none;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.constellation-search-results.visible {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(200, 180, 255, 0.06);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(200, 180, 255, 0.1);
}

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

.search-result-team {
    font-size: 11px;
    color: rgba(200, 180, 255, 0.5);
}

/* Filters */
.constellation-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* === Conference & Edge Type Chips === */
.constellation-chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
    max-width: 100%;
}

.constellation-chip-row::-webkit-scrollbar {
    display: none;
}

.constellation-chip-row--types {
    margin-top: -4px;
}

.constellation-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 16px;
    color: rgba(200, 180, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.constellation-chip:hover {
    background: rgba(200, 180, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.constellation-chip.active {
    background: rgba(200, 180, 255, 0.18);
    border-color: rgba(200, 180, 255, 0.35);
    color: #fff;
}

.constellation-chip:focus-visible {
    outline: 2px solid rgba(200, 180, 255, 0.5);
    outline-offset: 2px;
}

.chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Toggle group */
.constellation-toggle-group {
    display: flex;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.constellation-toggle {
    padding: 7px 12px;
    background: transparent;
    border: none;
    color: rgba(200, 180, 255, 0.5);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.constellation-toggle:not(:last-child) {
    border-right: 1px solid rgba(200, 180, 255, 0.1);
}

.constellation-toggle.active {
    background: rgba(200, 180, 255, 0.15);
    color: #fff;
}

.constellation-toggle:hover:not(.active) {
    color: rgba(200, 180, 255, 0.8);
}

/* Tree View Toggle */
.constellation-tree-toggle {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: rgba(15, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(200, 180, 255, 0.15);
    border-radius: 10px;
    color: rgba(200, 180, 255, 0.5);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.constellation-tree-toggle:hover:not(:disabled) {
    background: rgba(200, 180, 255, 0.15);
    color: #fff;
}

.constellation-tree-toggle:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.constellation-tree-toggle.active {
    background: rgba(0, 255, 200, 0.15);
    border-color: rgba(0, 255, 200, 0.35);
    color: rgba(0, 255, 200, 0.85);
}

.constellation-tree-toggle:focus-visible {
    outline: 2px solid rgba(200, 180, 255, 0.5);
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .constellation-controls {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .constellation-filters {
        justify-content: flex-start;
    }

    .constellation-chip-row {
        max-width: calc(100vw - 20px);
    }

    .constellation-search-input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .constellation-tree-toggle {
        bottom: 10px;
        left: 10px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .constellation-toggle,
    .constellation-chip,
    .search-result-item,
    .constellation-search-input {
        transition: none;
    }
}
