* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    display: flex;
}

/* Sidebar Lateral */
.sidebar {
    width: 260px;
    height: 100vh;
    background: #F9FAFB;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: #2563EB;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    flex: 1;
}

.sidebar-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #6B7280;
    font-size: 0.875rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sidebar-edit-btn:hover {
    opacity: 1;
}

.sidebar-new-chat {
    margin: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: #1F2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.sidebar-new-chat:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.sidebar-history {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.sidebar-history-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-history-item {
    padding: 0.75rem;
    margin: 0.25rem 0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    word-break: break-word;
}

.sidebar-history-item:hover {
    background: #F3F4F6;
}

.sidebar-history-item.active {
    background: #EFF6FF;
    color: #2563EB;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    background: #F9FAFB;
}

.sidebar-footer-item {
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
}

.sidebar-footer-item:hover {
    background: #F3F4F6;
}

/* Área de Chat */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    background: #F9FAFB;
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    stroke: #374151;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages.empty-state {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.empty-state-content {
    max-width: 600px;
    padding: 2rem;
}

.empty-state-logo {
    width: 64px;
    height: 64px;
    background: #2563EB;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.empty-state-greeting {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 2rem;
}

.suggestion-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.suggestion-card {
    padding: 1.25rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.suggestion-card:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.suggestion-card-title {
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.suggestion-card-description {
    font-size: 0.8125rem;
    color: #6B7280;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    max-width: 85%;
    animation: slideIn 0.3s ease;
    white-space: pre-line;
    word-wrap: break-word;
    line-height: 1.6;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background: #F3F4F6;
    color: #1F2937;
    margin-right: auto;
    align-self: flex-start;
}

.user-message {
    background: #2563EB;
    color: #ffffff;
    margin-left: auto;
    align-self: flex-end;
}

/* Input Fixo na Parte Inferior */
.chat-input-container {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #E5E7EB;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    z-index: 10;
}

.chat-input-wrapper {
    width: 100%;
    max-width: 768px;
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 1.5rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #2563EB;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.chat-input-icon {
    color: #6B7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.chat-input-icon:hover {
    color: #374151;
}

.chat-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    color: #1F2937;
    background: transparent;
    resize: none;
    max-height: 200px;
    min-height: 24px;
}

.chat-input-wrapper input::placeholder {
    color: #9CA3AF;
}

.chat-input-send {
    background: #2563EB;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.chat-input-send:hover {
    background: #1E40AF;
}

.chat-input-send:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
}

.chat-input-disclaimer {
    font-size: 0.75rem;
    color: #6B7280;
    text-align: center;
    max-width: 768px;
}

.prompt-bubbles {
    display: none;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height para mobile */
        max-height: 100vh;
        max-height: 100dvh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .suggestion-cards {
        grid-template-columns: 1fr;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-messages {
        padding: 1rem;
        padding-bottom: 120px;
    }
    
    .chat-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem;
        z-index: 100;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .empty-state-content {
        padding: 1rem;
        padding-bottom: 120px;
    }
    
    .sidebar-header {
        flex-shrink: 0;
    }
    
    .sidebar-new-chat {
        flex-shrink: 0;
    }
    
    .sidebar-history {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .sidebar-footer {
        flex-shrink: 0;
        background: #F9FAFB;
        border-top: 1px solid #E5E7EB;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        min-height: fit-content;
        position: relative;
        z-index: 10;
    }
    
    .sidebar-footer-item {
        flex-shrink: 0;
    }
}

/* Scrollbar personalizado */
.sidebar-history::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.sidebar-history::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-history::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.sidebar-history::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

