body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    overflow: auto; /* Enable scrolling on the page */
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.canvas-container {
    margin: 10px;
    flex: 1 0 calc(25% - 20px);
}

.canvas-container img, .canvas-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 1200px) {
    .canvas-container {
        flex: 1 0 calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .canvas-container {
        flex: 1 0 100%;
    }
}

.tab {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 5px; /* Reduced padding */
    border: 1px solid #ccc;
    background-color: #f1f1f1;
    color: #000;
    transition: background-color 0.3s ease;
}

.tab:hover {
    background-color: #e0e0e0;
}

input[type="radio"] {
    display: inline-block; /* Ensure radio button is visible */
    margin-right: 5px;
}

input[type="radio"]:checked + label {
    background-color: transparent; /* Remove blue background */
    color: #000; /* Change text color to default */
    font-weight: bold; /* Make the active tab text bold */
}

input[type="radio"] + label:hover {
    background-color: #e0e0e0;
}

.tab-content {
    display: none;
}

#frame {
    border: 1px solid #ccc;
    padding: 20px;
    margin-top: 10px;
    background-color: #fff;
    min-height: 100px; /* Reduced minimum height */
    width: 100%; /* Ensure width remains consistent */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.page-title {
    font-family: 'Verdana', sans-serif; /* Changed to a wider and more rounded font */
    font-size: 2em;
    margin-bottom: 20px;
    color: #333;
    text-align: center; /* Ensure it's centered */
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Ensure 2 columns */
    grid-template-rows: auto auto 1fr 1fr auto auto;
    gap: 10px;
    margin-top: 20px;
    max-height: 70vh;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}

.grid-item h4 {
    margin: 10px 0;
    text-align: center; /* Ensure the heading is centered */
}

canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto; /* Center the canvas */
}

.file-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#file-button {
    margin-bottom: 10px;
}

#file-name {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

#generate-button {
    padding: 10px 20px;
    font-size: 16px;
}

.advanced-settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

.settings-grid {
    display: flex;
    gap: 20px;  /* Space between left and right sections */
}

.settings-left {
    flex: 1;  /* Take up available space */
    display: flex;
    flex-direction: column;
    gap: 20px;  /* Space between left column items */
}

.settings-right {
    flex: 0 0 auto;  /* Don't grow, don't shrink, auto width */
    display: flex;
    flex-direction: column;
    gap: 8px;  /* Tighter spacing between checkboxes */
}

.slider-container, .dropdown-container {
    /* Remove grid-column since we're not using grid anymore */
}

.checkbox-group {
    /* Remove grid properties since we're not using grid anymore */
}

.checkbox-group .checkbox-container {
    grid-column: unset;  /* Override the individual checkbox positioning */
    margin: 0;  /* Remove default margins */
}

.slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: -10px; /* Adjust top margin to bring it closer to the slider */
    text-align: center;
}

.dropdown-container {
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: center;
}

.advanced-settings label, .settings-grid div {
    font-size: 12px; /* Smaller text size for labels */
}

#total-points {
    font-size: 1em; /* Same size as Polar Coordinates to Trace Image */
    font-weight: normal; /* Not bold */
}

.polar-coordinates-container {
    width: 100%;
    padding: 10px; /* Add padding to match the grid gap */
    border-radius: 8px;
    border: 1px solid #ccc; /* Add a border */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Add a shadow for better separation */
}

.polar-coordinates-container h4 {
    margin-bottom: 5px;
    text-align: left;
}

#polar-coordinates-textarea {
    width: calc(100% - 20px); /* Add left and right padding */
    height: 100px; /* Decrease height to avoid scroll bars */
    resize: none;
    border-radius: 8px;
    border: 1px solid #ccc;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.span-full-width {
    grid-column: span 2;
}

body {
    overflow-x: hidden; /* Show horizontal scrollbar only when needed */
}

/* Maintain proportions and minimum width, allowing horizontal scrolling */
.grid {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
    justify-content: center; /* Center the grid */
}

/* Add these styles to your styles.css file */

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

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

#prompt {
    width: calc(1ch * 20); /* Set the width to fit 20 characters */
    margin-right: 10px; /* Add space between the text box and the button */
}

#gen-image-button {
    margin-left: 10px; /* Add space between the text box and the button */
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-left: 10px; /* Add space between the button and the checkbox */
}


#api-key-group {
    width: 100%; /* Match the width of the combined width of the prompt input and button */
}

#api-key {
    width: calc(100% - 150px); /* Adjust width to match the combined width of prompt label, input, and button */
}
