/**
 * Ruvinix Chatbot - Generalista (Floating)
 * v0.8.0 - Design Profissional
 */

/* ===== VARIÁVEIS DE DESIGN ===== */
:root {
    /* Cores Primárias */
    --rc-primary-900: #0A2540;
    --rc-primary-800: #0D3A5F;
    --rc-primary-700: #1E4976;
    --rc-primary-600: #2F5A8D;
    --rc-primary-500: #4A7BA7;
    
    /* Neutros */
    --rc-neutral-900: #1A1A1A;
    --rc-neutral-800: #2D2D2D;
    --rc-neutral-700: #4A4A4A;
    --rc-neutral-600: #6B6B6B;
    --rc-neutral-500: #9CA3AF;
    --rc-neutral-400: #D1D5DB;
    --rc-neutral-300: #E5E7EB;
    --rc-neutral-200: #F3F4F6;
    --rc-neutral-100: #F9FAFB;
    --rc-neutral-50: #FFFFFF;
    
    /* Tipografia */
    --rc-text-base: 15px;
    --rc-text-sm: 14px;
    --rc-text-xs: 13px;
    --rc-text-2xs: 12px;
    
    --rc-font-normal: 400;
    --rc-font-medium: 500;
    --rc-font-semibold: 600;
    
    --rc-leading-normal: 1.5;
    --rc-leading-relaxed: 1.75;
    
    /* Espaçamento */
    --rc-space-3: 12px;
    --rc-space-4: 16px;
    --rc-space-5: 20px;
    --rc-space-6: 24px;
    
    /* Sombras */
    --rc-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --rc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --rc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --rc-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Bordas */
    --rc-radius-md: 10px;
    --rc-radius-lg: 14px;
    --rc-radius-xl: 18px;
    --rc-radius-full: 9999px;
    
    /* Transições */
    --rc-duration-fast: 150ms;
    --rc-duration-normal: 250ms;
    --rc-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --rc-ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== CONTAINER PRINCIPAL ===== */
#rc-generalista {
    position: fixed;
    bottom: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

#rc-generalista.rc-position-left {
    left: 24px;
}

#rc-generalista.rc-position-right {
    right: 24px;
}

/* ===== BUBBLE (BOTÃO FLUTUANTE) ===== */
.rc-bubble {
    width: 64px;
    height: 64px;
    border-radius: var(--rc-radius-full);
    background: transparent;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--rc-shadow-xl);
    transition: all var(--rc-duration-normal) var(--rc-ease-out);
    border: none;
    padding: 0;
}

.rc-bubble:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.rc-bubble:active {
    transform: translateY(0) scale(0.98);
}

.rc-bubble img {
    width: 64px;
    height: 64px;
    border-radius: var(--rc-radius-full);
    display: block;
}

.rc-bubble svg {
    width: 28px;
    height: 28px;
}

/* ===== CHATBOX ===== */
.rc-chatbox {
    position: fixed;
    bottom: 24px;
    width: 360px;
    height: 550px;
    max-height: calc(100vh - 48px);
    background: var(--rc-neutral-50);
    border-radius: var(--rc-radius-xl);
    box-shadow: var(--rc-shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--rc-neutral-300);
}

.rc-position-left .rc-chatbox {
    left: 24px;
}

.rc-position-right .rc-chatbox {
    right: 24px;
}

/* ===== HEADER ===== */
.rc-header {
    background: linear-gradient(135deg, var(--rc-primary, var(--rc-primary-900)) 0%, var(--rc-primary, var(--rc-primary-800)) 100%);
    color: white;
    padding: var(--rc-space-5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rc-header-info {
    display: flex;
    align-items: center;
    gap: var(--rc-space-3);
}

.rc-avatar-small {
    width: 44px;
    height: 44px;
    border-radius: var(--rc-radius-full);
    /* border removida - avatar tem fundo transparente */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rc-header-name {
    font-weight: var(--rc-font-semibold);
    font-size: var(--rc-text-base);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.rc-header-status {
    font-size: var(--rc-text-xs);
    opacity: 0.85;
    font-weight: var(--rc-font-normal);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rc-header-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.rc-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--rc-radius-md);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--rc-duration-fast) var(--rc-ease-out);
    backdrop-filter: blur(10px);
}

.rc-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.rc-close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* ===== MESSAGES CONTAINER ===== */
#rc-gen-messages {
    flex: 1;
    background: var(--rc-neutral-100);
    min-height: 0;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    #rc-generalista {
        bottom: 16px;
    }
    
    #rc-generalista.rc-position-left {
        left: 16px;
    }
    
    #rc-generalista.rc-position-right {
        right: 16px;
    }
    
    .rc-chatbox {
        width: calc(100vw - 32px);
        height: auto;
        max-height: calc(100vh - 80px);
        bottom: 16px;
        left: 16px !important;
        right: 16px !important;
        margin: 0 auto;
        border-radius: var(--rc-radius-lg);
    }
    
    .rc-header {
        padding: var(--rc-space-4);
    }
    
    .rc-header-name {
        font-size: var(--rc-text-sm);
    }
    
    .rc-header-status {
        font-size: var(--rc-text-2xs);
    }
    
    .rc-avatar-small {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    #rc-generalista {
        bottom: 12px;
    }
    
    #rc-generalista.rc-position-left {
        left: 12px;
    }
    
    #rc-generalista.rc-position-right {
        right: 12px;
    }
    
    .rc-chatbox {
        width: 100vw !important;
        height: 400px !important; /* Altura reduzida para mostrar header com teclado */
        max-height: 60vh !important; /* No máximo 60% da tela */
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: var(--rc-radius-lg) var(--rc-radius-lg) 0 0 !important; /* Bordas arredondadas no topo */
        margin: 0 !important;
        border: none !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    .rc-bubble {
        width: 60px;
        height: 60px;
    }
    
    .rc-bubble img {
        width: 60px;
        height: 60px;
    }
    
    .rc-bubble svg {
        width: 26px;
        height: 26px;
    }
}
