/* CNSC Chat Widget Styles for Forum */
.cnsc-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    display: block !important; /* Asegurar que siempre sea visible */
}

.cnsc-chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    color: white;
}

.cnsc-chat-toggle:hover {
    transform: scale(1.05);
}

.cnsc-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: none;
}

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

.cnsc-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cnsc-chat-header .subtitle {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
}

.cnsc-chat-status {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 5px;
}

.cnsc-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
}

.cnsc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
}

.cnsc-chat-message {
    display: flex;
    margin-bottom: 15px;
}

.cnsc-chat-message.user {
    flex-direction: row-reverse;
}

.cnsc-chat-avatar {
    width: 36px;
    height: 36px;
    margin-right: 10px;
    flex-shrink: 0;
}

.cnsc-chat-message.user .cnsc-chat-avatar {
    margin-right: 0;
    margin-left: 10px;
}

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

.cnsc-chat-bubble {
    background: white;
    padding: 12px 15px;
    border-radius: 18px;
    max-width: 70%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cnsc-chat-message.assistant .cnsc-chat-bubble {
    border-top-left-radius: 5px;
    background: white;
}

.cnsc-chat-message.user .cnsc-chat-bubble {
    border-top-right-radius: 5px;
    background: #667eea;
    color: white;
}

.cnsc-chat-content {
    font-size: 14px;
    line-height: 1.5;
}

.cnsc-chat-content p {
    margin: 0 0 10px 0;
}

.cnsc-chat-content p:last-child {
    margin-bottom: 0;
}

.cnsc-chat-content ul {
    margin: 5px 0;
    padding-left: 20px;
}

.cnsc-chat-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 5px;
    text-align: right;
}

.cnsc-chat-message.user .cnsc-chat-time {
    color: rgba(255, 255, 255, 0.8);
}

.cnsc-chat-input-area {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.cnsc-chat-remaining {
    margin-bottom: 10px;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
}

.cnsc-chat-input-container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 24px;
    padding: 8px 15px;
    border: 1px solid #e5e7eb;
}

.cnsc-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    max-height: 100px;
    min-height: 20px;
}

.cnsc-chat-send {
    background: #667eea;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.cnsc-chat-send:hover {
    background: #5a6fd8;
}

.cnsc-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Loading animation */
.cnsc-chat-loading {
    display: flex;
    padding: 10px 0;
}

.cnsc-chat-loading span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background: #667eea;
    border-radius: 50%;
    animation: cnsc-bounce 1.4s infinite ease-in-out both;
}

.cnsc-chat-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.cnsc-chat-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes cnsc-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Estilos responsivos para dispositivos móviles */
@media (max-width: 576px) {
    .cnsc-chat-container {
        width: calc(100% - 40px);
        height: 70vh;
    }
}
