/* Enhanced Live Search - Modern CSS with GeneratePress compatibility */

.els-live-search-wrapper { 
    position: relative; 
    max-width: 100%; 
    margin: 0 auto 2rem;
    width: 100%;
}

.els-live-search-input { 
    width: 100%; 
    font-size: 16px; 
    line-height: 1.5;
    border: 1px solid #e0e0e0 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: inherit;
    color: #333 !important;
}

.els-live-search-input:focus { 
    outline: none;
    border-color: #2c7eb1;
    box-shadow: 0 4px 12px rgba(44, 126, 177, 0.15);
    background: #ffffff;
}

.els-live-search-input::placeholder {
    color: #888 !important;
    opacity: 1;
}

.els-live-search-results { 
    position: absolute; 
    left: 0; 
    right: 0; 
    top: calc(100% + 8px);
    background: #fff; 
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    z-index: 9999; 
    max-height: 480px; 
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none;
}

.els-live-search-results:not(:empty) {
    display: block;
}

/* Custom Scrollbar */
.els-live-search-results::-webkit-scrollbar {
    width: 8px;
}

.els-live-search-results::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.els-live-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.els-live-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.els-ls-list { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
}

.els-ls-item { 
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.els-ls-item:last-child {
    border-bottom: none;
}

.els-ls-item a { 
    display: flex; 
    padding: 14px 16px; 
    text-decoration: none; 
    color: #444;
    gap: 14px;
    align-items: flex-start;
    transition: background-color 0.2s ease;
}

.els-ls-item a:hover,
.els-ls-item.focused a { 
    background: #f8f9fa;
}

.els-ls-thumb { 
    width: 64px; 
    height: 64px; 
    object-fit: cover; 
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f0f0;
}

.els-ls-body { 
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.els-ls-type { 
    font-size: 11px; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2c7eb1;
    display: inline-block;
    margin-bottom: 4px;
}

.els-ls-title { 
    font-size: 16px; 
    font-weight: 600; 
    line-height: 1.4;
    margin: 0 0 6px 0;
    color: #2a2a2a;
}

.els-ls-excerpt { 
    font-size: 14px; 
    line-height: 1.5;
    color: #555;
    margin: 0;
}

.els-ls-excerpt p {
    margin: 0;
}

.els-ls-loading,
.els-ls-none,
.els-ls-error { 
    padding: 20px; 
    text-align: center;
    color: #555;
    font-size: 14px;
}

.els-ls-loading {
    color: #2c7eb1;
}

.els-ls-error {
    color: #d32f2f;
}

mark { 
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .els-live-search-input {
        padding: 12px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .els-live-search-results {
        max-height: 400px;
    }
    
    .els-ls-thumb {
        width: 56px;
        height: 56px;
    }
    
    .els-ls-item a {
        padding: 12px;
        gap: 12px;
    }
    
    .els-ls-title {
        font-size: 15px;
    }
    
    .els-ls-excerpt {
        font-size: 13px;
    }
}

/* GeneratePress specific adjustments */
.site-content .els-live-search-wrapper {
    margin-bottom: 2rem;
}

/* Ensure compatibility with GeneratePress container */
.generate-columns-container .els-live-search-wrapper,
.gb-container .els-live-search-wrapper {
    max-width: 100%;
}

/* Fix for GeneratePress buttons that might interfere */
.els-live-search-wrapper input[type="text"] {
    -webkit-appearance: none;
    appearance: none;
}

/* Animation for results appearing */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.els-live-search-results:not(:empty) {
    animation: slideDown 0.2s ease-out;
}