#chat-screen::-webkit-scrollbar {
    width: 0 !important;
    background: transparent !important;
}
#chat-screen {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Calibri', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #1a1a1a;
    color: #f6f7f8;
    min-height: 100vh;
    font-size: 16px;
}

#app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    margin: 0 auto;
    background: url('TBK Completo.png') no-repeat center center fixed;
    background-size: cover;
    position: relative;
}

#chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
    overflow-y: auto;
    position: relative;
}

#chat-screen.initial-state {
    justify-content: center;
    align-items: center;
    padding: 24px;
}

#chat-screen.chat-active {
    justify-content: flex-start;
    padding: 24px;
}

#chat-box {
    display: flex;
    flex-direction: column;
    overflow-y: visible;
    padding: 20px 0;
    gap: 24px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.3s;
}

#chat-screen.chat-active #chat-box {
    opacity: 1;
    padding-bottom: 240px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 18px !important;
    word-wrap: break-word;
    text-align: left;
}

.chat-bubble-user {
    background: #303134;
    color: #e8eaed;
    align-self: flex-end;
    margin-left: auto;
    position: relative;
}

.chat-bubble-ai {
    background: transparent;
    color: #e8eaed !important;
    align-self: flex-start;
    position: relative;
    box-shadow: transparent;
}

.chat-bubble-ai strong,
.chat-bubble-ai b {
    font-weight: 600;
}

.chat-bubble-ai h3 {
    font-size: 20px !important;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 12px;
}

.chat-bubble-ai h3:first-child {
    margin-top: 0;
}

.chat-bubble-ai h4 {
    font-size: 20px !important;
    font-weight: 500;
    margin-top: 12px;
    margin-bottom: 8px;
}

.chat-bubble-ai p {
    font-size: 20px !important;
    line-height: 1.6;
    margin-bottom: 8px;
}

.chat-bubble-ai .destaque-azul {
    color: #4a9eff !important;
    font-weight: 600;
}

.chat-bubble-ai .destaque-laranja {
    color: #ffb347 !important;
    font-weight: 600;
}

.chat-bubble-ai *,
.chat-bubble-ai p,
.chat-bubble-ai span,
.chat-bubble-ai div,
.chat-bubble-ai h1,
.chat-bubble-ai h2,
.chat-bubble-ai h3,
.chat-bubble-ai h4,
.chat-bubble-ai h5,
.chat-bubble-ai h6,
.chat-bubble-ai li,
.chat-bubble-ai td,
.chat-bubble-ai th,
.chat-bubble-ai strong,
.chat-bubble-ai b,
.chat-bubble-ai em,
.chat-bubble-ai i {
    font-size: 20px !important;
}

.message-actions {
    position: absolute;
    bottom: -28px;
    left: 8px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.action-btn {
    background: transparent;
    border: none;
    color: #747577;
    cursor: pointer;
    padding: 6px;
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 28px;
    height: 28px;
}

.action-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.action-btn.copied {
    color: #17db1e !important;
    opacity: 1 !important;
}

.action-btn.liked {
    color: #0ef116 !important;
    opacity: 1 !important;
}

.action-btn.disliked {
    color: #f70101 !important;
    opacity: 1 !important;
}

.action-btn:active {
    transform: scale(0.9);
}

/* Fontes Consultadas */
.message-sources {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sources-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: background 0.2s ease;
}

.sources-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sources-header span {
    font-size: 14px;
    color: #9aa0a6;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.sources-toggle {
    background: transparent;
    border: none;
    color: #9aa0a6;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    transition: transform 0.2s ease;
}

.sources-content {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.sources-section {
    margin-bottom: 16px;
}

.sources-section:last-child {
    margin-bottom: 0;
}

.sources-section h4 {
    font-size: 14px;
    color: #e8eaed;
    margin-bottom: 8px;
    font-weight: 600;
}

.source-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid #4285f4;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.source-item strong {
    color: #e8eaed;
    display: block;
    margin-bottom: 4px;
}

.source-link {
    color: #8ab4f8;
    text-decoration: none;
    font-size: 13px;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.source-link:hover {
    color: #adc6ff;
    text-decoration: underline;
}

.ticket-meta {
    display: block;
    color: #9aa0a6;
    font-size: 12px;
    margin-top: 4px;
}

.chat-bubble-ai table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.chat-bubble-ai th,
.chat-bubble-ai td {
    border: 1px solid #4b5563;
    padding: 6px 10px;
    text-align: left;
}

.chat-bubble-ai th {
    background-color: #4b5563;
}

.chat-bubble-ai ul,
.chat-bubble-ai ol {
    margin-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.chat-bubble-ai li {
    margin-bottom: 4px;
}

#chat-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%px;
    max-width: 900px;
    margin: 0 auto;
    transition: all 0.3s ease;
    background: #1a1a1a;
    padding: 20px;
}

#chat-screen.initial-state #chat-form {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    transition: top 0.3s ease, transform 0.3s ease;
}

#chat-screen.chat-active #chat-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(0);
    z-index: 100;
}

