/* Galaxy Page Overrides
   Extends constellation.css with transfer-galaxy-specific styles.
   The base constellation layout, controls, animations are inherited.
*/

/* Loading overlay fade-out */
#galaxyLoading {
    transition: opacity 0.6s ease;
}

#galaxyLoading.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Refresh pulse for filter changes (not first load) */
.galaxy-refresh-pulse .galaxy-node {
    animation: galaxyNodePulse 0.4s ease;
}

@keyframes galaxyNodePulse {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    #galaxyLoading {
        transition: none;
    }

    .galaxy-refresh-pulse .galaxy-node {
        animation: none;
    }
}

/* Search section labels and player results */
.search-section-label {
    padding: 6px 14px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(200, 180, 255, 0.4);
    border-bottom: 1px solid rgba(200, 180, 255, 0.06);
}

.search-result-pos {
    font-size: 0.7rem;
    color: rgba(200, 180, 255, 0.45);
    min-width: 24px;
}

.search-result-stars {
    font-size: 0.7rem;
    color: #ffd700;
}

.search-player-result .search-result-team {
    display: block;
    margin-top: 1px;
}

/* Year selector inline with star chips */
.galaxy-year-selector {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.galaxy-year-selector select {
    background: rgba(20, 10, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease;
}

.galaxy-year-selector select:hover,
.galaxy-year-selector select:focus {
    border-color: rgba(255, 255, 255, 0.35);
}

/* Sizing toggle chip */
.galaxy-sizing-chip {
    margin-left: 0.5rem;
}

.galaxy-sizing-chip i {
    margin-right: 0.25rem;
}

/* Position chip row spacing */
.galaxy-chip-row--positions {
    margin-top: 0.25rem;
}

.galaxy-chip-row--stars {
    margin-top: 0.25rem;
}

/* Team nodes (circle + label) */
.galaxy-node {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.galaxy-node.dimmed {
    opacity: 0.15;
}

.galaxy-node.highlighted {
    opacity: 1;
}

.galaxy-node.selected .node-ring {
    stroke-width: 3;
    stroke-opacity: 1;
}

.galaxy-node-circle {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
    transition: stroke-width 0.2s ease;
}

.galaxy-node:hover .galaxy-node-circle {
    stroke-width: 2.5;
    stroke: rgba(255, 255, 255, 0.6);
}

.galaxy-node-label {
    fill: rgba(255, 255, 255, 0.8);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    font-weight: 500;
    text-anchor: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(10, 5, 25, 0.7);
    stroke-width: 3px;
}

/* Transfer edges (directed) */
.galaxy-edge {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-linecap: round;
    transition: stroke-opacity 0.2s ease;
    marker-end: url(#transferArrow);
}

.galaxy-edge.highlighted {
    stroke-opacity: 0.6;
    marker-end: url(#transferArrowHighlight);
}

.galaxy-edge.dimmed {
    stroke-opacity: 0.03;
}

/* Tooltip */
.galaxy-tooltip {
    position: fixed;
    background: rgba(15, 10, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 1000;
    max-width: 250px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: none;
}

.galaxy-tooltip-name {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.galaxy-tooltip-conf {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
}

.galaxy-tooltip-stats {
    display: flex;
    gap: 0.75rem;
}

.galaxy-tooltip-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.galaxy-tooltip-stat-value {
    font-weight: 600;
    font-size: 0.8rem;
}

.galaxy-tooltip-stat-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
}

.tooltip-incoming { color: #28a745; }
.tooltip-outgoing { color: #dc3545; }
.tooltip-net-pos { color: #28a745; }
.tooltip-net-neg { color: #dc3545; }

/* Panel team logo */
.panel-team-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
