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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Reboto, sans-serif;
    background-color: rgb(194, 178, 164);
    color: #334155;
    line-height: 1.6;
    padding: 2rem;
}

h1 {
    color: #1e293b;
    font-size: 2.5rem;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

h2 {
    color: black;
    font-size: 1.8rem;
    font-weight: 600;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    margin: 2rem 0 1rem 0;
}

h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 600;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    margin-bottom: 1rem;
}

.config-section {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: black;
}

.config-section label {
    font-weight: 500;
    font-size: 1.2rem;
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    cursor: pointer;
    color: black;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.input-section, .route-calculator {
    background: rgb(128, 118, 109);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgb(84, 75, 69);
}

#inputTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

#inputTable th {
    background: rgb(68, 66, 64);
    color: white;
    font-weight: 600;
    padding: 0.75rem;
    text-align: center;
    border: 1px solid black;
    font-size: 0.9rem;
}

#inputTable td {
    padding: 0.5rem;
}

#inputTable input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #1e293b;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    text-align: center;
}

#inputTabel input:focus {
    outline: none;
    border-color: black;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

button {
    background: linear-gradient(135deg, #c1b0a3 0%, #baa074 100%);
    color: black;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover:not(:disabled) {
    background: linear-gradient(135deg, #aa9c8e 0%, #948063 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

button:disabled {
    background: #b8b094;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#generateGraph {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
}

.route-calculator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.route-calculator label {
    font-weight: 500;
    color: rgb(29, 28, 28);
    margin-bottom: 0.25rem;
}

.route-calculator select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.2s ease;
}

.route-calculator select:focus {
    outline: none;
    border-color: black;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.route-calculator select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

#calculateRoute {
    margin-top: 0.5rem;
}

#routeResult {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    min-height: 3rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

#routeResult:empty {
    display: none;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

#graphContainer {
    background: white;
    border-radius: 12px;
    border: 1px solid black !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

#adjacencyMatrix {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid black;
}

#adjacencyMatrix h3 {
    margin-bottom: 1rem;
    color: black;
}

#adjacencyMatrix table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

#adjacencyMatrix th,
#adjacencyMatrix td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid black;
}

#adjacencyMatrix th {
    background: #c3bab5;
    font-weight: 600;
    color: black;
}

#adjacencyMatrix td {
    background: white;
}

@media (max-width: 1024px) {
    .main-container,
    .results-container {
        grid-template-columns: 1fr;
    }

    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    #inputTable {
        font-size: 0.8rem;
    }

    #inputTable th,
    #inputTable td {
        padding: 0.4rem;
    }

    button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}