/**
 * ZupSearch - Estilos do Plugin
 */

/* --- Estilos do Container da Busca --- */
.zupsearch-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.zupsearch-container .zupsearch-form {
    display: contents;
}
.zupsearch-container .zupsearch-field {
    width: 0;
    opacity: 0;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid #333; /* Ajuste para a cor primária do seu tema */
    transition: all 0.4s ease;
    background: transparent;
    outline: none;
    font-size: 14px;
    margin-right: 0;
}
.zupsearch-container .zupsearch-icon-button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    z-index: 2;
}
.zupsearch-container .zupsearch-icon-button svg {
    width: 22px;
    height: 22px;
    stroke: #333; /* Ajuste para a cor primária do seu tema */
}
.zupsearch-container .zupsearch-submit {
    display: none;
}

/* --- Estado Ativo (quando o campo está visível) --- */
.zupsearch-container.active .zupsearch-field {
    width: 250px;
    opacity: 1;
    padding: 6px 10px;
    margin-right: -28px; /* Puxa o campo para baixo do ícone */
}

/* --- Estilos do Painel de Resultados AJAX --- */
#zupsearch-results {
    position: absolute;
    top: 120%; /* Posiciona abaixo do campo de busca */
    right: 0;
    width: 400px;
    max-width: 90vw;
    background-color: #fff;
    border: 1px solid #eee;
    z-index: 1000;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
#zupsearch-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.zupsearch-loader {
    display: block;
    width: 30px;
    height: 30px;
    margin: 20px auto;
    border: 3px solid #f3f3f3;
    border-top-color: #333; /* Ajuste para a cor primária do seu tema */
    border-radius: 50%;
    animation: zupsearch-spin 1s linear infinite;
}
@keyframes zupsearch-spin { to { transform: rotate(360deg); } }

.zupsearch-no-results {
    padding: 20px;
    text-align: center;
    color: #888;
}
.zupsearch-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}
.zupsearch-result-item a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    gap: 15px;
    transition: background-color 0.2s;
}
.zupsearch-result-item:last-child a { border-bottom: none; }
.zupsearch-result-item a:hover { background-color: #f9f9f9; }

.zupsearch-result-item-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}
.zupsearch-result-item-title {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}
.zupsearch-results-footer {
    padding: 15px;
    text-align: center;
    background-color: #fcfcfc;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}
.zupsearch-results-footer a {
    text-decoration: none;
    color: #333; /* Ajuste para a cor primária do seu tema */
    font-weight: bold;
    font-size: 14px;
}
