body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f8;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-container {
    width: 100%;
    max-width: 1140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h1 {
    color: #1a73e8;
    margin: 0;
}

.description, .instructions {
    background-color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    width: 100%;
    max-width: 1140px;
    box-sizing: border-box;
}

.instructions h2 {
    margin-top: 0;
    color: #1a73e8;
}

.instructions ol {
    padding-left: 20px;
    margin: 0;
}

.main-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 1140px;
}

#acoCanvas {
    border: 2px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    

    flex-grow: 1;
    width: auto; 
    height: auto; 
    aspect-ratio: 800 / 600;
    max-width: 800px; 
}

#controls {
    width: 300px;
    height: 604px; 
    overflow-y: auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#controls h2 {
    margin-top: 0;
}

.results-container {
    width: 100%;
    max-width: 1140px;
    margin-top: 20px;
}

#info {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 14px;
}

@media (max-width: 1140px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    #controls {
        width: 100%;
        max-width: 800px;
    }
}

.label-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.tooltip-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    user-select: none;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    font-weight: bold;
    margin-bottom: 0;
}

input[type="range"] {
    width: 100%;
}

.buttons-wrapper {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: row; 
    gap: 10px;           
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    transition: background-color 0.2s;
    flex-grow: 1; 
}

button:hover {
    opacity: 0.9;
}

#startButton {
    background-color: #28a745;
}

#resetButton {
    background-color: #dc3545;
}

#info h3 {
    margin-top: 0;
    color: #1a73e8;
}

#info p {
    margin: 8px 0;
}

#bestPathLength, #bestPathSequence, #iterationCount, #bestIterationCount {
    font-weight: bold;
    color: #333;
}

.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-btn {
    padding: 8px 12px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
}

.lang-btn.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}


@media (max-width: 1200px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    #controls {
        width: 100%;
        max-width: 800px;
        height: auto;
        overflow-y: visible;
    }
}


@media (max-width: 840px) {
    body {
        padding: 10px; 
    }

    .header-container {
        flex-direction: column-reverse; 
        align-items: center;
        gap: 15px; 
        text-align: center;
    }

 
    #acoCanvas {
        width: 100%;
        height: auto;
    }

    #controls {
        width: 100%;
        max-width: none;
    }

    .results-container {
        width: 100%;
        max-width: none;
    }
}