/* Avatar 3D Styles */
.avatar-container {
    position: relative;
    width: 100%;
    height: 400px;
    min-height: 665.109px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: transparent;
    border-radius: 20px;
    z-index: 999999999999 !important;
}

#avatar3d-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 999999999999 !important;
    border-radius: 20px;
    background: transparent;
    overflow: visible;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 99999999996 !important;
}

#avatar3d-container:hover {
    transform: scale(1.02);
}

.avatar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-interaction-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    animation: fadeInOut 3s infinite;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Overlay de generación */
.avatar-generating-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
    z-index: 15;
    border-radius: 20px;
}

.generating-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.generating-icon {
    font-size: 32px;
    margin-bottom: 15px;
    animation: sparkle 2s infinite ease-in-out;
}

.generating-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.generating-subtext {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 20px;
    font-style: italic;
}

.generating-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.8));
    border-radius: 2px;
    animation: loadingProgress 3s infinite ease-in-out;
    width: 0%;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.1) rotate(180deg); opacity: 0.8; }
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.avatar-generating-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Imagen de transición del avatar */
.avatar-preload-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1s ease-in-out;
    z-index: 5;
}

.avatar-preload-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    filter: brightness(1.1) contrast(1.05);
}

.avatar-preload-image.fade-out {
    opacity: 0;
    pointer-events: none;
}

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

/* Bocadillo de diálogo */
.avatar-speech-bubble {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999999999999 !important;
    max-width: 320px;
    min-width: 280px;
    text-align: center;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.avatar-speech-bubble.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
    z-index: 999999999999 !important;
}

.avatar-speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: #667eea;
}

.avatar-speech-bubble .bubble-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.avatar-speech-bubble .bubble-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.avatar-speech-bubble .bubble-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.avatar-speech-bubble .bubble-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    font-weight: 600;
}

.avatar-speech-bubble .bubble-btn.primary:hover {
    background: white;
    transform: scale(1.05);
}

.bubble-content {
    text-align: center;
}

.bubble-subtext {
    font-size: 13px;
    margin-bottom: 15px;
    opacity: 0.9;
}

/* Sistema de bocadillos conversacionales */
.chat-bubbles-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 500px !important;
    height: 600px !important;
    min-width: 300px !important;
    min-height: 400px !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    z-index: 999999999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: default;
    user-select: none;
    background: transparent;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
    pointer-events: none;
    resize: none;
    overflow: hidden;
}

.chat-bubbles-container.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: auto !important;
    display: block !important;
}

.chat-bubbles-container.dragging {
    transition: none;
    cursor: grabbing !important;
}

.chat-bubbles-container .drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px 20px 0 0;
    cursor: grab !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    margin-bottom: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    pointer-events: auto !important;
    position: relative;
}

.chat-bubbles-container .drag-handle::before {
    content: "Asistente Virtual";
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-bubbles-container .drag-handle::after {
    content: "⋮⋮";
    position: absolute;
    right: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.chat-bubbles-container .drag-handle:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-bubbles-container .drag-handle:active {
    cursor: grabbing;
    background: linear-gradient(135deg, #4e5bc6 0%, #5e3578 100%);
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.chat-bubbles-container .close-conversation-btn {
    position: absolute;
    top: 10px;
    right: 45px;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.chat-bubbles-container .close-conversation-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Indicador de escritura para el chat del avatar */
.typing-indicator-bubble {
    padding: 8px 15px;
    margin: 3px 0;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.typing-bubble {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 18px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 3px;
    max-width: 70px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Prevenir duplicación de navegación móvil */
.desktop-nav {
    display: none !important;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex !important;
    }
}

/* Estilos específicos para menú móvil */
.mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    margin-bottom: 15px;
}

.mobile-nav li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mobile-nav li a:hover {
    color: #667eea;
}

/* Indicadores de redimensionamiento */
.chat-bubbles-container::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(-45deg, transparent 30%, rgba(102, 126, 234, 0.3) 30%, rgba(102, 126, 234, 0.3) 70%, transparent 70%);
    cursor: nw-resize;
    pointer-events: auto;
    border-radius: 0 0 20px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-bubbles-container:hover::after {
    opacity: 1;
}

.chat-bubbles-container.resizing::after {
    opacity: 1;
    background: linear-gradient(-45deg, transparent 30%, rgba(102, 126, 234, 0.8) 30%, rgba(102, 126, 234, 0.8) 70%, transparent 70%);
    transform: scale(1.1);
    transition: all 0.1s ease;
}

.chat-bubbles {
    max-height: 450px;
    overflow-y: auto;
    margin: 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 20px 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.4) transparent;
}

.chat-bubbles::-webkit-scrollbar {
    width: 6px;
}

.chat-bubbles::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-bubbles::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.4);
    border-radius: 3px;
}

.chat-bubbles::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.6);
}

