/**
 * =================================================================================
 * MRC Advanced Search Frontend Styles
 *
 * @version 2.2.0
 *
 * This stylesheet provides the look and feel for the live search results
 * container, individual items, and states like loading or locked content.
 * It uses a BEM-like naming convention (mrc-block__element--modifier).
 * =================================================================================
 */

/* Main container for all live search results */
.mrc-live-search-results {
    margin-top: 20px;
    max-height: calc(100vh - 250px); /* Prevents container from being too tall on long screens */
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    position: relative;
    z-index: 1000;
}

/* Loading spinner animation */
.mrc-live-search-results__loader {
    display: block;
    width: 40px;
    height: 40px;
    margin: 40px auto;
    border: 4px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: mrc-spin 1s linear infinite;
}

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

/* Message for user (e.g., "no results found", "type more characters") */
.mrc-live-search-results__message {
    padding: 20px;
    text-align: center;
    color: #555;
    font-size: 16px;
}

/* A single result item (the link) */
.mrc-live-search-results__item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    text-decoration: none !important; /* Override theme styles */
    color: inherit;
}

.mrc-live-search-results__item:hover {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* The thumbnail container for an item */
.mrc-live-search-results__thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    margin-right: 15px;
    background-color: #e9e9e9;
    border-radius: 4px;
    overflow: hidden;
}

/* The actual image inside the thumbnail */
.mrc-live-search-results__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A placeholder for items without a featured image */
.mrc-live-search-results__placeholder-thumb {
    width: 100%;
    height: 100%;
    background-color: #e9e9e9;
}

/* Container for text details (title, meta) */
.mrc-live-search-results__details {
    flex-grow: 1;
}

/* The title of a result item */
.mrc-live-search-results__title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

/* Style for the highlighted search term */
.mrc-live-search-results__title mark {
    background-color: #FFD700; /* A pleasant yellow */
    color: #333;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Meta information, like "Members Only" */
.mrc-live-search-results__meta {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* --Modifier: Locked / Members Only State */
.mrc-live-search-results__item--locked {
    opacity: 0.85;
    position: relative;
}

.mrc-live-search-results__item--locked .mrc-live-search-results__details {
    padding-right: 30px; /* Make space for lock icon */
}

.mrc-live-search-results__item--locked::after {
    content: '🔒'; /* Simple lock emoji, can be replaced with an SVG icon */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.7;
}

.mrc-live-search-results__item--locked .mrc-live-search-results__meta {
    color: #c0392b; /* A distinct reddish color */
}
