:root {
    --primary-color: #FF0000;    /* Rojo principal */
    --secondary-color: #FF4500;  /* Rojo naranja */
    --accent-color: #FF6347;     /* Rojo coral */
    --background-color: #FEFEFE; /* Blanco */
    --text-color: #FFFFFF;       /* Texto principal */
    --status-connected: #90EE90; /* Color de conexión */
    --status-disconnected: #FFB6C1; /* Color de desconexión */
    --shadow-color: rgba(255, 0, 0, 0.2); /* Sombra con el color principal */
    --hover-color: #FF4500;      /* Rojo naranja para hover */
    --light-accent: rgba(255, 255, 255, 0.2); /* Fondo claro para elementos */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(to bottom, hsl(11, 100%, 50%), #FF0000);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    color: white;
}

.logo-container {
    text-align: center;
    margin-bottom: 0rem;
    padding: 1rem;
}

.logo {
    max-width: 300px;
    height: auto;
    margin: 0 auto;
}

.assistant-header {
    text-align: center;
    margin-bottom: 2rem;
}

.avatar-container {
    margin-bottom: 1.5rem;
}

.avatar {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-color);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    color: var(--text-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.status-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.status, .speaking-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    background-color: var(--light-accent);
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.status-icon, .speaking-icon {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--status-disconnected);
}

.status.connected .status-icon {
    background-color: var(--status-connected);
    animation: pulse 2s infinite;
}

.speaking-status.speaking .speaking-icon {
    background-color: var(--secondary-color);
    animation: pulse 1s infinite;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-button {
    background-color: var(--light-accent);
    color: var(--text-color);
    border: 2px solid white;
}

.primary-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.secondary-button {
    background-color: var(--accent-color);   
    color: white;
}

.secondary-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background-color: var(--light-accent);
    border-radius: 15px;
    transition: transform 0.3s ease;
    border: 2px solid white;
    color: var(--text-color);
}

.feature:hover {
    transform: translateY(-3px);
    background-color: rgba(255, 255, 255, 0.3);
}

.feature-icon {
    font-size: 1.5rem;
}

.welcome-message {
    background-color: var(--light-accent);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
    border: 2px solid white;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .container {
        margin: 1rem;
        padding: 1rem;
    }

    .status-container {
        flex-direction: column;
        gap: 1rem;
    }

    .controls {
        flex-direction: column;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

.chat-container {
    background-color: white;
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem 0;
    height: 150px;
    overflow-y: auto;
    border: 1px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    margin: 10px 0;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
    transition: all 0.3s ease;
}

.message.assistant .message-content {
    background-color: #f0f0f0;
    color: #333;
    border-top-left-radius: 4px;
    position: relative;
}

.message.assistant .message-content::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 0 0;
    border-color: #f0f0f0 transparent transparent transparent;
}

.message.user .message-content {
    background-color: #007bff;
    color: white;
    border-top-right-radius: 4px;
    position: relative;
}

.message.user .message-content::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 0 8px;
    border-color: #007bff transparent transparent transparent;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.message.assistant .message-content::before {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
    color: #666;
}

/* Estilos para el footer con logo */
.footer-logo {
    position: fixed;
    right: 20px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1000;
    background-color: white;
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.footer-logo img {
    max-width: 140px;
    height: auto;
}

.footer-logo .text {
    width: 100%;
    font-size: 12px;
    margin-bottom: 3px;
    color: #333;
    text-align: center;
    background-color: white;
    /* Justificación completa del texto */
    /* text-align-last: justify; */
    /* text-justify: inter-word; */
}