/* ============================================
   CONSISTUP MOSKIT CHAT - FRONTEND STYLES
   ============================================ */

:root {
    --chat-primary: #41A65E;
    --chat-primary-dark: #2d7342;
    --chat-secondary: #414192;
    --chat-secondary-dark: #333166;
    --chat-text: #1f2937;
    --chat-text-light: #6b7280;
    --chat-border: #e5e7eb;
}

/* ============================================
   CHAT WIDGET CONTAINER
   ============================================ */

#consistup-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   CHAT BUBBLE (BOTÃO FLUTUANTE)
   ============================================ */

.chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--chat-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(65, 166, 94, 0.4);
    transition: all 0.3s ease;
    padding: 0;
    color: white;
    font-size: 24px;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(65, 166, 94, 0.6);
}

.chat-toggle:active {
    transform: scale(0.95);
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #414192;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* ============================================
   CHAT CONTAINER
   ============================================ */

.chat-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 384px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    z-index: 9999;
}

.chat-container.minimized {
    height: 64px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   CHAT HEADER
   ============================================ */

.chat-header {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.chat-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.chat-avatar-inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-secondary) 0%, var(--chat-primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.chat-avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: var(--chat-primary);
    border: 2px solid white;
    border-radius: 50%;
}

.chat-header-info h3 {
    color: white;
    font-weight: bold;
    font-size: 18px;
    margin: 0;
}

.chat-header-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-status {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
}

.chat-header-buttons {
    display: flex;
    gap: 8px;
}

.chat-header-btn {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 16px;
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   CHAT MESSAGES
   ============================================ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    gap: 8px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message-bubble {
    max-width: 75%;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.user .chat-message-bubble {
    background: linear-gradient(135deg, var(--chat-secondary) 0%, var(--chat-secondary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .chat-message-bubble {
    background: white;
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
    border-bottom-left-radius: 4px;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 4px 0;
    word-wrap: break-word;
}

.chat-message-time {
    font-size: 11px;
    margin: 0;
}

.chat-message.user .chat-message-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-message.bot .chat-message-time {
    color: var(--chat-text-light);
}

/* ============================================
   QUICK REPLIES
   ============================================ */

.chat-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.chat-quick-label {
    font-size: 11px;
    color: var(--chat-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding-left: 4px;
}

.chat-quick-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background-color: white;
    border: 2px solid rgba(65, 166, 94, 0.2);
    border-radius: 12px;
    font-size: 14px;
    color: var(--chat-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-quick-btn:hover {
    border-color: var(--chat-primary);
    background-color: rgba(65, 166, 94, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   CHAT INPUT
   ============================================ */

.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--chat-border);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--chat-border);
    border-radius: 12px;
    font-size: 14px;
    color: var(--chat-text);
    font-family: inherit;
    transition: border-color 0.2s ease;
    outline: none;
}

#chat-input:focus {
    border-color: var(--chat-primary);
}

#chat-input::placeholder {
    color: var(--chat-text-light);
}

#chat-send {
    background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
    color: white;
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 16px;
}

#chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(65, 166, 94, 0.4);
}

#chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-hint {
    font-size: 11px;
    color: var(--chat-text-light);
    text-align: center;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 40px);
        max-height: calc(100vh - 100px);
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .chat-message-bubble {
        max-width: 85%;
    }
    
    #consistup-chat-widget {
        bottom: 20px;
        right: 20px;
    }
}