.conversation-bubble {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    animation: fadeInUp 0.3s ease;
}

.conversation-bubble.user {
    justify-content: flex-end;
}

.conversation-bubble.assistant {
    justify-content: flex-start;
    margin-top: 5px;
}

.conversation-bubble .bubble-message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.conversation-bubble .bubble-message::-webkit-scrollbar {
    width: 4px;
}

.conversation-bubble .bubble-message::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-bubble .bubble-message::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

.conversation-bubble .bubble-message::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.conversation-bubble.user .bubble-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.conversation-bubble.assistant .bubble-message {
    background: white;
    color: #333;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-input-bubble {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    width: 100%;
    pointer-events: auto;
    box-sizing: border-box;
}

.chat-input-bubble input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #333;
}

.chat-input-bubble input::placeholder {
    color: #999;
}

.bubble-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.bubble-send-btn:hover {
    transform: scale(1.1);
}

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

/* Chat Overlay Styles */
#chatOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 999999999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#chatOverlay.active {
    opacity: 1;
    visibility: visible;
}

.chat-container {
    width: 95%;
    max-width: 900px;
    height: 85%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#chatOverlay.active .chat-container {
    transform: scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.avatar-section {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-section .avatar-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.avatar-section .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.welcome-message {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.welcome-message h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.welcome-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.5;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.avatar-section {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.avatar-section .avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.avatar-section .avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.welcome-message {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    text-align: center;
}

.welcome-message h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.welcome-message p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 0;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.assistant .message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 5px;
}

.message-bubble strong {
    font-weight: bold;
    color: inherit;
}

.message-bubble em {
    font-style: italic;
    color: inherit;
}

.typing-indicator {
    display: none;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    border: 1px solid #e9ecef;
    max-width: 70%;
}

.typing-indicator.show {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-input {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.chat-input input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.voice-toggle {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    color: #667eea;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.voice-toggle:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.voice-toggle.active {
    background: #667eea;
    color: white;
}

/* Avatar 3D en el chat */
#chatAvatar3d-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    overflow: visible;
    position: relative;
}

#chatAvatar3d-container canvas {
    border-radius: 50%;
    width: 100% !important;
    height: 100% !important;
}

#chatAvatar3d-container .avatar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 12px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

#chatAvatar3d-container .avatar-preload-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1s ease-in-out;
    z-index: 5;
}

#chatAvatar3d-container .avatar-preload-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: brightness(1.1) contrast(1.05);
}

#chatAvatar3d-container .avatar-preload-image.fade-out {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .chat-container {
        width: 95%;
        height: 90%;
    }
    
    .chat-header h2 {
        font-size: 20px;
    }
    
    .avatar-section .avatar-container {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
    
    /* Ajustes para bocadillos en móvil */
    .chat-bubbles-container {
        width: 350px;
        max-height: 300px;
    }
    
    .conversation-bubble .bubble-message {
        max-width: 85%;
        font-size: 12px;
    }
}
