/* Estilo básico da página */
body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #1a1a1d;
    font-family: Arial, sans-serif;
    color: #ffffff;
}

/* Estilo do painel de controle */
#controls {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #ffffff;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Estilo para o campo de entrada de texto expansível */
#controls textarea {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    outline: none;
    width: 100%;
    resize: none; /* Remove o redimensionamento manual */
    overflow: hidden;
    min-height: 40px; /* Altura inicial mínima */
    max-height: 200px; /* Altura máxima para evitar overflow */
}


/* Estilo dos botões */
#controls button, .close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background-color: #00bfa6;
    color: #ffffff;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#controls button:hover, .close-btn:hover {
    background-color: #009a87;
}

#controls button:active, .close-btn:active {
    transform: scale(0.98);
    background-color: #007960;
}

/* Botão de Visualizar com estilo especial */
#openModalButton {
    background-color: #ff8c42;
    background: linear-gradient(45deg, #ff902b, transparent);
    color: #ffffff;
    font-weight: bold;
    border-radius: 50px;
    padding: 12px 25px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

#openModalButton:hover {
    background-color: #e07b36;
    transform: scale(1.05);
}

/* Campo de entrada de texto */
#controls input[type="text"] {
    padding: 10px;
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    outline: none;
    width: 100%;
}

/* Estilo do modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    color: #000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.close-btn {
    margin-top: 20px;
}

/* Decodificação de mensagem */
#decodedMessageText {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

/* Estilos responsivos para telas menores */
@media screen and (max-width: 768px) {
    /* Ajusta o painel de controle */
    #controls {
        width: 60%;
        margin: 10px auto;
        padding: 8px;
        gap: 10px;
    }

    /* Redimensiona o botão de visualizar */
    #openModalButton {
        padding: 8px;
        font-size: 0.9em;
        width: 100%;
        border-radius: 40px;
    }

    /* Reduz o tamanho dos botões */
    #controls button, .close-btn {
        padding: 8px;
        font-size: 0.9em;
        width: 100%;
        border-radius: 8px;
    }

    /* Ajusta a caixa de entrada de texto */
    #controls textarea {
        padding: 8px;
        font-size: 0.9em;
        min-height: 50px;
        max-height: 150px;
        width: 94%;
    }

    /* Ajusta o tamanho do modal e centraliza */
    .modal-content {
        width: 90%;
        max-width: 300px;
        padding: 15px;
    }

    /* Redimensiona o canvas */
    #avatarCanvas {
        width: 100%;
        height: auto; /* Mantém a proporção do canvas */
        max-height: 1000px;
    }
}
