/* Graph Algorithm Visualizer Styles - Premium Gold Theme */

@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600;700&family=Playfair+Display:wght@400;600;700&display=swap');

:root {
    --gold-primary: #D4AF37;
    --gold-light: #F4D03F;
    --gold-dark: #B8941E;
    --dark-bg: #0A0A0A;
    --dark-surface: #151515;
    --text-primary: #E8E8E8;
    --text-secondary: #B0B0B0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Code Pro', 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #0a0a15 0%, #1a1a2e 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.85), rgba(25, 25, 35, 0.85));
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 
        0 4px 16px rgba(212, 175, 55, 0.15),
        0 0 30px rgba(212, 175, 55, 0.1);
    backdrop-filter: blur(10px);
}

.back-button:hover {
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.25);
    transform: translateX(-4px);
    color: #D4AF37;
}

.back-button::before {
    content: '←';
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.container {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    color: var(--gold-primary);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 5px;
    font-family: 'Playfair Display', serif;
    color: var(--gold-light);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.85;
    font-weight: 400;
    color: var(--text-secondary);
}

.algo-description {
    margin-bottom: 16px;
    color: #f0f0f0;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 0 12px rgba(240, 240, 240, 0.7);
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    flex: 1;
    max-width: 2000px;
    margin: 0 auto;
    width: 100%;
}

.visualization-area {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 20px;
}

/* Control Panel */
.control-panel {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.03));
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(212, 175, 55, 0.2);
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: var(--dark-surface);
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-primary), var(--gold-dark));
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

.section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Playfair Display', serif;
}

/* Algorithm Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.algo-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.algo-btn:hover {
    border-color: var(--gold-primary);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.algo-btn.active {
    border-color: var(--gold-primary);
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    color: var(--dark-bg);
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}

.algo-btn .icon {
    font-size: 1.2rem;
}

/* Control Buttons */
.control-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
    border-color: rgba(212, 175, 55, 0.6);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn .icon {
    font-size: 1rem;
}

/* Slider */
.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(212, 175, 55, 0.2);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.speed-label {
    margin-top: 8px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-secondary);
}

#speedValue {
    font-weight: 600;
    color: var(--gold-light);
}

/* Checkboxes */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

