/* ===== AGENT CHAT FULLSCREEN - ESTILO CHATGPT/CLAUDE ===== */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.agent-chat-fullscreen-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
}

/* ===== SIDEBAR LIMPA (SEM ROXA) ===== */
.chat-sidebar {
    width: 260px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10;
    color: #1f2937;
    border-right: 1px solid #e5e7eb;
}

.chat-sidebar.collapsed {
    transform: translateX(-260px);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.btn-new-chat {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-new-chat:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.btn-new-chat .icon {
    font-size: 18px;
}

.sidebar-section {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 12px;
    letter-spacing: 1px;
    padding: 0 4px;
}

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

.agent-item,
.conversation-item {
    padding: 10px 12px;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    color: #1f2937;
}

.agent-item:hover,
.conversation-item:hover {
    background: #e5e7eb;
}

.agent-item.active,
.conversation-item.active {
    background: #dbeafe;
    border-color: #3b82f6;
}

.agent-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.agent-item-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.agent-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-item-specialization {
    font-size: 11px;
    color: #6b7280;
    margin-left: 30px;
    text-transform: capitalize;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item-preview {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item-date {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -30px;
    width: 30px;
    height: 30px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 5;
    color: #1f2937;
}

.sidebar-toggle:hover {
    background: #e5e7eb;
}

.sidebar-toggle .icon {
    font-size: 16px;
    transition: transform 0.3s;
}

.chat-sidebar.collapsed .sidebar-toggle .icon {
    transform: rotate(180deg);
}

/* ===== ÁREA PRINCIPAL ESTILO CHATGPT ===== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

/* Header - Estilo minimalista */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    min-height: 60px;
}

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

.agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
}

.agent-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.agent-specialization {
    font-size: 12px;
    color: #6e6e6e;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #1a1a1a;
}

.btn-icon:hover {
    background: #f4f4f4;
}

.btn-icon span {
    font-size: 18px;
}

/* Área de Mensagens - Estilo ChatGPT */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
    background: #ffffff;
}

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

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Welcome Screen - REMOVIDO (não mais necessário) */

/* Mensagens - Estilo ChatGPT */
.message {
    display: flex;
    gap: 12px;
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.2s ease;
}

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

.message.user {
    background: #f7f7f8;
}

.message.agent {
    background: transparent;
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 600;
}

.message.user .message-avatar {
    background: #5b4fc9;
    color: #ffffff;
}

.message.agent .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-author {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.message-time {
    font-size: 12px;
    color: #6e6e6e;
}

.message-text {
    font-size: 14px;
    line-height: 1.6;
    color: #1a1a1a;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-text {
    color: #1a1a1a;
}

.message.agent .message-text {
    color: #1a1a1a;
}

/* Loading Animation */
.message.loading .message-text {
    padding: 12px 0;
}

.typing-indicator {
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-10px); opacity: 1; }
}

/* Input de Mensagem - Estilo ChatGPT */
.chat-input-container {
    padding: 16px 24px 24px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    background: #f4f4f4;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 20px 24px;
    transition: all 0.2s;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    background: #ffffff;
    border-color: #9ca3af;
    box-shadow: 0 0 0 1px #9ca3af;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 80px !important;
    max-height: 400px;
    line-height: 1.6;
    color: #1a1a1a;
    background: transparent;
    padding: 8px 0;
}

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

.btn-send {
    width: 48px;
    height: 48px;
    border: none;
    background: #1a1a1a;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 20px;
}

.btn-send:hover:not(:disabled) {
    background: #2d2d2d;
    transform: scale(1.05);
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-send .icon {
    font-size: 16px;
}

.input-footer {
    display: none;
}

.char-count,
.hint {
    display: none;
}

/* Estados de Loading - Estilo minimalista */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: #6e6e6e;
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top-color: #5b4fc9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estados Vazios */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #6e6e6e;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Responsividade - Estilo ChatGPT */
@media (max-width: 1024px) {
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .chat-sidebar {
        width: 260px;
    }
    
    .message {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .chat-sidebar:not(.collapsed) {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    .chat-main {
        width: 100%;
    }

    .message {
        padding: 16px;
        max-width: 100%;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-input-container {
        padding: 12px 16px 16px;
    }
    
    .welcome-screen {
        padding: 24px 16px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
