/**
 * Novara — Enhanced Search Styles (v6.11.0)
 *
 * Premium app-like search visuals with sections, chips, loading state,
 * and mobile-optimized layout.
 *
 * @package Novara
 * @since 6.11.0
 */

/* ===================================================================
   Search sections (multi-type results)
   =================================================================== */

.novara-search-section {
    margin: 18px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    padding-bottom: 14px;
}
.novara-search-section:last-child {
    border-bottom: none;
}
.novara-search-section__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted, #888);
    font-weight: 700;
    margin: 0 0 12px;
    padding-left: 4px;
}

/* ===================================================================
   Result rows
   =================================================================== */

.novara-search-result {
    display: flex;
    gap: 14px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary, #15151C);
    transition: background 0.15s;
    margin-bottom: 4px;
    align-items: flex-start;
}
.novara-search-result:hover,
.novara-search-result:focus {
    background: var(--bg-secondary, #f8f9fb);
}
.novara-search-result__thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.novara-search-result__body {
    flex: 1;
    min-width: 0;
}
.novara-search-result__title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 3px;
    color: var(--text-primary, #15151C);
}
.novara-search-result__excerpt {
    font-size: 12px;
    color: var(--text-secondary, #555);
    line-height: 1.45;
    margin: 4px 0 6px;
    /* Clamp at 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.novara-search-result__meta {
    font-size: 11px;
    color: var(--text-muted, #888);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.novara-search-result__cat {
    color: var(--novara-crimson, #E63946);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.novara-search-result--compact {
    align-items: center;
}
.novara-search-result__avatar {
    flex-shrink: 0;
}

/* ===================================================================
   Chips (categories / tags)
   =================================================================== */

.novara-search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
}
.novara-search-chip {
    background: var(--bg-secondary, #f8f9fb);
    color: var(--text-primary, #15151C);
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.novara-search-chip:hover,
.novara-search-chip:focus {
    background: var(--novara-crimson, #E63946);
    color: #fff;
    border-color: var(--novara-crimson, #E63946);
}
.novara-search-chip small {
    opacity: 0.6;
    font-weight: 400;
}

/* ===================================================================
   Suggestions / autocomplete
   =================================================================== */

.novara-suggestions--active {
    display: block;
    margin-top: 12px;
}
.novara-suggestions--hidden {
    display: none;
}
.novara-suggestions__list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--bg-primary, #fff);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}
.novara-suggestions__list li {
    margin: 0;
    padding: 0;
}
.novara-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary, #15151C);
    font-size: 14px;
    transition: background 0.15s;
}
.novara-suggestion:hover,
.novara-suggestion:focus,
.novara-suggestion--active {
    background: var(--bg-secondary, #f8f9fb);
    outline: none;
}
.novara-suggestion .icon {
    color: var(--text-muted, #888);
}

/* Trending tag pills (when input is empty) */
.novara-suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
}
.novara-suggestion-tag {
    background: var(--bg-secondary, #f8f9fb);
    color: var(--text-primary, #15151C);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.novara-suggestion-tag:hover,
.novara-suggestion-tag:focus,
.novara-suggestion-tag.novara-suggestion--active {
    background: var(--novara-crimson, #E63946);
    color: #fff;
    border-color: var(--novara-crimson, #E63946);
}

/* ===================================================================
   Loading state
   =================================================================== */

.novara-search-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #888);
}
.novara-search-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--bg-secondary, #f0f0f3);
    border-top-color: var(--novara-crimson, #E63946);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: novara-spinner 0.8s linear infinite;
}
@keyframes novara-spinner {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .novara-search-loading__spinner { animation: none; }
}

/* ===================================================================
   Notice (fuzzy match indicator)
   =================================================================== */

.novara-search-notice {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 14px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 12px;
    font-weight: 600;
}

/* ===================================================================
   View all link
   =================================================================== */

.novara-search-view-all {
    display: block;
    text-align: center;
    padding: 14px;
    margin-top: 18px;
    background: var(--novara-crimson, #E63946);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
    transition: background 0.15s;
}
.novara-search-view-all:hover,
.novara-search-view-all:focus {
    background: #B8202E;
    color: #fff;
}

/* ===================================================================
   Empty / no results
   =================================================================== */

.novara-search-empty {
    text-align: center;
    padding: 50px 20px;
}

/* ===================================================================
   Mobile optimization
   =================================================================== */

@media (max-width: 768px) {
    .novara-search-result {
        padding: 12px 8px;
    }
    .novara-search-result__thumb {
        width: 56px;
        height: 42px;
    }
    .novara-search-result__title {
        font-size: 14px;
    }
    .novara-search-result__excerpt {
        font-size: 11.5px;
        -webkit-line-clamp: 2;
    }
    .novara-search-chip,
    .novara-suggestion-tag {
        padding: 8px 14px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }
    .novara-suggestion {
        padding: 14px;
        min-height: 48px;          /* WCAG tap target */
    }
}

/* ===================================================================
   Dark mode
   =================================================================== */

[data-theme="dark"] .novara-search-result__title { color: #fff; }
[data-theme="dark"] .novara-search-result__excerpt { color: rgba(255,255,255,0.7); }
[data-theme="dark"] .novara-search-section { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .novara-suggestions__list { background: #1a1a22; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
[data-theme="dark"] .novara-search-chip,
[data-theme="dark"] .novara-suggestion-tag { background: #2a2a36; color: #fff; }
[data-theme="dark"] .novara-search-notice { background: #533f0d; color: #fde68a; }
