/* Alignment View Mode Styles */

/* Custom font for alignment labels */
@font-face {
    font-family: 'DungeonChurch';
    src: url('https://cdn.jsdelivr.net/gh/oakbrad/dungeonchurch-basilica@main/assets/ws.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Controls container for search and toggle */
#controls-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* View toggle button */
#view-toggle {
    background: #ff2600;
    border: 1px solid #ff2600;
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#view-toggle:hover {
    background: #cc1e00;
    border-color: #cc1e00;
}

#view-toggle.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #ff2600;
}

/* Path toggle button */
#path-toggle {
    background: #ff2600;
    border: 1px solid #ff2600;
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#path-toggle:hover {
    background: #cc1e00;
    border-color: #cc1e00;
}

#path-toggle.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #ff2600;
}

/* Path mode styling */

/* Start and End nodes - white, no glow */
.node-path-start circle,
.node-path-end circle {
    filter: none !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
    stroke-width: 2.5px !important;
    transform: scale(175%, 175%);
    transition: all 0.4s ease-out;
}

.node-path-start text,
.node-path-end text {
    fill: #000000 !important;
    transform: scale(175%, 175%);
    transition: all 0.4s ease-out;
}

/* Waiting animation for start node before second selection */
.node-path-waiting circle {
    animation: pathPulse 1.5s ease-in-out infinite;
}

@keyframes pathPulse {
    0%, 100% { filter: none; }
    50% { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)); }
}

/* Intermediate nodes on the path - red style */
.node-path-member circle {
    filter: none !important;
    stroke: #ffffff !important;
    fill: #ff2600 !important;
    stroke-width: 2.5px !important;
    transform: scale(125%, 125%);
    transition: all 0.4s ease-out;
}

.node-path-member text {
    fill: #ffffff !important;
    transform: scale(125%, 125%);
    transition: all 0.4s ease-out;
}

/* Links along the path - white */
.link-path {
    stroke: #ffffff !important;
    stroke-opacity: 0.9 !important;
    stroke-width: 3px !important;
    transition: all 0.4s ease-out;
}

/* Toast notification for path feedback */
.path-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s ease-out;
    z-index: 1001;
    pointer-events: none;
}

.path-toast.show {
    opacity: 1;
}

/* Alignment grid styling */
.alignment-grid {
    pointer-events: none;
}

.alignment-cell {
    transition: opacity 0.3s ease;
}

.alignment-label {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    pointer-events: none;
    user-select: none;
}

/* Node styling in alignment mode */
.node circle.alignment-mode {
    transition: opacity 0.3s ease, stroke 0.3s ease, stroke-width 0.3s ease;
}

/* Drift indicator - nodes that have "fallen" from stated alignment */
.node circle.high-drift {
    stroke: #ff6b6b !important;
    stroke-width: 3px !important;
}

.node circle.moderate-drift {
    stroke: #ffd93d !important;
    stroke-width: 2.5px !important;
}

/* Tooltip additions for alignment info */
.tooltip-alignment {
    position: absolute;
    padding: 10px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    pointer-events: none;
    z-index: 1001;
    max-width: 250px;
}

.tooltip-alignment .alignment-values {
    display: grid;
    grid-template-columns: auto auto;
    gap: 4px 12px;
    margin-top: 8px;
}

.tooltip-alignment .alignment-label {
    color: #888;
}

.tooltip-alignment .alignment-value {
    color: #fff;
    font-weight: bold;
}

.tooltip-alignment .drift-warning {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #444;
    color: #ff6b6b;
    font-style: italic;
}

/* Alignment legend (optional - could be added) */
.alignment-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    font-size: 11px;
    color: #888;
}

.alignment-legend h4 {
    margin: 0 0 8px 0;
    color: #e0e0e0;
    font-size: 12px;
}

.alignment-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}

.alignment-legend .legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #controls-container {
        flex-direction: column;
    }

    #view-toggle {
        width: 100%;
    }
}
