/* Chat Interface Estilo ChatGPT - Moderno e Clean */

/* Prevenir pull-to-refresh em mobile (evitar perder conversa) */
body, html {
    overscroll-behavior-y: contain !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
}

.chat-layout {
    display: flex;
    height: calc(100vh - 55px);
    position: fixed;
    top: 55px;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    background: #000000;
    z-index: 1;
    overscroll-behavior-y: contain;
}

/* Sidebar - Moderno e Clean */
.chat-sidebar {
    width: 280px;
    background: rgba(20, 20, 20, 0.98) !important; /* Opacidade melhorada */
    background-opacity: 1 !important;
    color: #e4e4e7 !important;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000 !important; /* Acima de tudo - z-index muito alto */
    backdrop-filter: none !important; /* Remover blur que causa embaçamento */
    opacity: 1 !important;
    visibility: visible !important; /* Garantir visibilidade */
}

/* No mobile, sidebar começa fechado SEM animação inicial */
@media (max-width: 768px) {
    .chat-sidebar {
        transform: translateX(-100%);
        transition: none; /* Sem transição inicial para evitar delay visual */
    }
    
    .chat-sidebar.initialized {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Transição apenas após inicialização */
    }
}

.chat-sidebar.hidden {
    transform: translateX(-100%);
}

/* Garantir que o botão dentro do sidebar fechado fique visível */
.chat-sidebar.hidden .sidebar-header {
    pointer-events: none;
}

.chat-sidebar.hidden .btn-toggle-sidebar {
    pointer-events: auto;
}

/* Desktop: sidebar pode ser retraído */
@media (min-width: 769px) {
    .chat-sidebar {
        position: relative;
    }
    
    .chat-sidebar.hidden {
        transform: translateX(-100%);
        position: absolute;
        height: 100%;
    }
    
    /* Espaçamento adicional do título em desktop */
    .chat-dynamic-title {
        display: none !important; /* Oculto no desktop */
    }
    
    .chat-title-content {
        padding: 6px 0 !important; /* Espaçamento vertical adicional */
    }
    
    .chat-title-content #chatTitleText {
        padding-top: 2px; /* Pequeno espaçamento superior */
        padding-bottom: 2px; /* Pequeno espaçamento inferior */
    }
}

