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

body {
    font-family: sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1, h2 {
    margin-bottom: 15px;
    color: #555;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
}

section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
}

button {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background: #0056b3;
}

#save-key-button {
    margin-left: 10px;
}

#key-status {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.9em;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.options label {
    margin-bottom: 0; /* Adjust label margin within grid */
}

#generate-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-top: 10px;
}


.tooltip a {
    color: #fff; /* Make links white inside tooltips */
    text-decoration: underline; /* Keep underline for clarity */
}
#status-message {
    margin-bottom: 15px;
    font-weight: bold;
}

#image-result img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Basic Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .options {
        grid-template-columns: 1fr; /* Stack options vertically */
    }

    #save-key-button {
        margin-left: 0;
        margin-top: 10px; /* Add space when stacked */
        display: block; /* Make it full width */
        width: 100%;
    }
}


/* Step 8: Option Descriptions and Layout */
.option-item {
    /* Grid handles layout, add padding/margin if needed */
}

.option-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px; /* Space between control and description */
    margin-bottom: 0; /* Reset default paragraph margin */
}

/* Provider Selection Styles */
.provider-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}



.provider-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
}


#api-key-section label {
    position: relative; /* Anchor for the absolute positioned tooltip */
    display: inline-block; /* Ensure label and icon stay together */
}
.provider-option:hover {
    background-color: #f0f0f0;
}

.provider-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.disabled-label {
    color: #888;
}

.tooltip-icon {
    display: inline-block;
    margin-left: 5px;
    color: #007bff;
    cursor: help;
    font-size: 0.9em;
}

.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    z-index: 100;
    max-width: 250px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    top: 100%;
    word-wrap: break-word; /* Allow long text/links to wrap */
    left: 0;
    margin-top: 5px;
}

/* API Key Section Styles */
#api-key-section > div {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#api-key-section > div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

