/* ==========================================================================
   Colo Chatbot v2.0 - Estilos potenciados
   ========================================================================== */

#colo-chat-widget {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    position: fixed;
    bottom: 24px;
    left: 100px;
    z-index: 9999;
}

/* Toggle button */
.colo-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4), 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 3px solid #fff;
}
.colo-toggle:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.5);
}
.colo-toggle:active {
    transform: scale(0.95);
}

.colo-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: colo-pulse 2s infinite;
}

@keyframes colo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.85; }
}

/* Chat window */
.colo-chat-window {
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: colo-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0,0,0,0.06);
}

@keyframes colo-pop-in {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.colo-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.colo-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.colo-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.colo-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.colo-status {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.2;
}
.colo-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.colo-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Messages */
.colo-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    scroll-behavior: smooth;
}
.colo-messages::-webkit-scrollbar { width: 5px; }
.colo-messages::-webkit-scrollbar-track { background: transparent; }
.colo-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.colo-msg {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
    animation: colo-msg-in 0.25s ease-out;
}

@keyframes colo-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.colo-bot {
    background: #fff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
}
.colo-bot a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(37,99,235,0.3);
}
.colo-bot a:hover {
    border-bottom-color: #2563eb;
}

.colo-user {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Botones de accion */
.colo-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.colo-btn-accion {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1.5px solid #bfdbfe;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.colo-btn-accion:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.colo-btn-accion:active {
    transform: translateY(0);
}

/* Boton especial de horario */
.colo-btn-accion[data-hora] {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-color: #bbf7d0;
    font-family: 'SF Mono', monospace;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 12px;
}
.colo-btn-accion[data-hora]:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    border-color: #22c55e;
}

/* Typing indicator */
.colo-typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    align-self: flex-start;
}
.colo-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: colo-bounce 1.4s infinite ease-in-out;
}
.colo-typing span:nth-child(1) { animation-delay: -0.32s; }
.colo-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes colo-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input */
.colo-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.colo-input-area input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}
.colo-input-area input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: #fff;
}
.colo-input-area button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.colo-input-area button:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.colo-input-area button:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 480px) {
    #colo-chat-widget {
        bottom: 24px;
        left: 80px;
    }
    .colo-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        border-radius: 16px;
    }
    .colo-toggle {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
}