/* Mobile: sidebar sempre absoluto */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: -100%;
        top: 0; /* Começar do topo como menu sanduíche */
        height: 100vh; /* Altura completa */
        z-index: 10000 !important; /* Acima de tudo - z-index muito alto */
        width: 320px; /* Mesma largura do menu sanduíche */
        max-width: 85%;
        background: rgba(20, 20, 20, 0.98) !important; /* Opacidade melhorada */
        background-opacity: 1 !important;
        backdrop-filter: none !important; /* Remover blur que causa embaçamento */
        opacity: 1 !important;
        /* Iniciar sem transição para evitar animação no carregamento */
        transition: none !important;
    }
    
    /* Garantir que sidebar começa fechado no mobile (sem delay visual) */
    .chat-sidebar:not(.initialized) {
        left: -100% !important;
        transform: none !important;
        transition: none !important;
    }
    
    /* Garantir que todo conteúdo do sidebar seja visível */
    .chat-sidebar * {
        opacity: 1 !important;
        color: #e4e4e7 !important;
    }
    
    .chat-sidebar .sidebar-header,
    .chat-sidebar .sidebar-content {
        opacity: 1 !important;
        background: transparent !important;
    }
    
    .chat-sidebar .sidebar-title,
    .chat-sidebar .conversation-title,
    .chat-sidebar .conversation-item {
        opacity: 1 !important;
        color: #e4e4e7 !important;
    }
    
    /* Ocultar botão toggle do sidebar no mobile (setinha) - apenas no mobile */
    .chat-sidebar .btn-toggle-sidebar {
        display: none !important;
    }
    
    .chat-sidebar.hidden .btn-toggle-sidebar {
        display: none !important;
    }
    
    /* Overlay/backdrop quando sidebar está aberto no mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: none !important; /* Remover blur que fica estranho */
        z-index: 9999 !important; /* Abaixo do sidebar (10000) mas acima de tudo */
        opacity: 0;
        transition: opacity 0.3s ease;
        cursor: pointer;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Botão X de fechar no sidebar (mobile) */
    .btn-close-sidebar {
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: #ffffff;
        padding: 6px 10px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        width: 32px;
        height: 32px;
    }
    
    .btn-close-sidebar:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .btn-close-sidebar i {
        font-size: 18px;
    }
    
    @media (min-width: 769px) {
        /* Desktop: ocultar botão X, usar apenas setinha */
        .btn-close-sidebar {
            display: none !important;
        }
    }
    
    /* Aplicar transição apenas quando não estiver no estado inicial */
    .chat-sidebar.initialized {
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-sidebar:not(.hidden) {
        left: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .chat-sidebar.hidden {
        left: -100% !important;
        transform: none !important;
    }
    
    /* Quando sidebar está fechada, chat-main ocupa 100% */
    .chat-sidebar.hidden ~ .chat-main {
        width: 100%;
        margin-left: 0;
    }
    
    /* Quando sidebar está aberta, chat-main ajusta */
    .chat-sidebar:not(.hidden) ~ .chat-main {
        width: 100%;
        margin-left: 0;
    }
    
    /* Header do sidebar menor no mobile */
    .sidebar-header {
        padding: 24px 16px 16px 16px;
        margin-top: 12px;
        min-height: auto;
    }
    
    .sidebar-title {
        margin-top: 12px;
        font-size: 16px;
    }
    
    .btn-toggle-sidebar {
        margin-top: 12px;
        width: 32px;
        height: 32px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.sidebar-header {
    padding: 32px 20px 20px 20px; /* Padding aumentado no desktop para melhor espaçamento */
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Borda mais sutil */
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: transparent !important; /* Background transparente como menu sanduíche */
    min-height: auto;
}

/* Desktop: mais espaçamento no header do sidebar */
@media (min-width: 769px) {
    .sidebar-header {
        padding: 40px 24px 24px 24px !important; /* Padding ainda maior no desktop */
        margin-top: 0;
    }
    
    /* Desktop: mostrar botão toggle do sidebar (setinha) */
    .chat-sidebar .btn-toggle-sidebar {
        display: flex !important;
    }
    
    .chat-sidebar.hidden .btn-toggle-sidebar {
        display: flex !important;
    }
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 8px 0 0 0;
    letter-spacing: 0.5px;
    flex: 1;
}

/* Botão de nova conversa no sidebar agora é visível */

/* Botões do chat-header removidos */

.btn-toggle-sidebar {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #ececf1;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    margin-top: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
}

.btn-toggle-sidebar:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateX(-2px);
}

.btn-toggle-sidebar i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* Quando sidebar está fechado, botão fica visível na lateral */
.chat-sidebar.hidden .btn-toggle-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 75px !important; /* Mesma posição do btn-toggle-sidebar-top */
    transform: translateY(0) !important;
    background: rgba(102, 126, 234, 0.4) !important;
    border: 2px solid rgba(102, 126, 234, 0.6) !important;
    border-left: none !important;
    border-radius: 0 8px 8px 0 !important;
    color: rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(12px) !important;
    opacity: 1 !important;
    z-index: 101 !important; /* Acima do sidebar mas não acima de tudo */
    margin-top: 0 !important;
    display: flex !important;
    visibility: visible !important;
    width: 40px !important;
    height: 40px !important;
    box-shadow: 2px 0 12px rgba(102, 126, 234, 0.4) !important;
}

.chat-sidebar.hidden .btn-toggle-sidebar:hover {
    background: rgba(102, 126, 234, 0.6) !important;
    border-color: rgba(102, 126, 234, 0.8) !important;
    color: rgba(255, 255, 255, 1) !important;
    opacity: 1 !important;
    transform: translateY(0) translateX(2px) !important;
    box-shadow: 2px 0 16px rgba(102, 126, 234, 0.6) !important;
}

.chat-sidebar.hidden .btn-toggle-sidebar i {
    font-size: 20px !important;
    display: block !important;
    font-weight: 600 !important;
}

@media (max-width: 768px) {
    /* Ocultar botão do meio em mobile - usar apenas o botão do topo */
    .chat-sidebar.hidden .btn-toggle-sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

/* Botão fixo no topo esquerdo para abrir sidebar */
.btn-toggle-sidebar-top {
    position: fixed !important;
    top: 85px !important; /* Espaçamento do header (70px) + 15px extra para não grudar */
    left: 20px !important; /* Mais espaçamento da borda esquerda */
    background: rgba(102, 126, 234, 0.15) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    transform: translateY(0) !important;
    border-radius: 12px !important; /* Mais arredondado */
    color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    opacity: 0.9 !important;
    z-index: 101 !important; /* Acima do sidebar mas não acima de tudo */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important; /* Tamanho melhorado */
    height: 44px !important; /* Tamanho melhorado */
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    margin: 0 !important; /* Remover margens */
}

.btn-toggle-sidebar-top:hover {
    background: rgba(102, 126, 234, 0.25) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
    color: rgba(255, 255, 255, 1) !important;
    opacity: 1 !important;
    transform: translateX(2px) translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

/* Desktop: abaixar setinha 50px */
@media (min-width: 769px) {
    .btn-toggle-sidebar-top {
        top: 135px !important; /* 85px + 50px = 135px (com espaçamento do header) */
        left: 24px !important; /* Mais espaçamento em desktop para não ficar grudado */
    }
}


.btn-toggle-sidebar-top i {
    font-size: 22px !important; /* Mesmo tamanho do mobile */
    font-weight: 400 !important;
}

/* Ocultar botão quando sidebar está aberto */
.chat-sidebar:not(.hidden) ~ .chat-main .btn-toggle-sidebar-top {
    display: none !important;
}

@media (max-width: 768px) {
    /* Ocultar botão toggle do topo no mobile */
    .btn-toggle-sidebar-top {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    .chat-sidebar.hidden ~ .chat-main .btn-toggle-sidebar-top {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-top: 12px;
    background: transparent !important; /* Background transparente como menu sanduíche */
    opacity: 1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Borda mais sutil */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-new-chat-sidebar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05); /* Background similar ao menu sanduíche */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Borda similar ao menu sanduíche */
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
}

.btn-new-chat-sidebar:hover {
    background: rgba(255, 255, 255, 0.1); /* Hover similar ao menu sanduíche */
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-new-chat-sidebar:active {
    transform: translateY(0);
}

.btn-new-chat-sidebar i {
    font-size: 18px;
    color: #ececf1; /* Cor similar ao menu sanduíche */
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

/* Footer do Sidebar - Estilo ChatGPT */
/* Ocultar footer no histórico (chat-sidebar) - só aparece no menu sanduíche */
/* Footer visível apenas no desktop e no menu sanduíche */
.chat-sidebar .sidebar-footer {
    display: flex !important; /* Visível no sidebar desktop */
}

/* No mobile, ocultar footer do sidebar de histórico (já está no menu sanduíche) */
@media (max-width: 768px) {
    .chat-sidebar .sidebar-footer {
        display: none !important; /* Oculto no mobile - já está no menu sanduíche */
    }
}

.mobile-menu-panel .sidebar-footer {
    display: flex !important; /* Visível no menu sanduíche mobile */
}

.sidebar-footer {
    padding: 12px;
    /* border-top: 1px solid rgba(255, 255, 255, 0.15); */
    /* background: #1e1f2e; */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* gap: 12px; */
}

.sidebar-credits-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
}

/* Ocultar créditos do sidebar no desktop (movidos para header) */
@media (min-width: 769px) {
    .sidebar-credits-display {
        display: none !important; /* Oculto no desktop - está no header */
    }
}

.sidebar-credits-display i {
    color: #fbbf24; /* Amarelo dourado como na imagem */
    font-size: 20px;
}

.sidebar-credits-display span {
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
}

/* Botão Sair - removido do sidebar, apenas no dropdown */
.sidebar-logout-button {
    display: none; /* Oculto no sidebar, apenas no dropdown */
}

/* Botão Sair sempre visível no sidebar mobile (abaixo de Administração) */
.sidebar-logout-button-mobile {
    width: 100%;
    display: none; /* Oculto por padrão, visível apenas em mobile */
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    margin-top: 16px; /* Espaço duplo abaixo de Administração */
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-logout-button-mobile:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.sidebar-logout-button-mobile i {
    font-size: 18px;
}

.sidebar-logout-button-mobile span {
    font-weight: 600;
}

/* Mostrar botão Sair apenas em mobile */
@media (max-width: 768px) {
    .sidebar-logout-button-mobile {
        display: flex;
    }
}

.sidebar-logout-button i {
    font-size: 18px;
}

.sidebar-logout-button span {
    font-weight: 600;
}

.sidebar-user-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(32, 33, 35, 0.6); /* Fundo mais suave e transparente */
    border: 1px solid rgba(255, 255, 255, 0.08); /* Borda mais suave */
    border-radius: 12px; /* Bordas arredondadas */
    color: #ececf1;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Sombra suave */
}

.sidebar-user-button:hover {
    background: rgba(32, 33, 35, 0.8); /* Background mais opaco no hover */
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Sombra mais pronunciada no hover */
}

.sidebar-user-avatar {
    width: 40px; /* Tamanho maior como na imagem */
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px; /* Fonte maior */
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Gradiente roxo-azul */
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-user-name {
    font-size: 15px; /* Tamanho maior como na imagem */
    font-weight: 600;
    color: #ffffff; /* Branco como na imagem */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 13px; /* Tamanho maior */
    color: rgba(255, 255, 255, 0.6); /* Cinza claro como na imagem */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-arrow {
    font-size: 16px;
    color: #8e8ea0;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-user-button[aria-expanded="true"] .sidebar-user-arrow {
    transform: rotate(180deg);
}

.sidebar-user-dropdown {
    min-width: 280px;
    background: #202123;
    border: 1px solid #444654;
    border-radius: 12px;
    padding: 8px;
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.conversations-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conversation-item {
    padding: 8px 16px; /* Padding reduzido verticalmente (era 12px) */
    margin-bottom: 4px; /* Espaço menor entre itens (era gap: 10px) */
    border-radius: 12px; /* Bordas arredondadas como menu sanduíche */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: 4px;
    border: 1px solid transparent;
    background: transparent; /* Background transparente como menu sanduíche */
}

/* Mobile: padding e line-height menores para cards mais estreitos */
@media (max-width: 768px) {
    .conversation-item {
        padding: 10px 14px !important; /* Padding menor em mobile */
    }
    
    .conversation-title {
        line-height: 1.15 !important; /* Line-height ainda menor em mobile */
        font-size: 13px !important; /* Fonte ligeiramente menor */
    }
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05); /* Hover similar ao menu sanduíche */
    border-color: transparent;
    transform: translateX(2px); /* Movimento mais sutil */
}

.conversation-item.active {
    background: rgba(255, 255, 255, 0.1); /* Background ativo similar ao menu sanduíche */
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: none; /* Sem sombra como menu sanduíche */
}

.conversation-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversation-title {
    flex: 1;
    font-size: 14px;
    color: #e4e4e7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400; /* Fonte mais fina (era 500) */
    line-height: 1.2; /* Line-height menor para ficar mais junto */
}

.conversation-item.active .conversation-title {
    color: #ffffff;
    font-weight: 600;
}

.conversation-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
}

.btn-conversation-action {
    background: transparent;
    border: none;
    color: #8e8ea0;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10; /* Acima do item para não fechar sidebar */
    position: relative;
}

.btn-conversation-action:hover {
    background: rgba(255, 255, 255, 0.1); /* Hover similar ao menu sanduíche */
    color: #ffffff;
}


.btn-open-sidebar {
    position: fixed;
    left: 16px;
    top: 80px;
    z-index: 1002;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    font-size: 20px;
}

.btn-open-sidebar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-open-sidebar:not(.hidden) {
    display: flex;
}

.btn-open-sidebar.hidden {
    display: none;
}

/* Desktop: botão de abrir sidebar */
@media (min-width: 769px) {
    .btn-open-sidebar {
        top: 80px;
        left: 20px;
    }
}

/* Garantir que o botão não cubra conteúdo */
.btn-open-sidebar {
    z-index: 1002;
}

/* Área principal do chat */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1a1b26 0%, #2d2e3f 100%);
    position: relative;
    overflow: hidden;
}

/* Título dinâmico do chat */
.chat-dynamic-title {
    display: none !important; /* Oculto no desktop */
    padding: 18px 24px;
    margin-top: 90px !important;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(15px);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideDownTitle 0.3s ease-out;
    align-items: center;
    min-height: 56px; /* Altura mínima para centralização */
}

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

.chat-title-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    padding: 4px 0; /* Espaçamento vertical adicional */
    text-align: center;
}

.chat-title-logo {
    height: 32px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(6px); /* Abaixado mais */
    z-index: 1;
    top: 50%;
    margin-top: -16px; /* Metade da altura para centralizar verticalmente */
}

.chat-title-content #chatTitleText {
    color: #ffffff;
    font-size: 17px;
    font-weight: 400; /* Fonte mais fina em desktop */
    letter-spacing: -0.2px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 50px; /* Espaço para o botão de limpar */
    padding-left: 50px; /* Espaço simétrico para centralização */
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    margin: 0 auto;
}

.btn-clear-chat {
    background: transparent !important; /* Sem background */
    border: none !important; /* Sem borda */
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    position: absolute;
    right: 24px; /* Alinhar com a setinha do sidebar */
    top: 50%;
    transform: translateY(-50%);
    margin-left: auto;
    opacity: 0.7;
    z-index: 10;
}

.btn-clear-chat:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
}

.btn-clear-chat:active {
    transform: translateY(-50%) scale(0.95);
}

.btn-clear-chat i {
    font-size: 18px;
    font-weight: 300; /* Fonte mais fina */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Chat header removido - controles movidos para navbar */

.user-credits-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #6b7280;
    font-size: 13px;
}

.user-credits-menu i {
    color: #ffd700;
    font-size: 14px;
}

/* Estilos do user-avatar-chat removidos (estava no chat-header) */

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.user-avatar-menu {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.user-name-menu {
    font-weight: 600;
    color: #ffffff;
    font-size: 15px;
}

.user-email-menu {
    color: #6b7280;
    font-size: 13px;
}

.credits-nav-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 14px;
}

.credits-nav-display i {
    color: #ffd700;
}


/* Estilos do chat-header removidos */

.chat-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px 250px 24px;
    display: flex;
    flex-direction: column;
    background: #000000;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
    overscroll-behavior-y: contain; /* Prevenir pull-to-refresh e atualizações indesejadas */
    /* Scroll só aparece se houver conteúdo para baixo - controlado via JavaScript */
    /* Iniciar no topo, não rolar para baixo automaticamente */
    scroll-padding-top: 0;
}

/* Quando não há conteúdo suficiente, esconder scrollbar e manter no topo */
.chat-body.no-scroll {
    overflow-y: hidden !important;
    overflow: hidden !important;
}

/* Garantir que o chat-body comece no topo */
.chat-body:not(.has-messages) {
    justify-content: flex-start;
    align-items: center;
}

/* Evitar scroll desnecessário no início - aplicado via JavaScript */

/* Scrollbar customizada */
.chat-body::-webkit-scrollbar,
.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.chat-body::-webkit-scrollbar-track,
.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.chat-body::-webkit-scrollbar-thumb,
.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chat-body::-webkit-scrollbar-thumb:hover,
.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.welcome-message {
    text-align: center;
    padding: 40px 20px 30px 20px;
    color: #8e8ea0;
    margin-top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Estilo para a marca OLY - Fonte serif metálica dourada-bronze */
.oly-brand {
    font-family: 'Times New Roman', 'Georgia', 'Garamond', serif;
    font-weight: 700;
    font-size: 1.2em;
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 25%, #daa520 50%, #cd853f 75%, #b8860b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(212, 175, 55, 0.3);
    position: relative;
    letter-spacing: 2px;
    margin-right: 12px;
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.4));
}

