/* Definição de variáveis de cor para fácil manutenção */
:root {
    --white: #ffffff;
    --accent-600: #4863f7;
    --accent-500: #7878d7;
    --alert-600: #ff5c5c;
    --alert-800: rgba(255, 92, 92, 0.08);
    --gray-900: #0d0d0d;
    --gray-800: #111111;
    --gray-700: #1a1a1a;
    --gray-200: #424242;
    --gray-100: #737373;
}

/* Reset básico e configuração de box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilização da barra de rolagem */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background-color: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--gray-100);
}

/* Estilos de fonte padrão */
body,
input,
button {
    font-family: "Inter", sans-serif;
}

body {
    background-color: var(--gray-900);
    color: var(--white);
}

/* Layout principal com Flexbox */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 62px 124px;
    gap: 32px;
    overflow-y: scroll;
}

.main-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Estilos gerais para botões */
.btn {
    gap: 10px;
    height: 44px;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 0.5px solid var(--gray-200);
    color: var(--white);
    padding: 0 16px;
    transition: background-color 0.5s;
}

.btn-outline:hover {
    background-color: var(--gray-200);
}

.icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--accent-600);
    border: 1px solid var(--accent-500);
    min-width: 0;
    color: var(--white);
    padding: 0 24px;
    transition: opacity 0.5s;
}

.btn-primary:hover {
    opacity: 0.8;
}

.w-150 {
    width: 150px;
    justify-content: center;
}

/* Estilos para o título e conteúdo do prompt */
.prompt-title,
.prompt-content {
    outline: none;
    /* Remove a borda ao focar */
}

.prompt-title {
    font-weight: 600;
    font-size: 32px;
}

.prompt-content {
    font-size: 16px;
    line-height: 32px;
}

/* Estilo do placeholder para áreas editáveis */
.editable-wrapper {
    position: relative;
}

.editable-wrapper::before {
    content: attr(data-placeholder);
    /* Pega o texto do atributo 'data-placeholder' */
    position: absolute;
    color: var(--gray-200);
    pointer-events: none;
    /* Permite clicar através do placeholder */
    opacity: 0;
}

.editable-wrapper.is-empty::before {
    opacity: 1;
    /* Mostra o placeholder quando o campo está vazio */
}

#title-wrapper.is-empty {
    font-size: 32px;
    font-weight: 600;
}

#content-wrapper.is-empty {
    font-size: 16px;
    line-height: 32px;
}

/* Estilos para a Sidebar */
.sidebar {
    z-index: 1000;
    width: 400px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding: 32px;
    background-color: var(--gray-800);
    border-right: 0.5px solid var(--gray-700);
    transition: transform 0.3s ease, box-shadow 0.3s;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    opacity: 0;
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-container {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-700);
    gap: 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 22px;
    transform: translateY(-50%);
}

.search-input {
    background: transparent;
    height: 44px;
    border: 1px solid var(--gray-200);
    color: var(--white);
    font-size: 16px;
    border-radius: 6px;
    padding-left: 48px;
}

.search-input::placeholder {
    color: var(--gray-200);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.logo {
    height: 24px;
}

/* Estilos dos itens na lista de prompts */
.prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    margin-top: 20px;
}

.prompt-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.prompt-item-title,
.prompt-item-description {
    white-space: nowrap;
    /* Impede que o texto quebre a linha */
    overflow: hidden;
    /* Esconde o texto que transborda */
    text-overflow: ellipsis;
    /* Adiciona "..." ao final */
}

.prompt-item-title {
    font-size: 14px;
    font-weight: 500;
}

.prompt-item-description {
    font-size: 12px;
    color: var(--gray-100);
}

/* Media Query para responsividade em telas menores */
@media (max-width: 950px) {
    .open-toggle {
        display: block;
        top: 38px;
        position: fixed;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 360px;
        transform: translateX(-100%);
        /* Esconde a sidebar fora da tela */
        z-index: 1100;
    }

    .sidebar.open {
        transform: translateX(0);
        /* Mostra a sidebar */
    }

    .main {
        padding: 24px 32px;
    }
}