/* Pure Search - Flat Design */
.pure-search-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    /* Example modern font */
}

/* Form Wrapper */
.pure-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    /* Slight roundness for modern feel, or 0 for strict flat */
    padding: 10px 15px;
    height: 50px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.pure-search-form:focus-within {
    border-color: #333;
    /* Darker border on focus */
}

/* Input Wrapper */
.pure-search-input-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    height: 100%;
}

/* Input Field */
.pure-search-field {
    flex-grow: 1;
    border: none !important;
    /* Override theme styles */
    background: transparent !important;
    font-size: 16px;
    color: #333;
    padding: 0 10px 0 0;
    /* No right padding here, handled by actions */
    outline: none !important;
    box-shadow: none !important;
    margin: 0;
    height: 100%;
    min-width: 0;
    /* Flexbox fix */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Hide default search cancel button (Chrome, Safari) */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

/* Actions Wrapper (Reset + Submit + Loader) */
.pure-search-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    /* Push to right */
    padding-left: 5px;
    flex-shrink: 0;
}

.pure-search-reset {
    background: none;
    border: none;
    padding: 0 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    /* Neutral color, not blue */
    transition: color 0.3s;
}

.pure-search-reset:hover {
    color: #666;
}

/* Submit Button / Icon */
.pure-search-submit {
    background: none;
    border: none;
    padding: 0 0 0 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: color 0.3s;
}

.pure-search-submit:hover {
    color: #000;
}

.pure-search-submit svg {
    width: 20px;
    height: 20px;
}

/* Loader */
.pure-search-loader {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
    display: none;
    /* Hidden by default */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results Dropdown */
.pure-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    z-index: 1000;
    box-shadow: none;
    /* Strict flat style */
    display: none;
    /* Hidden by default */
    max-height: 300px;
    overflow-y: auto;
}

.pure-search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.pure-search-result-item:last-child {
    border-bottom: none;
}

.pure-search-result-item:hover,
.pure-search-result-item.active {
    background: #f9f9f9;
}

.pure-search-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
    background: #eee;
}

.pure-search-title {
    font-size: 14px;
    font-weight: 500;
}

/* Empty State */
.pure-search-no-results {
    padding: 15px;
    text-align: center;
    color: #777;
    font-size: 14px;
}

/* Search Results Page Styling */
.pure-search-results-page {
    margin: 20px 0;
    width: 100%;
}

.pure-results-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Tighter spacing */
}

.pure-result-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    /* Tighter gap */
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pure-result-card:hover {
    background-color: #fcfcfc;
}

.pure-result-thumb {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.pure-result-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.pure-result-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.pure-result-card:hover .pure-result-thumb img {
    opacity: 0.9;
}

.pure-result-no-thumb {
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    border-radius: 10px;
    display: block;
}

/* Optional icon for no-thumb */
.pure-result-no-thumb::after {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNjY2MiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48cmVjdCB4PSIzIiB5PSIzIiB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHJ4PSIyIiByeT0iMiI+PC9yZWN0PjxjaXJjbGUgY3g9IjguNSIgY3k9IjguNSIgcj0iMS41Ij48L2NpcmNsZT48cG9seWxpbmUgcG9pbnRzPSIyMSAxNSAxNiAxMCA1IDIxIj48L3BvbHlsaW5lPjwvc3ZnPg==');
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.pure-result-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text vertically relative to thumb if small */
    height: 80px;
    /* Match thumb height for alignment */
}

/* Allow height to grow if content is long */
.pure-result-content {
    height: auto;
    min-height: 80px;
}

.pure-result-title {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    /* Smaller title */
    font-weight: 600;
    line-height: 1.2;
}

.pure-result-title a {
    text-decoration: none;
    color: #222;
}

.pure-result-title a:hover {
    color: #444;
}

.pure-result-excerpt {
    color: #777;
    font-size: 0.9em;
    /* Smaller excerpt */
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}

/* Pagination */
.pure-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.pure-pagination .page-numbers {
    padding: 6px 12px;
    border: 1px solid #eee;
    background: #fff;
    text-decoration: none;
    color: #555;
    border-radius: 3px;
    font-size: 0.9em;
}

.pure-pagination .page-numbers:hover {
    background: #f9f9f9;
    color: #333;
    border-color: #ddd;
}

.pure-pagination .page-numbers.current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Responsive */
@media (max-width: 600px) {
    .pure-result-card {
        gap: 12px;
        padding: 10px 0;
        /* Less padding on mobile */
    }

    .pure-result-thumb {
        width: 60px;
        /* Smaller on mobile */
        height: 60px;
    }

    .pure-result-content {
        min-height: 60px;
    }

    .pure-result-title {
        font-size: 1em;
    }
}