/* Chat Widget Flotante */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

#chat-widget-button {
    background-color: #0d6efd;
    color: white;
    border-radius: 50px;
    padding: 0; /* Padding managed by flex and width */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    white-space: nowrap;
    width: 60px;
    height: 60px;
}

#chat-widget-button:hover {
    width: 410px;
    background-color: #0b5ed7;
}

#chat-widget-button i {
    font-size: 24px;
    min-width: 60px;
    text-align: center;
}

#chat-widget-text {
    opacity: 0;
    margin-left: 10px;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

#chat-widget-button:hover #chat-widget-text {
    opacity: 1;
}

/* Ventana de Chat */
#chat-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

#chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

#chat-header {
    background-color: #0d6efd;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-title-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

#chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

#chat-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-end, #chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-end {
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    padding: 4px 8px;
    transition: background 0.2s;
}

#chat-end:hover {
    background: rgba(255,255,255,0.2);
}

#chat-close {
    font-size: 20px;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f8f9fa;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.chat-msg.cliente {
    background-color: #0d6efd;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-msg.admin {
    background-color: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-msg-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
    display: block;
}

#chat-typing-indicator {
    font-size: 12px;
    color: #6c757d;
    padding: 0 15px 10px 15px;
    display: none;
    font-style: italic;
    background-color: #f8f9fa;
}

#chat-input-area {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    background: white;
}

#chat-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    font-size: 14px;
}

#chat-input:focus {
    border-color: #0d6efd;
}

#chat-send {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#chat-send:hover {
    background-color: #0b5ed7;
}

#chat-send:disabled, #chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.system-msg {
    align-self: center;
    font-size: 12px;
    color: #6c757d;
    margin: 10px 0;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 10px;
}
