/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilo global */
body {
    background-color: #181818;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90vh;
    font-family: 'Roboto', sans-serif;
    position: relative;
    padding: 20px;
}

/* Logo Centralizada */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 200px;
    height: auto;
    filter: brightness(90%);
}

/* Contêiner de busca */
.search-container {
    background: #2B2B2B;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 600px;
    max-width: 100%;
    position: relative;
    z-index: 10;
}

/* Campo de entrada */
.search-box {
    display: flex;
    align-items: center;
    width: 100%;
    background: #2B2B2B;
    border-radius: 8px;
    padding: 10px;
}

.search-input {
    flex-grow: 1;
    background: transparent !important;
    border: none;
    outline: none;
    font-size: 18px;
    color: white !important;
    padding: 10px;
    appearance: none;
    caret-color: white;
}

/* Correção para evitar mudança de cor ao usar preenchimento automático */
.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus,
.search-input:-webkit-autofill:active {
    background: transparent !important;
    -webkit-box-shadow: 0 0 0px 1000px #2B2B2B inset !important;
    box-shadow: 0 0 0px 1000px #2B2B2B inset !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
}

/* Botões */
.search-button,
.menu-button {
    background: transparent;
    border-radius: 50%;
    width: 37px; /* Reduzi 15% do tamanho original */
    height: 37px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.3s ease-in-out;
}

/* Estilo do botão de busca */
.search-button {
    background: #FFFFFF;
    border: none;
}

.search-button img {
    width: 31px; /* Aumentei 30% do tamanho original */
    height: 31px;
}

.search-button:hover {
    background: #C7C7C7;
}

/* Estilo do botão de adicionar "+" */
.menu-button {
    border: 2px solid #494849; /* Borda agora é #494849 */
}

.menu-button img {
    width: 17px;
    height: 17px;
    filter: brightness(0) invert(75%);
}

/* Hover do botão +: escurecendo fundo para #424242, mantendo a borda */
.menu-button:hover {
    background: #424242;
}

/* Contêiner de opções selecionadas */
.selected-options-container {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
    flex-wrap: wrap;
}

/* Caixinhas das opções selecionadas */
.selected-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.selected-option {
    background: #3a3b3f;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    color: white;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.3s ease-in-out;
}

.selected-option:hover {
    background: #5a5a5a;
}

/* Menu de opções */
.options-menu {
    display: none;
    position: absolute;
    background: #2B2B2B;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    width: 260px;
}

/* Quando o menu estiver ativo */
.options-menu.active {
    display: block !important;
}

/* Itens do menu */
.option-item {
    padding: 12px 15px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    background: #303135;
    border-radius: 6px;
    margin: 5px 0;
    transition: background 0.3s ease-in-out;
}

.option-item:hover {
    background: #5A5A5A;
}

/* Estilo do spinner de carregamento */
.loading-spinner {
    display: none;
    margin: 50px auto;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 1s linear infinite;
}

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

/* Modal - Resultado da pesquisa */
.result-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; /* Margem nas laterais */
    max-width: 600px; /* Limitando para telas maiores */
    background: #2B2B2B;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    text-align: left;
    color: white;
    max-height: 80vh; /* Define altura máxima */
    overflow-y: auto; /* Adiciona rolagem se necessário */
}

/* Fundo escuro atrás do modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1999;
}

/* Botão de fechar o modal */
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease-in-out;
}

.close-modal:hover {
    color: #C7C7C7;
}