/* Efeito de brilho metálico para OLY */
.oly-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.welcome-robot-icon {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

@media (min-width: 769px) {
    .welcome-message {
        padding: 50px 20px 40px 20px;
        margin-top: 0;
    }
    
    .welcome-message h2 {
        font-size: 32px;
    }
    
    .oly-brand {
        font-size: 1.25em;
    }
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto 50px;
    padding: 0 20px;
}

@media (min-width: 1024px) {
    .quick-actions {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .chat-body {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    
    .welcome-message {
        padding: 40px 20px 30px 20px;
        margin-top: 5vh;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .welcome-message h2 {
        font-size: 24px;
        flex-direction: column;
        gap: 4px;
    }
    
    .oly-brand {
        font-size: 1.15em;
        margin-right: 0;
        margin-bottom: 4px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr !important; /* 1 coluna no mobile */
        gap: 11px;
        padding: 0 20px;
        margin: 0 auto 30px;
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        justify-items: center;
        box-sizing: border-box;
    }
    
    .action-card {
        padding: 24px 16px;
        min-height: 140px;
        border-radius: 18px;
        width: 100%;
        max-width: 100%;
    }
    
    .action-card .icon {
        font-size: 38px;
        margin-bottom: 12px;
    }
    
    .action-card .label {
        font-size: 15px;
    }
}

.action-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid transparent; /* Borda será aplicada via JavaScript com cor do card */
    border-radius: 20px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    transition: left 0.6s ease;
}

.action-card:hover::before {
    left: 100%;
}

.action-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-card:hover::after {
    opacity: 1;
}

/* Hover desktop - manter borda neon (será aplicada via JavaScript) */
.action-card:not(.device-mobile):hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-8px) scale(1.03);
    /* box-shadow será aplicado via JavaScript com cor do card */
}

.action-card .icon {
    font-size: 56px !important; /* Aumentado de 48px para 56px */
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto; /* Removido tamanho fixo */
    height: auto; /* Removido tamanho fixo */
    min-height: auto; /* Removido tamanho fixo */
    background: transparent; /* Removido círculo de fundo */
    border-radius: 0; /* Removido círculo */
    margin-bottom: 20px;
    flex-shrink: 0;
}

/* Desktop: remover círculo do ícone */
.action-card:not(.device-mobile) .icon {
    background: transparent !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    min-height: auto !important;
}

/* Desktop: ícone na cor da moldura (será aplicada via JavaScript) */
.action-card:not(.device-mobile) .icon i {
    color: currentColor !important; /* Usará a cor da borda aplicada via JavaScript */
    font-size: inherit !important;
    line-height: 1 !important;
    font-weight: 300 !important; /* Mais fino */
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    stroke-width: 1 !important;
    opacity: 0.95 !important; /* Levemente mais suave */
}

/* Mobile: manter cor branca original */
.action-card.device-mobile .icon i {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: inherit !important;
    line-height: 1 !important;
    font-weight: 300 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    stroke-width: 1 !important;
    opacity: 0.95 !important;
}

/* Desktop: hover do ícone sem círculo */
.action-card:not(.device-mobile):hover .icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 8px 16px currentColor);
    background: transparent !important;
}

