/* --- Ambigram Tool Specific Styles --- */

:root {
    --tool-max-width: 700px;
    --input-font-size: 1.125rem;
    --output-font-size: 2.5rem; 
    --output-bg-color: #f8f9fa; 
}

.hero-tool {
    text-align: center;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.hero-tool h1 {
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 1.15rem;
    color: #5f6368;
    margin-bottom: 2.5rem;
}

/* --- Generator Form --- */
.generator-form {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 0.5rem;
    max-width: var(--tool-max-width);
    margin: 0 auto;
}

.form-group {
    flex-grow: 1;
}

.generator-form input[type="text"],
#design-select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: var(--input-font-size);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-chevron-down' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.generator-form input[type="text"]:focus,
#design-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-group-inline {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
}

#color-picker {
    height: 100%;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
}

/* --- Output Display --- */
.output-display {
    margin-top: 3rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--output-bg-color);
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --- Result Container & Download Button --- */
.result-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.download-container {
    position: relative;
    display: inline-block;
}

.btn-download {
    background-color: var(--surface-color);
    color: var(--on-surface-color);
    border: 1px solid var(--border-color);
}

.download-options {
    display: none;
    position: absolute;
    background-color: var(--background-color);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0;
    bottom: 100%; /* Position above the button */
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
}

.download-options a {
    color: var(--on-surface-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.download-options a:hover {
    background-color: var(--surface-color);
    text-decoration: none;
}

.download-options.show-options {
    display: block;
}

.design-note {
    font-size: 0.9rem;
    color: #5f6368;
    margin-top: 1rem;
    text-align: center;
}

.loading,
.error {
    font-size: 1.1rem;
    color: #5f6368;
}

.error {
    color: #d93025; /* Google-style error red */
}