body {
    font-family: 'Roboto', sans-serif;
    background-color: #f5f6fa;
    margin: 0;
    padding: 20px;
    color: #333;
}

h1 {
    color: #2f3640;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 20px;
}

#container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1000px; /* Restrict max width to make alignment more structured */
}

#code {
    width: 100%;
    padding: 10px;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Keep grid layout but aligned left */
    gap: 15px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: #fff;
    padding: 15px;
    border: 1px solid #dcdde1;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2f3640;
}

input[type="number"] {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s ease;
}

input[type="number"]:focus {
    border-color: #40739e;
}

/* Modern Info Button Styling */
.info-icon {
    margin-left: 5px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #40739e;
    color: white;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    transition: background-color 0.3s ease;
}

.info-icon:hover {
    background-color: #3498db;
}

/* Tooltip Popup Styling */
.popup {
    display: none;
    position: absolute;
    background-color: #fff;
    border: 1px solid #dcdde1;
    padding: 10px;
    border-radius: 5px;
    width: 220px;
    top: 25px;
    left: 0px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
    color: #2f3640;
    z-index: 10;
}

.info-icon:hover .popup {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input[type="submit"] {
    padding: 10px 20px;
    background-color: #40739e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

input[type="submit"]:hover {
    background-color: #3498db;
}

#output {
    border: 1px solid #dcdde1;
    padding: 20px;
    border-radius: 8px;
    background-color: #fff;
    margin-top: 20px;
    font-size: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    #container {
        flex-direction: column;
    }

    textarea {
        width: 100%;
    }

    .grid-container {
        grid-template-columns: 1fr; /* Single column layout on smaller screens */
    }
}

.result-line {
    display: flex;
    position: relative; /* Ensure the container is positioned relative to the result line */
    width: 50ch; /* Set a fixed width for the code line container */
    margin-bottom: 10px; /* Increase the distance between code lines */
    font-family: monospace; /* Use a monospace font */
    white-space: pre; /* Prevent text from wrapping */
}

.details-button {
    position: absolute;
    left: 50ch; /* Position the button 50 characters to the right */
    top: 0;
    background-color: #40739e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    padding: 5px 10px; /* Add padding for better appearance */
    white-space: nowrap; /* Prevent text from wrapping */
    width: auto; /* Allow the button to adjust its width automatically */

}

.details {
    display: none;
    position: absolute; /* Position the details container absolutely */
    left: 60ch; /* Adjust as needed */
    top: 0;
    padding: 10px;
    z-index: 999; /* Ensure it appears above other elements */
}

.details.visible {
    display: block;
}
.details-window {
    padding: 10px;
    margin-top: 10px;
    background-color: #f9f9f9;
}
.description {
    margin-top: 10px;
    font-style: italic;
}

.imaginal-container {
    display: grid;
    position: absolute; /* Position the imaginal container absolutely */
    left: 65ch; 
    width: calc(100% - 73ch); /* Set the width to max-width minus 60 characters */
    max-height: 100%; /* Set the maximum height to 100% of the parent container */
    overflow-x: auto; /* Enable vertical scrolling if content exceeds the height */
    overflow-y: auto; /* Enable vertical scrolling if content exceeds the height */
    grid-template-rows: auto 1fr; /* Two rows layout */
    grid-template-columns: 1fr 1fr 4fr; /* Three columns layout */
    gap: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
    z-index: 1000; /* Ensure it appears above other elements */
}

.imaginal-header {
    grid-column: span 3; /* Make the header span all three columns */
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.imaginal-column {
    border: 1px solid #ccc;
    padding: 10px;
}

.imaginal-button {
    display: block;
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
    background-color: #40739e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

.imaginal-button:hover {
    background-color: #305a7e;
}

.imaginal-description {
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
}
.flex-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.flex-container select {
    margin-top: 10px;
}

.flex-container textarea {
    flex-grow: 1;
    min-width: 60px; /* Allow the textarea to shrink */
    min-height: 40px;
}

.parameters-menu {
    display: none;
    margin-top: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
}

.parameters-menu.visible {
    display: block;
}

.snippet-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.snippet-container select {
    margin-top: 0; /* Remove the top margin from the dropdown */
}