/**
 * Jeev Search Styles v2.0
 * Fully integrated with WordPress theme.json CSS variables
 */

/* ==========================================================================
   Search Input - Full Width Fix
   ========================================================================== */

.wp-block-search {
    width: 100%;
}

.wp-block-search__inside-wrapper {
    width: 100%;
}

.wp-block-search .jeev-search-wrapper,
.search-form .jeev-search-wrapper {
    width: 100%;
    flex: 1 1 100%;
}

.wp-block-search .jeev-search-wrapper input[type="search"],
.wp-block-search .jeev-search-wrapper input[name="s"],
.search-form .jeev-search-wrapper input[type="search"],
.search-form .jeev-search-wrapper input[name="s"],
.jeev-search-wrapper input.wp-block-search__input {
    width: 100%;
    box-sizing: border-box;
}

.wp-block-search__button-inside .wp-block-search__inside-wrapper {
    display: flex;
    width: 100%;
}

.wp-block-search__button-inside .jeev-search-wrapper {
    flex: 1;
}
.jeev-search-wrapper input {
    padding-left:20px;
}


/* ==========================================================================
   Search Wrapper
   ========================================================================== */

.jeev-search-wrapper {
    position: relative;
    width: 100%;
    font-family: var(--wp--preset--font-family--outfit, inherit);
}


/* ==========================================================================
   Search Input Styling
   ========================================================================== */

