/* Graph Traversal Visualizer Styles */

.node {
    transition: all 0.3s ease;
    cursor: pointer;
}

.node.visiting {
    fill: #f59e0b !important;
    stroke: #d97706 !important;
    stroke-width: 3 !important;
}

.node.visited {
    fill: #10b981 !important;
    stroke: #059669 !important;
    stroke-width: 3 !important;
}

.node.current {
    fill: #ef4444 !important;
    stroke: #dc2626 !important;
    stroke-width: 4 !important;
    animation: pulse 1s infinite;
}

.edge {
    stroke: #6b7280;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.edge.active {
    stroke: #3b82f6;
    stroke-width: 3;
}

/* Animation keyframes */
@keyframes pulse {
    0% {
        stroke-width: 4;
    }
    50% {
        stroke-width: 6;
    }
    100% {
        stroke-width: 4;
    }
}

/* Button styles */
button {
    transition: all 0.3s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 20px;
}

input[type="range"]::-webkit-slider-track {
    background: #475569;
    height: 5px;
    border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-track {
    background: #475569;
    height: 5px;
    border-radius: 5px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Select dropdown styling */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23ffffff' d='m0 1 2 2 2-2'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

/* Data structure visualization */
.data-structure-item {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background-color: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.data-structure-item.queue {
    background-color: #06b6d4;
}

.data-structure-item.stack {
    background-color: #8b5cf6;
}

/* Node labels */
.node-label {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    fill: white;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    #graphSvg {
        width: 100%;
        max-width: 400px;
        height: 300px;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-xl {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    #graphSvg {
        width: 100%;
        max-width: 300px;
        height: 250px;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #64748b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}