/**
 * ESTILOS DEL CHATBOT PROFESIONAL
 * Junior Party Rentals
 * 
 * Incluye:
 * - Botón flotante con animación
 * - Ventana de chat moderna
 * - Burbujas de mensajes
 * - Chips de sugerencias
 * - Indicador de escritura
 * - Responsive design
 */

/* ========================================
   BOTÓN FLOTANTE DEL CHAT
   ======================================== */
.chat-button {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    border: none;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(30, 64, 175, 0.5);
}

.chat-button i {
    color: white;
    font-size: 1.5rem;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   VENTANA DEL CHAT
   ======================================== */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 150px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ========================================
   HEADER DEL CHAT
   ======================================== */
.chat-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar i {
    font-size: 1.25rem;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

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

/* ========================================
   ÁREA DE MENSAJES
   ======================================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* ========================================
   BURBUJAS DE MENSAJES
   ======================================== */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.message-bot {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar i {
    color: white;
    font-size: 0.85rem;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-bot .message-content {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 18px 18px 18px 4px;
}

.message-user .message-content {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message-time {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.message-user .message-time {
    text-align: right;
}

/* ========================================
   INDICADOR DE ESCRITURA
   ======================================== */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ========================================
   CHIPS DE SUGERENCIAS
   ======================================== */
.chat-suggestions {
    padding: 0.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.suggestions-title,
.related-title {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 4px;
}

.suggestions-chips,
.related-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip,
.related-chip {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    color: #1e40af;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.suggestion-chip:hover,
.related-chip:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}

.chat-related-suggestions {
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: #f0f9ff;
    border-radius: 12px;
    animation: fadeIn 0.5s ease;
}

.related-chip {
    background: white;
    border-color: #3b82f6;
    font-size: 0.75rem;
    padding: 6px 12px;
}

/* ========================================
   INPUT DE MENSAJE
   ======================================== */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn i {
    font-size: 1rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .chat-button {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
    
    .chat-window.active + .chat-button {
        display: none;
    }
    
    .message {
        max-width: 90%;
    }
}

/* ========================================
   TEMA OSCURO (opcional)
   ======================================== */
@media (prefers-color-scheme: dark) {
    .chat-messages {
        background: #1f2937;
    }
    
    .message-bot .message-content {
        background: #374151;
        color: #f3f4f6;
        border-color: #4b5563;
    }
    
    .chat-input-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .chat-input {
        background: #374151;
        border-color: #4b5563;
        color: #f3f4f6;
    }
    
    .typing-indicator {
        background: #374151;
        border-color: #4b5563;
    }
}

