/* General */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    gap: 20px;
}

/* Contenedor del Avatar */
#avatar-container {
    flex: 1;
    /* AQUÍ PUEDES PONER CUALQUIER FONDO: Imagen, gradiente o color */
    /* background: url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?auto=format&fit=crop&w=1200') no-repeat center center; */
     background: url('https://www.dermatologia.gov.co/recursos_user/imagenes/CDFLA.jpeg') no-repeat center center; 
    /* background: url('https://campusvirtual.ut.edu.co/theme/boost_union/pix/hero-bg.jpg') no-repeat center center; */
    /*background: url('https://www.comfatolima.com.co/wp-content/uploads/2023/09/uan.png') no-repeat center center; */
    
    
    background-size: cover;
    
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
}

#mainPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

#outputCanvas {
    height: 100%;
    width: auto;
    /* Opcional: un ligero resplandor para integrar al personaje */
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que el video llene el contenedor 9:16 */
}

/* Interfaz del Chat */
#chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #252525;
    border-radius: 15px;
    border: 1px solid #333;
}

#chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Burbujas de Mensaje */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.4;
    font-size: 0.95rem;
}

.user {
    align-self: flex-end;
    background-color: #0078d4;
    color: white;
    border-bottom-right-radius: 2px;
}

.bot {
    align-self: flex-start;
    background-color: #3d3d3d;
    color: #e0e0e0;
    border-bottom-left-radius: 2px;
}

/* Área de Input */
.input-area {
    padding: 20px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #333;
}

input[type="text"] {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: #1a1a1a;
    color: white;
    outline: none;
}

input[type="text"]:focus {
    border-color: #0078d4;
}

button {
    padding: 10px 20px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background-color: #005a9e;
}

/* Scrollbar personalizada */
#chat-window::-webkit-scrollbar {
    width: 6px;
}
#chat-window::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

/* Ajustes para Móviles (Pantallas Verticales) */
@media (max-width: 768px) {
    body {
        padding: 5px;
        align-items: flex-start;
        overflow: hidden; /* Evita el scroll global del cuerpo */
    }

    .container {
        flex-direction: column;
        height: 100dvh; /* Usa Dynamic Viewport Height para móviles */
        width: 100%;
        gap: 5px;
    }

    #avatar-container {
        height: 30%; /* Reducimos el tamaño del avatar en móvil */
        width: 100%;
        flex: none;
    }

    #chat-interface {
        height: 70%; /* El chat toma la prioridad de espacio */
        width: 100%;
        flex: none;
        display: flex;
        flex-direction: column;
    }

    #chat-window {
        flex: 1; /* Empuja el input hacia abajo pero dentro del área visible */
        padding: 10px;
        font-size: 0.85rem;
    }

    .input-area {
        padding: 10px;
        background-color: #252525;
        position: sticky; /* Asegura que se mantenga al final del contenedor */
        bottom: 0;
    }

    input[type="text"] {
        padding: 8px; /* Inputs más compactos para móvil */
    }

    button {
        padding: 8px 15px;
    }
}


/* Pantalla de Inicio (Splash Screen) */
#splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.98); /* Fondo casi opaco */
    /*display : flex; */
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 9999; 
    transition: opacity 0.5s ease;
}

.splash-content {
    text-align: center;
    padding: 40px;
    background-color: #252525;
    border: 1px solid #333;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 400px;
}

.splash-content h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #0078d4;
}

.splash-content p {
    margin-bottom: 25px;
    color: #b0b0b0;
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

#start-btn:hover {
    transform: scale(1.05);
}

/* Clase para ocultar la pantalla */
.hidden {
    opacity: 0;
    pointer-events: none;
}