:root {
    --primary-color: #19459B;    /* Azul principal */
    --secondary-color: #FE4F05;  /* Naranja principal */
    --accent-color: #FB7B4F;     /* Naranja más claro */
    --background-color: #FE4F05; /* Beige claro */
    --text-color: #333333;       /* Texto principal */
    --status-connected: #19459B; /* Color de conexión */
    --status-disconnected: #FE4F05; /* Color de desconexión */
    --shadow-color: rgba(25, 69, 155, 0.2); /* Sombra con el color principal */
    --hover-color: #153B7A;      /* Azul más oscuro para hover */
    --light-accent: #FFE4D9;     /* Naranja muy claro para fondos */
}

* {
    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: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

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

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

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

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

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

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

h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.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);
}

.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(--primary-color);
    color: white;
}

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

.secondary-button {
    background-color: #FE4F05;
    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;
    margin-bottom: 5rem;
}

.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: 1px solid var(--accent-color);
}

.feature:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    background-color: white;
}

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

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

@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;
    }

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

    .logo-container {
        width: 100%;
        text-align: center;
    }

    .logo {
        max-width: 300px;
    }

    #authButton {
        align-self: flex-end;
        margin-right: 1rem;
    }

    .avatar {
        width: 210px;  /* 60% de 350px */
        height: 210px; /* 60% de 350px */
    }

    .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: 300px;
    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: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1000;
    background-color: white;
    padding: 5px;
    border-radius: 12px;
    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; */
}

/* Estilos para el modal de código de acceso */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}

.modal-content h2 {
    margin: 0 0 1.5rem 0;
    color: #333;
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group input[type="password"] {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.input-group input[type="password"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.2em;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.modal-buttons .button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#authButton {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-right: 1rem;
}