/* Custom styles for the Bellman-Ford visualization */

/* Smooth transitions for graph elements */
#graph svg * {
    transition: all 0.3s ease;
}

/* Custom slider styling */
.slider {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.slider::-webkit-slider-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e5e7eb;
    border-radius: 4px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #e5e7eb;
    border-radius: 4px;
    border: none;
}

.slider::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dialog animations */
dialog {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

dialog[open] {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Button hover effects */
button {
    transition: all 0.2s ease;
}

button:active {
    transform: translateY(1px);
}

/* Graph container styling */
#graph-container {
    position: relative;
    cursor: grab; /* ADD: Change cursor to indicate panning is possible */
    background: linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#graph-container:active {
    cursor: grabbing; /* ADD: Change cursor during active pan */
}

/* Loading animation for processing nodes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.processing {
    animation: pulse 1s ease-in-out infinite;
}

/* Tooltip styling */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip:hover::after {
    opacity: 1;
}


@media (max-width: 768px) {
    .grid-cols-1.lg\\:grid-cols-5 {
        grid-template-columns: 1fr;
    }
}
