/* WP Smart Search - Base Frontend Styles
   Uses inherit so it follows the site's default font and colors */

.wss-search-wrapper,
.wss-results-page {
    font-family: inherit;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
}

.wss-search-wrapper *,
.wss-results-page * {
    box-sizing: border-box;
}

.wss-search-form,
.wss-results-form {
    margin: 0;
}

.wss-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.wss-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 1em;
    font-family: inherit;
    background: #fff;
    color: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.wss-search-input:focus {
    border-color: #2271b1;
}

.wss-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    background: #2271b1;
    color: #fff;
    font-size: 1em;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.wss-search-btn:hover {
    background: #135e96;
}

.wss-search-btn svg {
    flex-shrink: 0;
}

.wss-filters {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.wss-filter-types {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wss-filter-types label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9em;
    cursor: pointer;
}

.wss-filter-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wss-cat-select,
.wss-pcat-select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9em;
    background: #fff;
}

/* Live results dropdown */
.wss-live-results {
    position: relative;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.wss-live-results .wss-live-item {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.wss-live-results .wss-live-item:last-child {
    border-bottom: none;
}

.wss-live-results .wss-live-item:hover {
    background: #f5f5f5;
}

.wss-live-results .wss-live-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wss-live-results .wss-live-content {
    flex: 1;
    min-width: 0;
}

.wss-live-results .wss-live-title {
    font-weight: 600;
    margin: 0 0 4px;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wss-live-results .wss-live-meta {
    font-size: 0.8em;
    color: #666;
}

.wss-live-results .wss-live-footer {
    padding: 10px 14px;
    text-align: center;
    border-top: 1px solid #eee;
}

.wss-live-results .wss-live-footer a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.wss-live-results .wss-live-empty,
.wss-live-results .wss-live-loading {
    padding: 16px;
    text-align: center;
    color: #666;
}

/* Results page */
.wss-results-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.wss-results-title {
    margin: 0 0 16px;
    font-size: 1.5em;
}

.wss-results-search-box {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.wss-captcha-box {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.wss-captcha-box label {
    font-size: 0.95em;
}

.wss-captcha-input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
    text-align: center;
}

.wss-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fce4e4;
    color: #b32d2e;
    border-radius: 4px;
}

.wss-info {
    margin-top: 12px;
    padding: 10px 14px;
    background: #e8f0fe;
    color: #1a56db;
    border-radius: 4px;
}

.wss-found-count {
    margin-bottom: 16px;
    color: #555;
}

.wss-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wss-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

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

.wss-thumb {
    flex-shrink: 0;
}

.wss-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.wss-item-content {
    flex: 1;
    min-width: 0;
}

.wss-type-badge {
    display: inline-block;
    font-size: 0.75em;
    padding: 2px 8px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 4px;
    color: #444;
}

.wss-item-title {
    margin: 0 0 6px;
    font-size: 1.15em;
}

.wss-item-title a {
    color: inherit;
    text-decoration: none;
}

.wss-item-title a:hover {
    color: #2271b1;
}

.wss-item-excerpt {
    margin: 0 0 6px;
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
}

.wss-item-date {
    font-size: 0.8em;
    color: #888;
}

.wss-no-results {
    padding: 30px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Pagination */
.wss-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 24px;
    justify-content: center;
}

.wss-pagination a {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    font-family: inherit;
    transition: background 0.15s;
}

.wss-pagination a:hover {
    background: #f0f0f0;
}

.wss-pagination a.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* Responsive */
@media (max-width: 600px) {
    .wss-input-group {
        flex-direction: column;
    }
    .wss-search-btn {
        width: 100%;
    }
    .wss-item {
        flex-direction: column;
    }
    .wss-thumb img {
        width: 100%;
        height: auto;
        max-height: 180px;
    }
}
