/* Estilos para o plugin Manus AI Image Generator (v2.0.0) */

:root {
    --manus-primary-color: #0073aa; /* Cor primária do WordPress */
    --manus-secondary-color: #28a745; /* Cor de sucesso/download */
    --manus-danger-color: #dc3545; /* Cor de perigo/limpar */
    --manus-text-color: #333;
    --manus-border-color: #ddd;
    --manus-bg-light: #f9f9f9;
}

#manus-ai-image-generator-app {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid var(--manus-border-color);
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--manus-text-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#manus-ai-image-generator-app h2 {
    text-align: center;
    color: var(--manus-primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}

#manus-ai-image-generator-app p {
    text-align: center;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Estilos do Formulário */
.manus-form-container {
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha em telas menores */
    gap: 10px;
    margin-bottom: 20px;
    align-items: stretch;
}

#manus-prompt {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid var(--manus-border-color);
    border-radius: 6px;
    font-size: 16px;
    min-width: 150px; /* Garante que não fique muito pequeno */
}

#manus-format {
    padding: 12px;
    border: 1px solid var(--manus-border-color);
    border-radius: 6px;
    font-size: 16px;
    flex-shrink: 0; /* Impede que o select encolha demais */
}

#manus-generate-btn {
    background-color: var(--manus-primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.1s;
    flex-shrink: 0;
}

#manus-generate-btn:hover {
    background-color: #005177;
}

#manus-generate-btn:active {
    transform: scale(0.98);
}

/* Estilos de Carregamento e Erro */
#manus-loading {
    text-align: center;
    padding: 15px;
    background-color: var(--manus-bg-light);
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px dashed var(--manus-primary-color);
}

.manus-error {
    color: var(--manus-danger-color);
    text-align: center;
    padding: 10px;
    border: 1px solid var(--manus-danger-color);
    background-color: #f8d7da;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* Estilos do Resultado */
#manus-result-container {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid var(--manus-primary-color);
    border-radius: 10px;
    background-color: white;
}

#manus-result-container h3 {
    color: var(--manus-text-color);
    margin-top: 0;
}

#manus-generated-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
}

.manus-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.manus-btn {
    display: inline-block;
    text-decoration: none;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.1s;
}

.manus-btn:hover {
    opacity: 0.9;
}

.manus-btn:active {
    transform: scale(0.98);
}

#manus-download-link {
    background-color: var(--manus-secondary-color);
}

.manus-share-btn {
    background-color: var(--manus-primary-color);
}

.manus-clear-btn {
    background-color: var(--manus-danger-color);
    margin-top: 10px;
}

/* Estilos da Galeria */
#manus-gallery-container h3 {
    border-bottom: 2px solid var(--manus-border-color);
    padding-bottom: 10px;
    margin-top: 30px;
    text-align: left;
    color: var(--manus-text-color);
}

#manus-gallery-empty {
    text-align: center;
    font-style: italic;
    color: #666;
}

.manus-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Ajustado para 120px para melhor visualização em mobile */
    gap: 15px;
    padding: 10px 0;
}

.manus-gallery-item {
    position: relative;
    border: 1px solid var(--manus-border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    aspect-ratio: 1 / 1; /* Garante que os itens da galeria sejam quadrados */
}

.manus-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.manus-gallery-item .manus-gallery-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 5px 0;
    display: flex;
    justify-content: space-around;
    opacity: 0;
    transition: opacity 0.3s;
}

.manus-gallery-item:hover .manus-gallery-actions {
    opacity: 1;
}

.manus-gallery-actions a, .manus-gallery-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    line-height: 1;
}

.manus-gallery-actions a:hover, .manus-gallery-actions button:hover {
    color: var(--manus-primary-color);
}

/* Estilos para Anúncios */
.manus-ad-container {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    border: 1px dashed var(--manus-border-color);
    background-color: var(--manus-bg-light);
}

/* Responsividade para telas menores (Celular) */
@media (max-width: 600px) {
    #manus-ai-image-generator-app {
        padding: 15px;
        margin: 10px;
    }

    .manus-form-container {
        flex-direction: column;
        align-items: stretch;
    }

    #manus-prompt, #manus-format, #manus-generate-btn {
        width: 100%;
        box-sizing: border-box;
    }
    
    .manus-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .manus-btn {
        width: 100%;
    }

    .manus-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
