.chat-container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
    height: 90vh; /* Ajusta el contenedor al alto de la pantalla */
    background: #fff;
    padding: 1rem;
    box-sizing: border-box;
}

.chat-header {
    background-color: #0070cd;
    color: #fff;
    padding: 10px;
    font-weight: bold;
    text-align: center;
}

.chat-body {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    overflow-y: auto;
    flex: 1; /* Ocupa el espacio disponible */
    height: calc(100% - 120px); /* Ajusta el tamaño para dejar espacio al header y form */
}

.chat-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #fff; /* Fondo blanco */
    box-sizing: border-box;
    width: 100%;
}

.chat-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-size: 1rem;
}

.chat-form button {
    padding: 1rem;
    background-color: #0070cd;
    color: white;
    border: none;
    cursor: pointer;
}

.large-text {
    font-size: 1rem;
    width: 100%;
    resize: none;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin-right: 0.5rem;
}

.user-message {
    text-align: right;
    align-self: flex-end;
    margin: 0.5rem 0;
    background-color: #0070cd;
    padding: 0.5rem;
    color: white;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.ai-message {
    text-align: left;
    margin: 0.5rem 0;
    background: #e2e3e5;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: #eee;
    align-self: flex-start;
}

.code-block {
    background: #272822;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    font-family: monospace;
    white-space: pre-wrap;
    margin-top: 0.5rem;
}

.export-btn {
    margin-top: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: #0070cd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.ai-message.error {
    background: #f8d7da;
    color: #721c24;
}

.chat-output {
    padding: 10px;
    background: #eee;
    border-top: 1px solid #ccc;
}

.ai-code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 10px;
    margin: 5px;
    border-radius: 6px;
    font-family: monospace;
    overflow-x: auto;
}

.snipper {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ccc;
    border-top-color: #0070cd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

.large-text {
    font-size: 1rem;
    width: 100%;
    resize: none; /* Evita que el usuario cambie el tamaño manualmente */
    overflow-y: auto; /* Muestra la barra de scroll si es necesario */
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#user-input:focus {
    height: auto; /* Permite que el tamaño se ajuste automáticamente */
    min-height: 100px; /* Altura mínima */
    max-height: 300px; /* Altura máxima */
}

.send-button {
    padding: 0.5rem 1rem;
    background-color: #0070cd;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap; /* Evita que el texto del botón se ajuste */
    flex-shrink: 0; /* Evita que el botón cambie de tamaño */
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive styles */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 80vh;
        padding: 0.5rem;
    }

    .chat-header {
        font-size: 1rem;
        padding: 8px;
    }

    .chat-form input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .chat-form button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .user-message, .ai-message {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .code-block {
        font-size: 0.8rem;
        padding: 0.8rem;
    }

    .export-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: 70vh;
        padding: 0.3rem;
    }

    .chat-header {
        font-size: 0.9rem;
        padding: 6px;
    }

    .chat-form input {
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    .chat-form button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    .user-message, .ai-message {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .code-block {
        font-size: 0.7rem;
        padding: 0.6rem;
    }

    .export-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}