/**
 * LMC Search Styles
 * 
 * @package LMC_Constructora
 */

/* Base Search Form Styles */
.lmc-search-form {
    position: relative;
    font-family: 'Axiforma', sans-serif;
}

.lmc-search-form-inner {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.lmc-search-input-wrapper {
    position: relative;
    flex: 1;
}

.lmc-search-input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 40px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Axiforma', sans-serif;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.lmc-search-input:focus {
    outline: none;
    border-color: #D2ED35;
    box-shadow: 0 0 0 3px rgba(210, 237, 53, 0.1);
}

.lmc-search-input::placeholder {
    color: #B6B7C3;
    font-family: 'Axiforma', sans-serif;
    font-size: 16px;
}

.lmc-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #B6B7C3;
    pointer-events: none;
    transition: color 0.3s ease;
}

.lmc-search-input:focus + .lmc-search-icon {
    color: #165B6B;
}

.lmc-search-button {
    background: #D2ED35;
    color: #474756;
    border: none;
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 16px;
    font-family: 'Axiforma', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lmc-search-button:hover {
    background: #165B6B;
    color: #fff;
    transform: translateY(-1px);
}

.lmc-search-button:active {
    transform: translateY(0);
}

.lmc-search-button-text {
    font-weight: 500;
}

/* Style Variations */
.lmc-search-style-minimal {
    position: relative;
}

.lmc-search-style-minimal .lmc-search-form-inner {
    gap: 0;
    position: relative;
}

.lmc-search-style-minimal .lmc-search-input-wrapper {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    opacity: 0;
}

.lmc-search-style-minimal.lmc-search-expanded .lmc-search-input-wrapper {
    width: 230px;
    opacity: 1;
}

.lmc-search-style-minimal .lmc-search-input {
    border-radius: 8px;
    border: 1px solid #E5E5E5;
    width: 100%;
    padding: 12px 16px;
    /* padding-right: 40px; */
    background: #fff;
    transition: all 0.3s ease;
}

.lmc-search-style-minimal .lmc-search-input:focus {
    outline: none;
    border-color: #D2ED35;
    box-shadow: 0 0 0 3px rgba(210, 237, 53, 0.1);
}

.lmc-search-style-minimal .lmc-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #B6B7C3;
    pointer-events: none;
    transition: color 0.3s ease;
}

.lmc-search-style-minimal .lmc-search-input:focus + .lmc-search-icon {
    color: #165B6B;
}

.lmc-search-style-minimal .lmc-search-button {
    position: absolute;
    right: 0;
    top: 0;
    width: 52px;
    height: 52px;
    background: #fff;
    color: #474756;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
    min-width: 48px;
}

.lmc-search-style-minimal .lmc-search-button:hover {
    background: #D2ED35;
    color: #474756;
    border-color: #D2ED35;
    transform: scale(1.05);
}

.lmc-search-style-minimal .lmc-search-button:active {
    transform: scale(0.95);

}

.lmc-search-style-minimal .lmc-search-button-text {
    display: none;
}

.lmc-search-style-minimal .lmc-search-button i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.lmc-search-style-minimal.lmc-search-expanded .lmc-search-button i {
    transform: rotate(90deg);
}

.lmc-search-style-minimal.lmc-search-expanded .lmc-search-button {
    border-radius: 8px;
    border: 1px solid #E5E5E5;
}

/* Style Variations */
.lmc-search-style-prominent .lmc-search-input {
    padding: 16px 20px;
    padding-right: 50px;
    font-size: 18px;
    border-width: 2px;
}

.lmc-search-style-prominent .lmc-search-button {
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
}

.lmc-search-style-prominent .lmc-search-icon {
    right: 16px;
    font-size: 18px;
}

/* AJAX Search Results */
.lmc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 8px;
    max-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lmc-search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E5E5;
    background: #f8f9fa;
}

.lmc-search-results-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.lmc-search-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lmc-search-close:hover {
    background: #e9ecef;
    color: #333;
}

.lmc-search-results-content {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

.lmc-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.lmc-search-result-item:hover {
    background: #f8f9fa;
}

.lmc-search-result-item:last-child {
    border-bottom: none;
}

.lmc-search-result-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

.lmc-search-result-content {
    flex: 1;
    min-width: 0;
}

.lmc-search-result-title {
    font-weight: 600;
    color: #474756;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.3;
}

.lmc-search-result-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 4px;
}

.lmc-search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #999;
}

.lmc-search-result-type {
    background: #D2ED35;
    color: #474756;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
}

.lmc-search-result-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lmc-search-result-location i {
    font-size: 10px;
}

.lmc-search-results-footer {
    padding: 12px 16px;
    border-top: 1px solid #E5E5E5;
    background: #f8f9fa;
    text-align: center;
}

.lmc-search-view-all {
    color: #165B6B;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.lmc-search-view-all:hover {
    color: #D2ED35;
}

/* Loading State */
.lmc-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.lmc-search-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #E5E5E5;
    border-top: 2px solid #D2ED35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results State */
.lmc-search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lmc-search-form-inner {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .lmc-search-button {
        width: 100%;
        justify-content: center;
    }
    
    .lmc-search-results {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
    }
    
    .lmc-search-style-minimal .lmc-search-form-inner {
        flex-direction: row;
        gap: 0;
    }
    
    .lmc-search-style-minimal .lmc-search-input-wrapper {
        width: 0;
        opacity: 0;
    }
    
    .lmc-search-style-minimal.lmc-search-expanded .lmc-search-input-wrapper {
        width: 230px;
        opacity: 1;
    }
    
    .lmc-search-style-minimal .lmc-search-button {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
    }
    
    .lmc-search-style-minimal .lmc-search-input {
        border-radius: 8px;
        border: 1px solid #E5E5E5;
    }
}

/* Focus Management */
.lmc-search-form:focus-within .lmc-search-results {
    display: flex !important;
}

/* Accessibility */
.lmc-search-input:focus {
    outline: 2px solid #D2ED35;
    outline-offset: 2px;
}

.lmc-search-button:focus {
    outline: 2px solid #165B6B;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 