/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #333333;
    background-color: #1a1a1a;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo-icon {
    width: 35px;
    height: 35px;
    border-radius: 4px;
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: #1a1a1a;
    border-radius: 2px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.logo i {
    color: #888888;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Botões */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #555555;
    color: #ffffff;
}

.btn-outline:hover {
    background-color: #333333;
}

.btn-primary {
    background-color: #ffffff;
    color: #1a1a1a;
}

.btn-primary:hover {
    background-color: #e5e5e5;
}

.btn-icon {
    background-color: transparent;
    color: #888888;
    padding: 8px;
    border-radius: 6px;
}

.btn-icon:hover {
    color: #ffffff;
    background-color: #333333;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;

    margin: 0; /* Remove margens padrão do body */
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center; /* Centraliza verticalmente */
}

/* Main content adjustments for chat mode */
body.chat-mode .main-content {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;

        margin: 0; /* Remove margens padrão do body */
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center;
}

.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    position: relative;
}

.container {
    width: 100%;
    max-width: 768px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.main-title {
    font-size: 32px;
    font-weight: 500;
    text-align: center;
    color: #e5e5e5;
    margin-bottom: 8px;
}

/* Input Box */
.input-box {
    background-color: #2d2d2d;
    border: 1px solid #444444;
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s ease;
}

.input-box:focus-within {
    border-color: #666666;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.action-buttons-left {
    display: flex;
    gap: 8px;
}

.action-btn {
    background-color: transparent;
    border: none;
    color: #cccccc;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #444444;
    color: #ffffff;
}

.action-btn i {
    font-size: 14px;
}

/* Feature Buttons */
.feature-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.feature-btn {
    background-color: transparent;
    border: 1px solid #444444;
    color: #cccccc;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.feature-btn:hover {
    background-color: #333333;
    color: #ffffff;
    border-color: #555555;
}

.feature-btn i {
    font-size: 14px;
}

/* Chat Screen Styles */
.chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 0 0 0;
    overflow-y: auto;
    align-items: center; /* Centraliza o conteúdo */
    justify-content: flex-start;
    min-width: 90%;
}

.chat-container {
    max-width: 768px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza o container */
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 20px 0;
    width: 100%;
    max-width: 768px; /* Limita a largura das mensagens */
    align-items: flex-start;
}

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    display: inline-block;
    width: auto;
    min-width: fit-content;
}

.message.user .message-content {
    background-color: #2d2d2d;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background-color: transparent;
    color: #e5e5e5;
    border: none;
    padding: 0;
    max-width: 90%;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.message-action-btn {
    background: transparent;
    border: none;
    color: #888888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.message-action-btn:hover {
    color: #ffffff;
    background-color: #333333;
}

/* Unified Input Container */
.unified-input-container {
    width: 95%;
    max-width: 768px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: relative;
    margin: 0 auto; /* Centraliza o container */
}

/* Estilos para o unified-input-container na tela de boas-vindas */
.welcome-screen .unified-input-container {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* Estilos para o unified-input-container no modo chat */
body.chat-mode .unified-input-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    background-color: #1a1a1a;
    border-top: 1px solid #333333;
    padding: 16px;
    z-index: 100;
    gap: 12px;
}

body.chat-mode .unified-input-container .input-box {
    /* Removido max-width e margin pois já está centralizado no container pai */
}

/* Ocultar feature-buttons no modo chat */
body.chat-mode #featureButtons {
    display: none;
}

/* Exibir chat-footer no modo chat */
body.chat-mode #chatFooter {
    display: block;
    max-width: 768px;
    margin: 0 auto;
}

/* Ajustes para o main-input */
.main-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 16px;
    padding: 8px 0;
    font-family: inherit;
    resize: none;
    overflow: hidden;
    min-height: 24px;
    max-height: 72px;
    line-height: 1.5;
    transition: height 0.2s ease;
}

.main-input::placeholder {
    color: #888888;
}

/* Chat Footer */
.chat-footer {
    display: none;
    text-align: center;
    margin-top: 12px;
}

.chat-footer p {
    font-size: 12px;
    color: #888888;
}

/* Body adjustments for chat mode */
body.chat-mode {
    padding-bottom: 200px;
}

body.chat-mode .footer {
    display: none;
}

/* Footer */
.footer {
    padding: 16px 24px;
    text-align: center;
    border-top: 1px solid #333333;
    background-color: #1a1a1a;
}

.footer p {
    font-size: 14px;
    color: #888888;
}

.footer-link {
    color: #cccccc;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #ffffff;
}

/* Estilos para imagens nas mensagens do assistente */
.message.assistant .message-content img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.message.assistant .message-content img:hover {
    transform: scale(1.05);
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.show {
    display: flex;
    opacity: 1;
}

.popup-container {
    position: absolute;
    background-color: #2d2d2d;
    border: 1px solid #444444;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 280px;
    z-index: 1001;
    transform: scale(0.8) translateY(-10px);
    transition: all 0.3s ease;
}

.popup-overlay.show .popup-container {
    transform: scale(1) translateY(0);
}

.popup-content {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

/* Seta do popup */
.popup-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.popup-arrow.top {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #2d2d2d;
}

.popup-arrow.bottom {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2d2d2d;
}

.popup-arrow.left {
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #2d2d2d;
}

.popup-arrow.right {
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #2d2d2d;
}

/* Animação de entrada do popup */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-container.animate-in {
    animation: popupFadeIn 0.3s ease forwards;
}

/* Responsividade */
@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .container {
        gap: 24px;
    }
    
    .action-buttons {
        flex-direction: row;
        gap: 12px;
        align-items: stretch;
    }
    
    .action-buttons-left {
        display: none;
        justify-content: center;
    }
    
    .feature-buttons {
        display: none;
        gap: 8px;
    }

    .feature-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .message.assistant .message-content img {
        max-width: 250px;
    }

    body.chat-mode .unified-input-container {
        padding: 12px;
    }

    body.chat-mode .unified-input-container .action-buttons {
        flex-direction: row;
        gap: 12px;
        align-items: stretch;
    }

    body.chat-mode .unified-input-container .action-buttons-left {
        justify-content: center;
    }

    body.chat-mode {
        padding-bottom: 220px;
    }

    .popup-container {
        max-width: 250px;
        padding: 14px 18px;
    }
    
    .popup-content {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 24px;
    }
    
    .input-box {
        padding: 12px;
    }
    
    .action-btn {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .feature-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        justify-content: center;
    }

    .message.assistant .message-content img {
        max-width: 200px;
    }

    body.chat-mode .unified-input-container .input-box {
        padding: 12px;
    }

    body.chat-mode {
        padding-bottom: 240px;
    }

    .popup-container {
        max-width: 220px;
        padding: 12px 16px;
    }
    
    .popup-content {
        font-size: 12px;
    }
}