.action-card:not(.device-mobile):hover .icon i {
    color: currentColor !important; /* Manter cor da moldura no hover */
}

/* Mobile: manter comportamento original com círculo */
.action-card.device-mobile:hover .icon {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(102, 126, 234, 0.6));
    background: rgba(102, 126, 234, 0.2);
}

.action-card.device-mobile:hover .icon i {
    color: rgba(255, 255, 255, 1) !important;
}

.action-card .label {
    color: #ffffff;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.2px;
    line-height: 1.5;
    opacity: 0.95;
    margin-top: 8px;
}

@media (max-width: 768px) {
    /* Ajustar chat-main para ocupar toda altura */
    .chat-main {
        padding-top: 0;
        width: 100%;
        margin-left: 0;
    }
    
    .chat-body {
        padding-top: 16px;
        padding-left: 0;
        padding-right: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    /* Centralizar conteúdo descontando espaço do sidebar */
    .welcome-message {
        margin-left: 0;
        margin-right: 0;
        padding: 40px 20px 30px 20px;
        margin-top: 5vh;
        width: 100%;
        max-width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* Cards: 1 por linha no mobile */
    .quick-actions {
        grid-template-columns: 1fr !important;
        gap: 11px;
        padding: 0 20px;
        margin: 0 auto 30px;
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        justify-items: center;
        box-sizing: border-box;
    }
    
    .action-card {
        padding: 20px 14px;
        min-height: 130px;
        border-radius: 18px;
    }
    
    .action-card .icon {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .action-card .label {
        font-size: 13px;
        font-weight: 600;
    }
    
    .action-card:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    /* Forçar 1 coluna no mobile */
    .quick-actions {
        grid-template-columns: 1fr !important;
    }
    
    /* Botão de abrir sidebar no mobile */
    .btn-open-sidebar {
        top: 80px;
        left: 16px;
    }
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1000px; /* Aumentado de 800px para 1000px para combinar com input */
    margin: 0 auto;
    width: 100%;
    min-height: 100%;
    padding-top: 20px; /* Espaçamento superior para primeira mensagem */
    padding-bottom: 0; /* Removido padding, usando spacer div */
    margin-bottom: 0;
    position: relative;
    z-index: 1; /* Garantir que mensagens fiquem acima do background mas abaixo do input */
}

/* Div spacer para garantir que mensagens não sejam cortadas pelo input */
.message-spacer {
    height: 150px;
    min-height: 150px;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
    display: block;
}

.message {
    display: flex;
    gap: 16px;
    padding: 0;
    margin-bottom: 24px;
    margin-top: 8px; /* Espaçamento superior adicional */
    animation: fadeInUp 0.3s ease-out;
    position: relative;
    z-index: 2; /* Garantir que mensagens fiquem visíveis */
}

/* Primeira mensagem com mais espaçamento do topo */
.chat-messages > .message:first-child {
    margin-top: 32px; /* Espaçamento maior para primeira mensagem - desktop */
}

/* Primeira mensagem no mobile com espaçamento adequado */
@media (max-width: 768px) {
    .chat-messages > .message:first-child {
        margin-top: 24px; /* Espaçamento adequado no mobile */
    }
}

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

.message.user {
    justify-content: flex-end;
}

.message.bot {
    justify-content: flex-start;
    padding-left: 24px; /* Espaçamento à esquerda para não ficar exatamente alinhado com input */
}

/* Ajustar padding no mobile */
@media (max-width: 768px) {
    .message.bot {
        padding-left: 16px; /* Menor padding no mobile */
    }
}

.message-bubble {
    max-width: 85%; /* Aumentado de 75% para 85% para combinar melhor com input */
    padding: 16px 20px;
    border-radius: 18px;
    color: #e4e4e7;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 15px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-content {
    flex: 1;
}

.message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none; /* Removida borda */
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.message.bot .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom-left-radius: 4px;
    backdrop-filter: blur(10px);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.message-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.message.user .message-bubble:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.message-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 8px;
    align-self: flex-end;
}

.message.bot:hover .message-actions {
    opacity: 1;
}

.btn-message-action {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e4e4e7;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-message-action:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.copy-btn {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.copy-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-message-action:hover {
    background: #565869;
    color: #ececf1;
}

/* ============================================
   CHAT INPUT - RECRIADO DO ZERO
   ============================================ */

/* Área do input - Container principal */
.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 280px;
    right: 0;
    background: transparent;
    padding: 16px 24px;
    z-index: 10;
    transition: left 0.3s ease;
    box-sizing: border-box;
}

.chat-layout:has(.chat-sidebar.hidden) .chat-input-area {
    left: 0;
}

/* ============================================
   MOBILE - INPUT E MICROFONE
   ============================================ */
@media (max-width: 768px) {
    .chat-input-area {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 10px 16px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 9999 !important;
        background: transparent;
        box-sizing: border-box;
    }
    
    .chat-body {
        padding: 24px 16px 0 16px !important;
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
        margin-bottom: 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .keyboard-spacer-area {
        display: none !important;
    }
    
    .chat-input-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 50px !important;
        padding: 10px 56px 10px 8px !important;
        margin: 0 !important;
    }
    
    .chat-input-wrapper:focus-within,
    .chat-input-wrapper:hover,
    .chat-input-wrapper:active {
        padding: 10px 56px 10px 8px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .chat-input {
        padding: 8px 12px !important;
        font-size: 15px !important;
    }
    
    .mic-btn {
        width: 44px !important;
        height: 44px !important;
        right: 8px !important; /* Alinhado com a seta (mesmo right) */
        top: calc(50% - 64px) !important; /* Acima da seta: 50% (centro da seta) - 44px (altura da seta) - 20px (espaçamento maior) = 50% - 64px */
        transform: translateY(-50%) !important;
        position: absolute !important;
        font-size: 22px !important;
    }
    
    /* Botão de envio no mobile - NOVA CLASSE SEM CONFLITOS */
    .btn-send-message {
        width: 44px !important;
        height: 44px !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        font-size: 22px !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
    }
    
    .btn-send-message:hover,
    .btn-send-message:focus,
    .btn-send-message:active,
    .btn-send-message:focus-within {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(255, 255, 255, 0.15) !important; /* Cor mais clara no mesmo tom quando hover no mobile */
    }
    
    .btn-send-message.has-content {
        background: rgba(102, 126, 234, 0.15) !important; /* Background azul quando tem conteúdo */
    }
    
    .btn-send-message.has-content:hover {
        background: rgba(102, 126, 234, 0.25) !important; /* Cor mais clara no mesmo tom quando hover e tem conteúdo */
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
    }
    
    /* Garantir que botão não se move quando wrapper recebe foco no mobile (IGUAL DESKTOP) */
    .chat-input-wrapper:focus-within .btn-send-message,
    .chat-input-wrapper:hover .btn-send-message,
    .chat-input-wrapper:active .btn-send-message,
    .chat-input-wrapper:focus-within .input-actions .btn-send-message,
    .chat-input-wrapper:hover .input-actions .btn-send-message,
    .chat-input-wrapper:active .input-actions .btn-send-message,
    .chat-input:focus ~ .input-actions .btn-send-message,
    .chat-input:focus + .input-actions .btn-send-message {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
    }
    
    .input-actions {
        flex-direction: column !important;
        gap: 4px !important;
        /* GARANTIR QUE NÃO SE MOVE QUANDO WRAPPER RECEBE FOCUS - IGUAL MICROFONE */
        /* POSIÇÃO STATIC PARA QUE BOTÃO TENHA POSIÇÃO ABSOLUTA RELATIVA AO WRAPPER */
        position: static !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
        will-change: auto;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }
    
    /* GARANTIR QUE INPUT-ACTIONS NÃO SE MOVE QUANDO WRAPPER RECEBE FOCUS - IGUAL MICROFONE */
    .chat-input-wrapper:focus-within .input-actions,
    .chat-input-wrapper:hover .input-actions,
    .chat-input-wrapper:active .input-actions {
        position: static !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        height: auto !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
    }
}

/* ============================================
   WRAPPER DO INPUT - DESKTOP E MOBILE
   ============================================ */
.chat-input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(64, 65, 79, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 56px 10px 56px; /* Padding igual dos dois lados para microfone e seta */
    backdrop-filter: blur(10px);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    min-height: 48px;
    box-sizing: border-box;
    /* GARANTIR QUE WRAPPER NÃO MUDE E NÃO AFETE BOTÕES */
    transform: none !important;
    transition: none !important;
}

.chat-input-wrapper:focus-within,
.chat-input-wrapper:hover,
.chat-input-wrapper:active {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(64, 65, 79, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 10px 56px 10px 56px;
    margin: 0 auto;
    width: 100%;
    max-width: 768px;
    box-sizing: border-box;
    /* GARANTIR QUE WRAPPER NÃO MUDE DE TAMANHO E NÃO AFETE BOTÕES */
    position: relative !important;
    transform: none !important;
    transition: none !important;
}

/* ============================================
   INPUT DE TEXTO
   ============================================ */
.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ececf1;
    font-size: 15px;
    resize: none;
    max-height: 200px;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    padding: 8px 12px;
    margin: 0;
    min-height: 28px;
    box-sizing: border-box;
}

.chat-input:hover,
.chat-input:focus,
.chat-input:active,
.chat-input:focus-visible {
    outline: none;
}

.chat-input::placeholder {
    color: rgba(236, 236, 241, 0.5);
    font-weight: 400;
}

/* ============================================
   AÇÕES DO INPUT
   ============================================ */
.input-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    /* GARANTIR QUE NÃO SE MOVE - IGUAL MICROFONE */
    transform: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    /* GARANTIR QUE BOTÃO DENTRO TENHA POSIÇÃO ABSOLUTA RELATIVA AO WRAPPER */
    position: static !important;
}

/* GARANTIR QUE INPUT-ACTIONS NÃO SE MOVE QUANDO WRAPPER RECEBE FOCUS - IGUAL MICROFONE */
.chat-input-wrapper:focus-within .input-actions,
.chat-input-wrapper:hover .input-actions,
.chat-input-wrapper:active .input-actions {
    position: static !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

/* ============================================
   BOTÃO DE MICROFONE
   ============================================ */
.mic-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: rgba(236, 236, 241, 0.7);
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: absolute;
    z-index: 3;
    flex-shrink: 0;
}

@media (min-width: 769px) {
    .mic-btn {
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
    }
}

.mic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ececf1;
}

.mic-btn.recording {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.9);
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

.mic-btn.recording:hover {
    background: rgba(220, 38, 38, 1);
}

/* ============================================
   BOTÃO DE ENVIO - RECRIADO DO ZERO (SEM CONFLITOS)
   ============================================ */
.btn-send-message {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(236, 236, 241, 0.7);
    padding: 0;
    margin: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: absolute;
    z-index: 3;
    flex-shrink: 0;
    /* POSIÇÃO FIXA - NUNCA MOVE */
    transform: translateY(-50%);
    transition: none !important;
    animation: none !important;
    will-change: auto;
    left: auto !important;
    bottom: auto !important;
}

/* Desktop: posição dentro do input à direita */
@media (min-width: 769px) {
    .btn-send-message {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
    }
}

/* Mobile: posição dentro do wrapper (IGUAL MICROFONE - POSIÇÃO ABSOLUTA RELATIVA AO WRAPPER) */
@media (max-width: 768px) {
    .btn-send-message {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 22px !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(255, 255, 255, 0.05) !important;
        color: rgba(236, 236, 241, 0.7) !important;
    }
}

/* Estados hover/focus - SEM MOVER - MUDAR COR NO MESMO TOM */
.btn-send-message:hover,
.btn-send-message:focus,
.btn-send-message:active,
.btn-send-message:focus-within {
    background: rgba(255, 255, 255, 0.15);
    color: #ececf1;
    /* POSIÇÃO FIXA - NUNCA MOVE */
    transform: translateY(-50%) !important;
    transition: none !important;
    position: absolute !important;
}

/* Desktop: manter posição fixa */
@media (min-width: 769px) {
    .btn-send-message:hover,
    .btn-send-message:focus,
    .btn-send-message:active {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(255, 255, 255, 0.15) !important; /* Cor mais clara no mesmo tom quando hover no desktop */
    }
}

/* Mobile: manter posição fixa (IGUAL DESKTOP) */
@media (max-width: 768px) {
    .btn-send-message:hover,
    .btn-send-message:focus,
    .btn-send-message:active {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
        background: linear-gradient(to bottom, 
            #daa520 0%, 
            #cd853f 25%, 
            #b8860b 50%, 
            #cd853f 75%, 
            #b8860b 100%) !important;
        box-shadow: 
            0 3px 12px rgba(184, 134, 11, 0.6),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            inset 0 -1px 0 rgba(0, 0, 0, 0.4) !important;
    }
}

/* Estado quando tem conteúdo */
.btn-send-message.has-content {
    background: rgba(102, 126, 234, 0.15);
    color: rgba(102, 126, 234, 0.9);
    /* POSIÇÃO FIXA - NUNCA MOVE */
    transform: translateY(-50%) !important;
}

@media (min-width: 769px) {
    .btn-send-message.has-content {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(102, 126, 234, 0.15) !important;
        color: rgba(102, 126, 234, 0.9) !important;
    }
}

@media (max-width: 768px) {
    .btn-send-message.has-content {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(102, 126, 234, 0.15) !important; /* Background azul quando tem conteúdo no mobile */
    }
}

.btn-send-message.has-content:hover {
    background: rgba(102, 126, 234, 0.15);
    color: rgba(102, 126, 234, 1);
    /* POSIÇÃO FIXA - NUNCA MOVE */
    transform: translateY(-50%) !important;
}

@media (min-width: 769px) {
    .btn-send-message.has-content:hover {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(102, 126, 234, 0.25) !important; /* Cor mais clara no mesmo tom quando hover e tem conteúdo no desktop */
    }
}

@media (max-width: 768px) {
    .btn-send-message.has-content:hover {
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        position: absolute !important;
        transition: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 44px !important;
        height: 44px !important;
        left: auto !important;
        bottom: auto !important;
        background: rgba(102, 126, 234, 0.25) !important; /* Cor mais clara no mesmo tom quando hover e tem conteúdo no mobile */
    }
}

/* GARANTIR QUE NÃO SE MOVE QUANDO WRAPPER RECEBE FOCUS - IGUAL DESKTOP */
.chat-input-wrapper:focus-within .btn-send-message,
.chat-input-wrapper:hover .btn-send-message,
.chat-input-wrapper:active .btn-send-message,
.chat-input-wrapper:focus-within .input-actions .btn-send-message,
.chat-input-wrapper:hover .input-actions .btn-send-message,
.chat-input-wrapper:active .input-actions .btn-send-message {
    /* POSIÇÃO FIXA - NUNCA MOVE (IGUAL DESKTOP) */
    transform: translateY(-50%) !important;
    transition: none !important;
    animation: none !important;
    position: absolute !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    bottom: auto !important;
}

@media (min-width: 769px) {
    .chat-input-wrapper:focus-within .btn-send-message,
    .chat-input-wrapper:hover .btn-send-message,
    .chat-input-wrapper:active .btn-send-message,
    .chat-input-wrapper:focus-within .input-actions .btn-send-message,
    .chat-input-wrapper:hover .input-actions .btn-send-message,
    .chat-input-wrapper:active .input-actions .btn-send-message {
        right: 8px !important;
        top: 50% !important;
    }
}

@media (max-width: 768px) {
    .chat-input-wrapper:focus-within .btn-send-message,
    .chat-input-wrapper:hover .btn-send-message,
    .chat-input-wrapper:active .btn-send-message,
    .chat-input-wrapper:focus-within .input-actions .btn-send-message,
    .chat-input-wrapper:hover .input-actions .btn-send-message,
    .chat-input-wrapper:active .input-actions .btn-send-message {
        right: 8px !important;
        top: 50% !important;
        width: 44px !important;
        height: 44px !important;
    }
}

/* ============================================
   ANIMAÇÃO DE PULSO
   ============================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-conversations, .no-conversations {
    text-align: center;
    padding: 20px;
    color: #8e8ea0;
    font-size: 14px;
}

.no-conversations {
    font-style: italic;
}

/* Footer Moderno e Profissional */
.modern-footer {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 0 30px;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.modern-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.5), transparent);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-title {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.footer-heading {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 16px 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links li a:hover {
    color: #ffffff;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

.footer-legal {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: #ffffff;
}

.footer-legal .separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .modern-footer {
        padding: 40px 0 20px;
        margin-top: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* Responsive Chat */
@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: -100%;
        top: 55px;
        height: calc(100vh - 55px);
        z-index: 1001;
        width: 85%;
        max-width: 320px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-sidebar:not(.hidden) {
        left: 0;
    }
    
    .chat-sidebar.hidden {
        left: -100%;
    }
    
    .btn-open-sidebar {
        position: fixed;
        left: 16px;
        top: 80px;
        z-index: 1002;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
        color: white;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        transition: all 0.3s ease;
    }
    
    .btn-open-sidebar:not(.hidden) {
        display: flex;
    }
    
    .btn-open-sidebar.hidden {
        display: none;
    }
    
    .btn-open-sidebar:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    }
    
    .chat-main {
        width: 100%;
    }
    
    .chat-layout {
        height: calc(100vh - 55px);
        top: 55px;
    }
    
    .message-bubble {
        max-width: 90%; /* Aumentado para mobile também */
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-header-fixed {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 12px 16px;
    }
    
    .chat-body {
        padding: 24px 16px 0 16px; /* padding-top aumentado para 24px no mobile */
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; /* Espaço para input fixo */
        padding-top: calc(24px + 60px) !important; /* Espaço para header fixo */
        overscroll-behavior-y: contain !important; /* Prevenir pull-to-refresh */
    }
    
    /* Quando sidebar está aberto, garantir que header não seja tampado */
    .chat-sidebar:not(.hidden) ~ .chat-main .chat-header-fixed {
        z-index: 1001;
    }
    
    .chat-messages {
        padding-bottom: 0; /* Removido, usando spacer */
        margin-bottom: 0;
    }
    
    .message-spacer {
        height: 180px; /* Altura maior no mobile */
    }
    
    .chat-input-area {
        padding-top: 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        min-height: auto;
        background: transparent !important; /* Sem background no mobile, igual desktop */
        backdrop-filter: none !important;
        box-shadow: none !important;
        border-top: none !important; /* Removida linha sutil */
    }
    
    .chat-input-wrapper {
        background: rgba(64, 65, 79, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 10px 12px !important;
    }
    
    .chat-input {
        padding: 8px 12px !important;
    }
    
    /* Cards baseados em detecção de dispositivo */
    
    /* MOBILE - Layout: 2 colunas, último card ímpar estendido */
    .device-mobile .quick-actions {
        grid-template-columns: 1fr !important; /* 1 coluna - botões horizontais */
        gap: 11px !important; /* Gap de 11px entre cards */
        padding: 0 20px !important;
        margin-bottom: 30px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Remover qualquer lógica de múltiplas colunas no mobile */
    .device-mobile .quick-actions .action-card {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .device-mobile .quick-actions .action-card.full-width-card {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .device-mobile .action-card {
        padding: 2px 5px !important; /* Padding mínimo para altura reduzida */
        min-height: 60px !important; /* Altura menor */
        border-radius: 50px !important; /* Bordas totalmente arredondadas (50%) */
        display: flex !important;
        flex-direction: row !important; /* Layout horizontal */
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border: 2px solid transparent !important;
        position: relative !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }
    
    /* Cores neon configuráveis para os cards */
    .device-mobile .action-card[data-neon-color="pink"] {
        border-color: #ff6b9d !important;
        box-shadow: 0 0 20px rgba(255, 107, 157, 0.3), inset 0 0 20px rgba(255, 107, 157, 0.1) !important;
    }
    
    .device-mobile .action-card[data-neon-color="orange"] {
        border-color: #ff8c42 !important;
        box-shadow: 0 0 20px rgba(255, 140, 66, 0.3), inset 0 0 20px rgba(255, 140, 66, 0.1) !important;
    }
    
    .device-mobile .action-card[data-neon-color="cyan"] {
        border-color: #00d4ff !important;
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3), inset 0 0 20px rgba(0, 212, 255, 0.1) !important;
    }
    
    .device-mobile .action-card[data-neon-color="purple"] {
        border-color: #b794f6 !important;
        box-shadow: 0 0 20px rgba(183, 148, 246, 0.3), inset 0 0 20px rgba(183, 148, 246, 0.1) !important;
    }
    
    .device-mobile .action-card[data-neon-color="green"] {
        border-color: #48bb78 !important;
        box-shadow: 0 0 20px rgba(72, 187, 120, 0.3), inset 0 0 20px rgba(72, 187, 120, 0.1) !important;
    }
    
    .device-mobile .action-card[data-neon-color="blue"] {
        border-color: #4299e1 !important;
        box-shadow: 0 0 20px rgba(66, 153, 225, 0.3), inset 0 0 20px rgba(66, 153, 225, 0.1) !important;
    }
    
    .device-mobile .action-card:hover {
        transform: translateX(4px) !important;
        box-shadow: 0 0 30px currentColor, inset 0 0 30px currentColor !important;
    }
    
    /* Remover lógica de card estendido - todos ocupam 1 coluna */
    .device-mobile .quick-actions .action-card.full-width-card {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ícone no layout horizontal mobile - maior */
    .device-mobile .action-card .icon {
        font-size: 32px !important; /* Aumentado de 28px para 32px */
        margin-bottom: 0 !important;
        margin-right: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 56px !important; /* Aumentado de 48px para 56px */
        height: 56px !important; /* Aumentado de 48px para 56px */
        min-height: 56px !important;
        min-width: 56px !important;
        background: transparent !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
    }
    
    .device-mobile .action-card .icon i {
        font-size: 32px !important; /* Aumentado para corresponder ao container */
    }
    
    /* Ícones seguem a cor neon do botão OU cor do card se disponível */
    .device-mobile .action-card[data-card-color] .icon i {
        color: var(--card-color) !important;
    }
    
    .device-mobile .action-card[data-neon-color="pink"] .icon i {
        color: #ff6b9d !important;
    }
    
    .device-mobile .action-card[data-neon-color="orange"] .icon i {
        color: #ff8c42 !important;
    }
    
    .device-mobile .action-card[data-neon-color="cyan"] .icon i {
        color: #00d4ff !important;
    }
    
    .device-mobile .action-card[data-neon-color="purple"] .icon i {
        color: #b794f6 !important;
    }
    
    .device-mobile .action-card[data-neon-color="green"] .icon i {
        color: #48bb78 !important;
    }
    
    .device-mobile .action-card[data-neon-color="blue"] .icon i {
        color: #4299e1 !important;
    }
    
    /* Garantir que ícones sejam apenas lineares em mobile */
    .device-mobile .action-card .icon i {
        font-size: 28px !important;
        stroke-width: 1.5 !important;
    }
    
    /* Garantir que ícones dentro do círculo fiquem centralizados */
    .device-mobile .action-card .icon > * {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Esconder descrição em mobile */
    .device-mobile .action-card .bot-description {
        display: none !important;
    }
    
    /* Nome do bot (primeiro label) em mobile - layout horizontal */
    .device-mobile .action-card .label:first-of-type {
        font-size: 15px !important;
        font-weight: 500 !important;
        text-align: left !important;
        line-height: 1.2 !important; /* Reduzido de 1.4 para 1.2 - menos espaço */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        color: #ffffff !important;
        flex: 1 !important;
    }
    
    /* Remover card estendido no mobile - todos ocupam 1 coluna */
    .device-mobile .quick-actions .action-card.full-width-card {
        grid-column: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Forçar 1 coluna em todos os casos no mobile */
    @media (max-width: 768px) {
        .quick-actions {
            grid-template-columns: 1fr !important;
        }
        
        .quick-actions .action-card {
            grid-column: 1 !important;
            width: 100% !important;
            max-width: 100% !important;
        }
        
        .quick-actions .action-card.full-width-card {
            grid-column: 1 !important;
        }
    }
    
    /* TABLET - 2 por linha, com descrição */
    .device-tablet .quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
        padding: 0 20px;
        margin-bottom: 30px;
    }
    
    .device-tablet .action-card {
        padding: 24px 20px;
        min-height: 160px;
        border-radius: 18px;
    }
    
    .device-tablet .action-card .icon {
        font-size: 48px !important; /* Aumentado de 40px para 48px */
        width: 80px; /* Aumentado de 70px para 80px */
        height: 80px; /* Aumentado de 70px para 80px */
        min-height: 80px; /* Aumentado de 70px para 80px */
    }
    
    /* Garantir que ícones sejam apenas lineares em tablet */
    .device-tablet .action-card .icon i {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: inherit !important;
    }
    
    .device-tablet .action-card .label:first-of-type {
        font-size: 14px;
        margin-top: 8px;
    }
    
    .device-tablet .action-card .bot-description {
        font-size: 0.85rem;
        margin-top: 4px;
    }
    
    /* DESKTOP - 3 por linha, com descrição completa */
    .device-desktop .quick-actions {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 24px;
        padding: 0 20px;
        margin-bottom: 50px;
    }
    
    .device-desktop .action-card {
        padding: 32px 24px;
        min-height: 180px;
        border-radius: 50px !important; /* Border-radius igual ao mobile (50px) */
    }
    
    .device-desktop .action-card .icon {
        font-size: 56px !important; /* Aumentado de 48px para 56px */
        width: auto !important; /* Removido círculo */
        height: auto !important; /* Removido círculo */
        min-height: auto !important; /* Removido círculo */
        background: transparent !important; /* Removido círculo */
        border-radius: 0 !important; /* Removido círculo */
    }
    
    /* Desktop: ícone na cor da moldura */
    .device-desktop .action-card .icon i {
        color: currentColor !important; /* Usará cor da moldura aplicada via JavaScript */
        font-size: inherit !important;
    }
    
    .device-desktop .action-card .label:first-of-type {
        font-size: 1.1rem;
        margin-top: 8px;
    }
    
    .device-desktop .action-card .bot-description {
        font-size: 0.9rem;
        margin-top: 8px;
    }
}

/* ============================================
   MELHORIAS DE TIPOGRAFIA PARA MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Base: Melhorar legibilidade geral */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* Títulos principais */
    .welcome-message h2 {
        font-size: 26px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        letter-spacing: -0.3px !important;
        color: #ffffff !important;
    }
    
    /* Título dinâmico do chat */
    .chat-title-content #chatTitleText {
        font-size: 17px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        letter-spacing: -0.2px !important;
    }
    
    /* Mensagens do chat */
    .message-bubble {
        font-size: 15px !important;
        line-height: 1.6 !important;
        letter-spacing: 0.01em !important;
        font-weight: 400 !important;
        padding: 16px 18px !important;
    }
    
    .message.user .message-bubble {
        font-weight: 500 !important;
    }
    
    /* Cards de robôs */
    .device-mobile .action-card .label:first-of-type {
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        letter-spacing: -0.1px !important;
    }
    
    /* Sidebar */
    .sidebar-title {
        font-size: 18px !important;
        font-weight: 700 !important;
        letter-spacing: -0.2px !important;
    }
    
    .conversation-title {
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.2 !important; /* Reduzido de 1.4 para 1.2 - mais estreito */
        letter-spacing: 0.01em !important;
    }
    
    .conversation-item.active .conversation-title {
        font-weight: 600 !important;
    }
    
    /* Bordas totalmente arredondadas nos cards de conversação no mobile */
    .conversation-item {
        border-radius: 50px !important; /* Bordas totalmente arredondadas (50%) no mobile */
    }
    
    .sidebar-user-name {
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }
    
    .sidebar-user-email {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
    
    /* Botão Sair do sidebar */
    .sidebar-logout-button {
        font-size: 15px !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
    }
    
    .sidebar-logout-button span {
        font-weight: 600 !important;
    }
    
    /* Créditos */
    .sidebar-credits-display {
        font-size: 15px !important;
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
    }
    
    /* Input de chat */
    .chat-input-area input,
    .chat-input-area textarea {
        font-size: 16px !important; /* Evita zoom no iOS */
        line-height: 1.5 !important;
        letter-spacing: 0.01em !important;
    }
    
    /* Botões */
    .btn-new-chat-sidebar {
        font-size: 14px !important;
        font-weight: 600 !important;
        letter-spacing: 0.01em !important;
    }
    
    /* Navbar */
    .navbar-brand {
        display: flex !important;
        align-items: center !important;
    }
    
    .navbar-logo {
        height: 48px !important;
    }
    
    .navbar-brand-text {
        font-size: 2rem !important; /* Aumentado em mobile */
        letter-spacing: 1px !important;
        font-family: 'Times New Roman', 'Georgia', 'Garamond', serif !important;
        margin-bottom: 0px !important;
    }
    
    .navbar-nav .nav-link {
        font-size: 15px !important;
        font-weight: 500 !important;
        letter-spacing: 0.01em !important;
    }
    
    /* Dropdown menu */
    .dropdown-item {
        font-size: 14px !important;
        line-height: 1.5 !important;
        padding: 10px 16px !important;
    }
    
    /* Mobile menu */
    .mobile-menu-link-new {
        font-size: 16px !important;
        font-weight: 500 !important;
        letter-spacing: 0.01em !important;
    }
    
    .mobile-menu-link-logout {
        font-size: 16px !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em !important;
    }
    
    .mobile-user-credits-new {
        font-size: 17px !important;
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
    }
    
    /* Botão de limpar conversa */
    .btn-clear-chat {
        font-size: 13px !important;
        font-weight: 300 !important; /* Fonte mais fina */
        letter-spacing: 0.01em !important;
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin-left: auto !important;
        background: transparent !important;
        border: none !important;
        opacity: 0.7 !important;
        padding: 6px 6px !important;
    }
    
    .btn-clear-chat i {
        font-weight: 300 !important; /* Ícone mais fino */
        font-size: 17px !important;
    }
    
    .chat-title-content #chatTitleText {
        padding-right: 45px !important; /* Espaço para o botão em mobile */
        padding-left: 45px !important; /* Espaço simétrico para centralização */
        font-size: 16px !important;
        text-align: center !important;
    }
    
    .chat-title-content {
        justify-content: center !important;
        text-align: center !important;
    }
    
    .chat-dynamic-title {
        display: none !important; /* Oculto no mobile */
    }
    
    .chat-title-logo {
        transform: translateX(-50%) translateY(6px) !important; /* Abaixado mais em mobile */
        top: 50% !important;
        margin-top: -16px !important; /* Centralizar verticalmente */
    }
    
    .chat-title-content {
        padding-left: 0 !important; /* Remover padding extra do content */
    }
    
    /* Melhorias de contraste e legibilidade */
    .message-text,
    .message-content {
        color: inherit !important;
        -webkit-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
    }
    
    /* Espaçamento melhorado entre linhas em textos longos */
    .message-bubble p,
    .message-bubble li {
        line-height: 1.7 !important;
        margin-bottom: 8px !important;
    }
    
    .message-bubble ul,
    .message-bubble ol {
        padding-left: 20px !important;
        margin: 8px 0 !important;
    }
    
    /* Código e blocos de código */
    .message-bubble code {
        font-size: 13px !important;
        line-height: 1.5 !important;
        padding: 2px 6px !important;
    }
    
    .message-bubble pre {
        font-size: 13px !important;
        line-height: 1.6 !important;
        padding: 12px !important;
    }
}