.jeev-search-wrapper input[type="search"],
.jeev-search-wrapper input[name="s"],
.jeev-search-wrapper input.wp-block-search__input {
    border: 2px solid var(--wp--preset--color--accent, #6797ff);
    border-radius: 0.33rem;
    font-family: var(--wp--preset--font-family--outfit, inherit);
    font-size: var(--wp--preset--font-size--small, 0.875rem);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jeev-search-wrapper input[type="search"]:focus,
.jeev-search-wrapper input[name="s"]:focus,
.jeev-search-wrapper input.wp-block-search__input:focus {
    border-color: var(--wp--preset--color--accent-3, #4a7de8);
    outline: none;
    box-shadow: 0 0 0 3px var(--wp--preset--color--accent-2, rgba(103, 151, 255, 0.2));
}


/* ==========================================================================
   Results Dropdown
   ========================================================================== */

.jeev-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99999;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;

    background-color: var(--wp--preset--color--base, #fff);
    color: var(--wp--preset--color--contrast-2, #333);
    border: 2px solid var(--wp--preset--color--accent, #6797ff);
    border-top: none;
    border-radius: 0 0 0.33rem 0.33rem;
    box-shadow: 0px 10px 60px 0px rgba(103, 151, 255, 0.24);

    font-family: var(--wp--preset--font-family--outfit, inherit);

    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.jeev-search-results.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar */
.jeev-search-results::-webkit-scrollbar {
    width: 6px;
}

.jeev-search-results::-webkit-scrollbar-track {
    background: var(--wp--preset--color--accent-2, rgba(103, 151, 255, 0.1));
}

.jeev-search-results::-webkit-scrollbar-thumb {
    background-color: var(--wp--preset--color--accent, #6797ff);
    border-radius: 3px;
}

.jeev-search-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--wp--preset--color--accent-3, #4a7de8);
}


/* ==========================================================================
   Result Items
   ========================================================================== */

.jeev-search-result-item {
    border-bottom: 1px solid var(--wp--preset--color--accent-2, rgba(103, 151, 255, 0.15));
    transition: background-color 0.15s ease, color 0.15s ease;
}

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

.jeev-search-result-item a {
    display: block;
    padding: 0.875em 1em;
    text-decoration: none;
    color: inherit;
    font-family: var(--wp--preset--font-family--outfit, inherit);
}

.jeev-search-result-item a:hover {
    text-decoration: none;
}

/* Hover & Focus & Selected States */
.jeev-search-result-item:hover,
.jeev-search-result-item:focus-within,
.jeev-search-result-item.is-selected {
    background-color: var(--wp--preset--color--accent, #6797ff);
    color: var(--wp--preset--color--base, #fff);
}

.jeev-search-result-item:hover a,
.jeev-search-result-item:focus-within a,
.jeev-search-result-item.is-selected a {
    color: inherit;
}

.jeev-search-result-item:hover .jeev-search-result-title,
.jeev-search-result-item:focus-within .jeev-search-result-title,
.jeev-search-result-item.is-selected .jeev-search-result-title {
    color: var(--wp--preset--color--base, #fff);
}

.jeev-search-result-item:hover .jeev-search-result-meta,
.jeev-search-result-item:focus-within .jeev-search-result-meta,
.jeev-search-result-item.is-selected .jeev-search-result-meta {
    opacity: 0.85;
}

.jeev-search-result-item:hover .jeev-search-result-excerpt,
.jeev-search-result-item:focus-within .jeev-search-result-excerpt,
.jeev-search-result-item.is-selected .jeev-search-result-excerpt {
    opacity: 0.95;
}

/* ==========================================================================
Result Content
========================================================================== */
.jeev-search-result-title {
    font-family: var(--wp--preset--font-family--outfit, inherit);
    font-weight: 700;
    font-size: var(--wp--preset--font-size--small, 0.875rem);
    line-height: 1.4;
    margin-bottom: 0.25em;
    color: var(--wp--preset--color--accent, #6797ff);
    transition: color 0.15s ease;
}

.jeev-search-result-meta {
    font-family: var(--wp--preset--font-family--outfit, inherit);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.6;
    margin-bottom: 0.375em;
}

.jeev-search-result-excerpt {
    font-family: var(--wp--preset--font-family--outfit, inherit);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.55;
    opacity: 0.85;
}

/* ==========================================================================
Highlight
========================================================================== */
.jeev-search-highlight {
    background-color: var(--wp--preset--color--accent-2, rgba(103, 151, 255, 0.2));
    color: var(--wp--preset--color--accent-3, #4a7de8);
    padding: 0.1em 0.25em;
    border-radius: 2px;
    font-weight: 600;
}

.jeev-search-result-item:hover .jeev-search-highlight,
.jeev-search-result-item:focus-within .jeev-search-highlight,
.jeev-search-result-item.is-selected .jeev-search-highlight {
    background-color: var(--wp--preset--color--base, #fff);
    color: var(--wp--preset--color--accent, #6797ff);
}

/* ==========================================================================
Loading & No Results States
========================================================================== */
.jeev-search-loading,
.jeev-search-no-results {
    padding: 1.25em 1em;
    text-align: center;
    font-family: var(--wp--preset--font-family--outfit, inherit);
    font-size: var(--wp--preset--font-size--small, 0.875rem);
    color: var(--wp--preset--color--contrast-2, #333);
    opacity: 0.7;
}

.jeev-search-loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 0.5em;
    border: 2px solid var(--wp--preset--color--accent-2, rgba(103, 151, 255, 0.3));
    border-top-color: var(--wp--preset--color--accent, #6797ff);
    border-radius: 50%;
    animation: jeev-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes jeev-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
Accessibility
========================================================================== */
.jeev-search-result-item a:focus {
    outline: none;
}

.jeev-search-result-item:focus-within {
    outline: 2px solid var(--wp--preset--color--accent-3, #4a7de8);
    outline-offset: -2px;
}

/* ==========================================================================
Mobile
========================================================================== */
@media only screen and (max-width: 600px) {
    .jeev-search-results {
        max-height: 60vh;
    }

    .jeev-search-result-item a {
        padding: 0.75em 0.875em;
    }

    .jeev-search-result-title {
        font-size: 0.9rem;
    }

    .jeev-search-result-excerpt {
        font-size: 0.8rem;
        line-height: 1.5;
    }
}