/* Node Selection */
.node-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.node-selection label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.node-selection select {
    padding: 8px 12px;
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.node-selection select:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.node-selection select:hover {
    border-color: rgba(212, 175, 55, 0.5);
}

.node-selection select option {
    background: var(--dark-surface);
    color: var(--text-primary);
}

/* Visual Style Selector */
.style-selector {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.style-selector:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.style-selector:hover {
    border-color: rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
}

.style-selector option {
    background: var(--dark-surface);
    color: var(--text-primary);
}

/* Info Panels */
.info-panel, .stats-panel {
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.6), rgba(10, 10, 20, 0.5));
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.algo-info p {
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.algo-info p strong {
    color: var(--gold-light);
    font-size: 0.95rem;
}

.complexity {
    font-family: 'Source Code Pro', monospace;
    background: rgba(212, 175, 55, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem !important;
    color: var(--gold-primary) !important;
    font-weight: 600 !important;
}

/* Statistics */
.stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
}

/* Canvas Container */
.canvas-container {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 2px solid rgba(255, 180, 50, 0.6);
    border-radius: 16px;
    box-shadow: 
        0 0 40px rgba(255, 165, 0, 0.3),
        0 0 20px rgba(255, 180, 50, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.05),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    cursor: grab;
    min-height: 600px;
    backdrop-filter: blur(20px);
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(120deg, transparent 0%, rgba(212, 175, 55, 0.02) 50%, transparent 100%),
        linear-gradient(240deg, transparent 0%, rgba(100, 200, 150, 0.02) 50%, transparent 100%);
    animation: polygonShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes polygonShift {
    0%, 100% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    25% {
        transform: translateX(5%) translateY(-3%) rotate(2deg);
        opacity: 0.5;
    }
    50% {
        transform: translateX(-3%) translateY(5%) rotate(-1deg);
        opacity: 0.4;
    }
    75% {
        transform: translateX(4%) translateY(2%) rotate(1deg);
        opacity: 0.6;
    }
}

.canvas-container.dragging {
    cursor: grabbing;
}

#riveCanvas,
#graphCanvas {
    position: absolute;
    top: 0;
    left: 0;
    /* Remove width/height to prevent distortion - let JS set size */
    display: block;
    z-index: 1;
}

#riveCanvas {
    z-index: 2;
    pointer-events: none;
}

#graphCanvas {
    z-index: 3;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.step-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Legend */
.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    box-shadow: 
        0 4px 20px rgba(212, 175, 55, 0.2),
        0 0 40px rgba(212, 175, 55, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-info {
    animation: fadeIn 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .visualization-area {
        grid-template-columns: 1fr;
    }
    
    .data-panel {
        max-height: 400px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        max-height: none;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .control-buttons {
        grid-template-columns: 1fr;
    }
    
    .legend {
        gap: 10px;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
}

/* Custom Scrollbar for Webkit browsers */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Button transitions */
button {
    transition: transform 0.1s ease;
}

button:active {
    transform: scale(0.95);
}

/* Data Panel Styles */
.data-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.08));
    border: 1.5px solid rgba(255, 215, 0, 0.5);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 
        0 8px 32px rgba(255, 215, 0, 0.25),
        0 0 70px rgba(255, 215, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    font-family: 'JetBrains Mono', monospace;
    backdrop-filter: blur(20px);
}

.data-panel::-webkit-scrollbar {
    width: 6px;
}

.data-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.data-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.panel-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd700;
    margin: 0;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.data-section {
    margin-bottom: 20px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    border-left: 3px solid rgba(212, 175, 55, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-left: 3px solid rgba(212, 175, 55, 0.6);
    backdrop-filter: blur(5px);
}

.data-section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffd700;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.data-content {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Priority Queue View */
.pq-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin: 4px 0;
    background: linear-gradient(to right, #e8dfdf, #f5f0f0);
    border-radius: 6px;
    border: 2px dashed #999;
    font-weight: 500;
    color: #2a2a2a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
}

.pq-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pq-item.current {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.pq-item.invalid {
    opacity: 0.5;
    text-decoration: line-through;
    border-left-color: #f44336;
}

.pq-item.stale {
    opacity: 0.6;
    text-decoration: line-through;
    border-left-color: #999;
    background: #f5f5f5;
}

.pq-item.popped {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.pq-item.pq-top {
    border: 3px solid #4caf50;
    border-style: solid;
    background: linear-gradient(to right, #e8f5e9, white);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
    font-weight: 600;
}

.pq-node {
    font-weight: 700;
    color: #5a8fdd;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 0 14px rgba(90, 143, 221, 0.9);
}

.pq-distance {
    font-weight: 700;
    color: #a566ee;
    text-shadow: 0 0 14px rgba(165, 102, 238, 0.9);
}

.pq-label {
    font-size: 10px;
    padding: 2px 6px;
    background: #f44336;
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.pq-label-top {
    background: #4caf50;
    font-size: 11px;
    padding: 3px 8px;
    animation: pulse-top 1.5s ease-in-out infinite;
}

@keyframes pulse-top {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Distance Table View */
.table-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
}

.table-cell {
    padding: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.table-cell.header {
    background: linear-gradient(135deg, rgba(168, 199, 255, 0.3), rgba(168, 199, 255, 0.2));
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(168, 199, 255, 0.3);
}

.table-cell.updated {
    background: #fff9c4;
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
    animation: cellPulse 0.5s ease;
    color: #1a1a1a !important;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.9), inset 0 0 10px rgba(255, 215, 0, 0.5);
}

.table-cell.infinity {
    color: var(--text-secondary);
    text-shadow: 0 0 6px rgba(176, 176, 176, 0.3);
}

@keyframes cellPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Comparison View */
.comparison-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comparison-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.85), rgba(15, 15, 25, 0.8));
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(5px);
}

.comparison-label {
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.comparison-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #6ba3ff;
    text-shadow: 0 0 15px rgba(107, 163, 255, 0.9);
}

.comparison-operator {
    font-size: 1.2rem;
    font-weight: 700;
    color: #b87dff;
    text-align: center;
    text-shadow: 0 0 15px rgba(184, 125, 255, 0.9);
}

.comparison-result {
    padding: 8px 12px;
    background: #4caf50;
    color: white;
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
}

.comparison-result.false {
    background: #f44336;
}

/* Matrix View for Floyd-Warshall */
.matrix-view {
    overflow-x: auto;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.matrix-table th,
.matrix-table td {
    padding: 6px;
    text-align: center;
    border: 1px solid #e0e0e0;
    min-width: 40px;
}

.matrix-table th {
    background: linear-gradient(135deg, rgba(168, 199, 255, 0.3), rgba(168, 199, 255, 0.2));
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(168, 199, 255, 0.5);
    border: 1px solid rgba(168, 199, 255, 0.3);
}

.matrix-table td {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    font-weight: 500;
    color: var(--text-primary);
}

.matrix-table td.intermediate {
    background: #fff9c4;
    border: 2px solid #ffd54f;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.source {
    background: #e3f2fd;
    border: 2px solid #64b5f6;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.target {
    background: #f3e5f5;
    border: 2px solid #ba68c8;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.updated {
    background: #c8e6c9;
    animation: cellPulse 0.5s ease;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.infinity {
    color: var(--text-secondary);
    text-shadow: 0 0 6px rgba(176, 176, 176, 0.3);
}

/* Floyd-Warshall specific cell highlighting */
.matrix-table td.floyd-accept-candidate {
    background: #c8e6c9;
    border: 2px solid #4caf50;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.floyd-compare-current {
    background: #fff9c4;
    border: 2px solid #ffc107;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.floyd-reject-candidate {
    background: #ffccbc;
    border: 2px solid #ff9800;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.floyd-keep {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1a1a1a !important;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(26, 26, 26, 0.5);
}

.matrix-table td.floyd-accepted {
    background: #4caf50;
    color: white;
    font-weight: 700;
    border: 2px solid #2e7d32;
}

.matrix-table td.floyd-updated {
    background: #81c784;
    color: white;
    font-weight: 700;
    border: 2px solid #4caf50;
    animation: cellPulse 0.5s ease;
}

/* Queue View for SPFA */
.queue-view {
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 6px;
    backdrop-filter: blur(5px);
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px;
    background: linear-gradient(135deg, rgba(168, 199, 255, 0.4), rgba(100, 181, 246, 0.3));
    color: var(--text-primary);
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-shadow: 0 0 8px rgba(168, 199, 255, 0.6);
    border: 1px solid rgba(168, 199, 255, 0.4);
}

.queue-item.front {
    background: #4caf50;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

/* MST Edges List */
.mst-edge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.75), rgba(15, 15, 25, 0.7));
    border-radius: 6px;
    border-left: 3px solid #ba68c8;
    font-weight: 500;
    border: 1px solid rgba(212, 175, 55, 0.25);
    backdrop-filter: blur(5px);
}

.mst-edge-nodes {
    color: #6ba3ff;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(107, 163, 255, 0.9);
}

.mst-edge-weight {
    color: #b87dff;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(184, 125, 255, 0.9);
}

/* Union-Find Sets (Kruskal) */
.union-find-sets {
    margin-bottom: 16px;
}

.uf-set {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 4px 0;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.75), rgba(15, 15, 25, 0.7));
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-left: 3px solid #4caf50;
    font-weight: 500;
    backdrop-filter: blur(5px);
    box-shadow: -2px 0 8px rgba(76, 175, 80, 0.4);
}

.uf-set-label {
    font-weight: 700;
    font-size: 12px;
}

.uf-set-nodes {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}
