body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1, h2, h3, h5 {
    text-align: center;
    color: #333;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background-color: #f0f0f0;
    cursor: pointer;
    border: 1px solid #ddd;
}

.tab:first-child {
    border-radius: 4px 0 0 4px;
}

.tab:last-child {
    border-radius: 0 4px 4px 0;
}

.tab.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.visualization-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 20px 0;
}

.graph-container {
    flex: 1;
    min-width: 500px;
    height: 400px;
    border: 1px solid #ddd;
    margin: 10px;
}

.controls {
    text-align: center;
    margin: 20px 0;
}

button {
    padding: 10px 20px;
    margin: 0 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.danger-button {
    background-color: #f44336;
}

.danger-button:hover {
    background-color: #d32f2f;
}

.explanation {
    background-color: #f9f9f9;
    border-left: 4px solid #4CAF50;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.step-info {
    margin: 20px 0;
    font-size: 18px;
}

.step-number {
    font-weight: bold;
    color: #4CAF50;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

.mst-edge {
    background-color: #e6f7e6;
}

.priority-queue {
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #1e90ff;
}

.state-table {
    margin-top: 30px;
}

.graph-editor {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.node-editor, .edge-editor {
    margin: 15px 0;
    padding: 15px;
    border-left: 4px solid #4CAF50;
    background-color: white;
}

.row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.row label {
    width: 120px;
    margin-right: 10px;
}

input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

input[type="number"] {
    width: 80px;
}

.start-node-selector {
    margin: 20px 0;
    text-align: center;
}

.start-node-selector select {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
}

#custom-results {
    display: none;
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.graph-type-select {
    padding: 8px;
    margin-right: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.animation-controls {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

#custom-step-description {
    font-size: 16px;
    margin: 10px 0;
    font-style: italic;
}

/* Legend Styles */
.legend {
    margin: 15px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.legend h3 {
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

.legend h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #444;
}

.legend-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

.legend-section {
    min-width: 250px;
    margin: 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.legend-line {
    width: 30px;
    height: 3px;
    margin-right: 8px;
    flex-shrink: 0;
}

.legend-line.dashed {
    border-top: 3px dashed;
    height: 0;
}

.legend-label {
    font-size: 14px;
}