/* Guardian Recovery Search & Filter Styles */

.gr-search-filter-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Input Wrapper */
.gr-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Search Input */
.gr-search-input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.gr-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.gr-search-input.gr-searching {
    opacity: 0.7;
}

.gr-search-input::placeholder {
    color: #999;
    opacity: 1;
}

/* Clear Button */
.gr-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 5px;
    display: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.gr-clear-search:hover {
    color: #333;
}

.gr-clear-search:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.gr-clear-search span {
    display: block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
}

/* Loading Indicator */
.gr-search-loading {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    z-index: 1;
}

.gr-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 115, 170, 0.2);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: gr-spin 0.8s linear infinite;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .gr-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 10px 40px 10px 12px;
    }

    .gr-clear-search {
        right: 8px;
        font-size: 20px;
    }

    .gr-search-loading {
        right: 40px;
    }

    .gr-spinner {
        width: 18px;
        height: 18px;
        border-width: 2px;
    }
}

/* Elementor Editor Styles */
.elementor-editor-active .gr-search-filter-wrapper {
    pointer-events: auto;
}

.elementor-editor-active .gr-search-input {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Accessibility */
.gr-search-input:focus-visible,
.gr-clear-search:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gr-search-input {
        background-color: #2c2c2c;
        border-color: #444;
        color: #e0e0e0;
    }

    .gr-search-input::placeholder {
        color: #888;
    }

    .gr-search-input:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 1px #4a9eff;
    }

    .gr-clear-search {
        color: #888;
    }

    .gr-clear-search:hover {
        color: #e0e0e0;
    }

    .gr-spinner {
        border-color: rgba(74, 158, 255, 0.2);
        border-top-color: #4a9eff;
    }
}

/* Print Styles */
@media print {
    .gr-search-filter-wrapper {
        display: none;
    }
}
