/* Estilos modernos para el chatbot */
#chat-popup {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    /* background-color: #954880; */
    /* box-shadow: 0 4px 15px rgba(149, 72, 128, 0.4); */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#chat-popup:hover { 
    transform: scale(1.1) rotate(5deg); 
    box-shadow: 0 6px 20px rgba(149, 72, 128, 0.5);
}

#chat-popup i { 
    color: white; 
    font-size: 28px; 
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

#chat-box {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 370px;
    height: 520px;
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    z-index: 100000;
    overflow: hidden;
    border: 1px solid rgba(149, 72, 128, 0.15);
}

#chat-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, #954880 0%, #b55f9e 100%);
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(149, 72, 128, 0.2);
}

#chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255,255,255,0.2);
}

#chat-close { 
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-close:hover {
    background-color: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

#chat-content {
    height: 410px;
    overflow-y: auto;
    padding: 18px;
    position: relative;
    background-color: #f9f5fa;
    scrollbar-width: thin;
    scrollbar-color: #c7afc1 #f9f5fa;
}

#chat-content::-webkit-scrollbar {
    width: 6px;
}

#chat-content::-webkit-scrollbar-track {
    background: #f9f5fa;
}

#chat-content::-webkit-scrollbar-thumb {
    background-color: #c7afc1;
    border-radius: 10px;
}

#chat-input {
    padding: 15px 20px;
    border: none;
    border-top: 1px solid rgba(149, 72, 128, 0.1);
    outline: none;
    width: 100%;
    font-size: 15px;
    background-color: white;
    transition: all 0.3s;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

#chat-input:focus {
    box-shadow: 0 -4px 12px rgba(149, 72, 128, 0.06);
}

#chat-input::placeholder {
    color: #000000;
}

/* Mensajes */
.user-message, .bot-message {
    padding: 12px 16px;
    margin: 10px 0;
    max-width: 85%;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.user-message {
    background: linear-gradient(135deg, #b673a9 0%, #954880 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    text-align: right;
    margin-left: auto;
    padding-right: 16px;
}

.user-message strong {
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    font-size: 0.85em;
    display: block;
    margin-bottom: 3px;
}

.bot-message {
    background-color: white;
    border-radius: 18px 18px 18px 4px;
    border-left: 3px solid #954880;
    color: #333;
}

.bot-message strong {
    color: #954880;
    font-weight: 600;
    font-size: 0.85em;
    display: block;
    margin-bottom: 3px;
}

/* Botones */
.chat-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chat-button {
    border: none;
    color: white;
    background: linear-gradient(135deg, #954880 0%, #b673a9 100%);
    padding: 9px 14px;
    text-align: center;
    display: inline-block;
    font-size: 14px;
    margin: 0;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(149, 72, 128, 0.3);
}

.chat-button:hover {
    background: linear-gradient(135deg, #aa599a 0%, #c87eb9 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 72, 128, 0.4);
}

.chat-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(149, 72, 128, 0.3);
}

@keyframes typing {
    0%, 100% { transform: translateY(0px); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 0.8; }
}

/* Multimedia */
.chat-media {
    max-width: 100%;
    border-radius: 12px;
    margin: 8px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.chat-media:hover {
    transform: scale(1.02);
}

.chat-video {
    width: 100%;
    border-radius: 12px;
    margin: 8px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.chat-file {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background-color: #fcfafd;
    border: 1px solid #eee;
    border-left: 3px solid #954880;
    border-radius: 8px;
    margin: 8px 0;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.chat-file:hover {
    background-color: #f8f4f9;
    border-color: #954880;
    box-shadow: 0 3px 8px rgba(149, 72, 128, 0.1);
    transform: translateY(-1px);
}

.chat-file i {
    margin-right: 8px;
    color: #954880;
    font-size: 16px;
}

@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.user-message {
    animation: fadeInRight 0.5s ease forwards;
}

.bot-message {
    animation: fadeInLeft 0.5s ease forwards;
}

/* Estilos adicionales para mejorar la experiencia */
.bot-message a {
    color: #954880;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.bot-message a:hover {
    color: #b673a9;
    text-decoration: underline;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    padding: 8px 15px;
    background-color: white;
    border-radius: 18px;
    width: fit-content;
    margin-top: 8px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: #c4a9bd;
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
}

.typing-indicator span:nth-child(1) {
    animation: typing 1s infinite 0.3s;
}

.typing-indicator span:nth-child(2) {
    animation: typing 1s infinite 0.5s;
}

.typing-indicator span:nth-child(3) {
    animation: typing 1s infinite 0.7s;
}

/* Ajustes responsivos */
@media (max-width: 480px) {
    #chat-box {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
    }
    
    #chat-content {
        height: calc(100% - 120px);
    }
}