.greeting-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #f3f4f7 -0%, #63656d 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: left;
    width: auto;
    max-width: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: absolute;
    top: 300px;
    left: 350px;
    right: auto;
    margin-top: 0;
}

#chat-screen.chat-active .greeting-text {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    position: absolute;
}

/* Upload de Imagem */
.image-preview {
    position: relative;
    max-width: 120px;
    margin: 0 0 8px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    align-self: flex-start;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-image-btn:hover {
    background: rgba(244, 67, 54, 0.9);
    transform: scale(1.1);
}

.input-box {
    width: 100%;
    background: #212222;
    border: transparent;
    border-radius: 28px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 1px 6px rgba(253, 252, 252, 0.40);
}

.input-box:hover {
    border-color: #e8eaed;
}

.input-box input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e8eaed;
    font-size: 20px;
    font-family: 'Calibri', 'Inter', sans-serif;
    width: 100%;
    padding: 0;
    line-height: 1.5;
}

.input-box input::placeholder {
    color: #e8eaed;
    font-size: 20px;
}

.send-btn {
    background: transparent;
    border: none;
    color: #d7d7da;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover {
    background: rgba(236, 233, 228, 0.1);
    color: #d7d7da;
}

.send-btn:disabled {
    color: #3d3d3d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Modo STOP */
.send-btn.stop-mode {
    background-color: #313030ff;
    color: #e71010;
}

.send-btn.stop-mode:hover {
    background-color: #424242;
    color: #ffffff;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    transform: rotate(45deg);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    margin-top: 4px;
}

.attach-btn,
.mic-btn {
    background: transparent;
    border: none;
    color: #d7d7da;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attach-btn:hover,
.mic-btn:hover {
    background: rgba(199, 197, 195, 0.1);
    color: #d7d7da;
}

.attach-btn svg,
.mic-btn svg {
    width: 20px;
    height: 20px;
}

.chat-bubble-loading {
    align-self: flex-start;
}

.chat-bubble-loading span {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chat-bubble-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-bubble-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

#chat-screen::-webkit-scrollbar {
    width: 8px;
}

#chat-screen::-webkit-scrollbar-track {
    background: #9ca3af;
}

#chat-screen::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

#chat-screen::-webkit-scrollbar-thumb:hover {
    background: #ffa726;
}

/* Animação do Microfone Gravando */
.mic-btn.recording {
    color: #ff4444 !important;
    background: rgba(255, 68, 68, 0.1);
    animation: pulse-red 1.5s infinite;
}

.mic-btn.recording:hover {
    background: rgba(255, 68, 68, 0.2);
    transform: scale(1.1);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Dropdown de Exportação */
.export-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.export-btn {
    background: transparent;
    border: none;
    color: #9aa0a6;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    width: 28px;
    height: 28px;
}

.export-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e8eaed;
    opacity: 1;
}

.export-btn svg {
    width: 16px;
    height: 16px;
}

.export-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2d2e30;
    border: 1px solid #4b5563;
    border-radius: 6px;
    padding: 4px;
    min-width: 110px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    margin-top: 4px;
}

.export-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.export-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 8px;
    background: transparent;
    border: none;
    color: #e8eaed;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap;
}

.export-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.export-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Drag & Drop */
#chat-form.drag-over {
    position: fixed;
}

#chat-form.drag-over::before {
    content: 'Solte a imagem aqui';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 1200;
    color: #a4a5a8;
    z-index: 9999;
    border: 3px dashed #808183;
    border-radius: 92px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.02);
    }
}

.tbk-logo {
    position: fixed;
    top: 550px;
    right: 90px;  /* Ajustado para não colidir com o botão de sair */
    width: 80px;  /* Ajuste o tamanho conforme necessário */
    height: auto; /* Mantenha como 'auto' para evitar distorção */
    z-index: 10;
}

.chat-image-preview {
    max-width: 150px; /* Tamanho máximo do preview */
    max-height: 150px;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: contain; /* Garante que a imagem se ajuste sem cortar */
    border: 1px solid rgba(255, 255, 255, 0.1);
}