/**
 * IOX Stage Search Styles
 * 
 * Styles for the search bar, autocomplete, and results display
 */

/* Main container */
.iox-stage-search-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    position: relative;
}

/* Root variables for consistent theming */
:root {
    --iox-primary: #0073aa;
    --iox-primary-hover: #005f8b;
    --iox-secondary: #f8fafc;
    --iox-border: #e2e8f0;
    --iox-text: #0f172a;
    --iox-text-muted: #64748b;
    --iox-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --iox-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --iox-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --iox-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --iox-radius: 12px;
    --iox-radius-sm: 8px;
    --iox-radius-lg: 16px;
}

/* Search form */
.iox-stage-search-form {
    position: relative;
    margin-bottom: 20px;
}

.iox-stage-search-input-wrapper {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.iox-stage-search-input-wrapper:focus-within {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.iox-stage-search-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.iox-stage-search-input:focus {
    border-color: #0073aa;
}

.iox-stage-search-button {
    padding: 15px 25px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.iox-stage-search-button:hover {
    background-color: #005f8b;
}

/* Autocomplete suggestions */
.iox-stage-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.iox-stage-search-suggestion {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.iox-stage-search-suggestion:hover {
    background-color: #f5f5f5;
}

.iox-stage-search-history-icon,
.iox-stage-search-profile-icon,
.iox-stage-search-event-icon {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.iox-stage-search-history-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%23666" d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8zm1-8.5V7c0-.6-.4-1-1-1s-1 .4-1 1v5c0 .3.1.5.3.7l3 3c.2.2.4.3.7.3.3 0 .5-.1.7-.3.4-.4.4-1 0-1.4L13 11.5z"/></svg>');
}

.iox-stage-search-profile-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%23666" d="M12 12c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 7c-2.7 0-8 1.3-8 4v3h16v-3c0-2.7-5.3-4-8-4zm6 5H6v-1c0-.7 3.1-2 6-2s6 1.3 6 2v1z"/></svg>');
}

.iox-stage-search-event-icon {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="%23666" d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM5 5v1h14V5H5zm2 4h10v2H7zm0 4h7v2H7z"/></svg>');
}

.iox-stage-search-spell-check {
    color: #666;
    font-style: italic;
}

/* Search results */
.iox-stage-search-results {
    background-color: transparent;
    border-radius: var(--iox-radius);
    padding: 0;
    margin-top: 32px;
}

/* Two-column responsive layout */
.iox-stage-search-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 28px;
}

.iox-stage-search-main {
    min-width: 0;
}

.iox-stage-search-sidebar {
    min-width: 0;
}

.iox-stage-search-loading {
    position: relative;
    min-height: 200px;
}

.iox-stage-search-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.iox-stage-search-ai-results,
.iox-stage-search-profiles-results,
.iox-stage-search-events-results,
.iox-stage-search-pages-results,
.iox-stage-search-posts-results,
.iox-stage-search-carousel {
    margin-bottom: 48px;
}

.iox-stage-search-ai-results h3,
.iox-stage-search-profiles-results h3,
.iox-stage-search-events-results h3,
.iox-stage-search-pages-results h3,
.iox-stage-search-posts-results h3,
.iox-stage-search-carousel h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding: 0;
    color: var(--iox-text);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.iox-stage-search-ai-results h3::before,
.iox-stage-search-profiles-results h3::before,
.iox-stage-search-events-results h3::before,
.iox-stage-search-pages-results h3::before,
.iox-stage-search-posts-results h3::before,
.iox-stage-search-carousel h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--iox-primary), var(--iox-primary-hover));
    border-radius: 2px;
}

.iox-stage-search-ai-results {
    background: #f8fafcf;
    padding: 24px;
    border-radius: var(--iox-radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--iox-shadow-sm);
    position: relative;
    overflow: hidden;
}

.iox-stage-search-ai-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
}

.iox-stage-search-ai-results h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1e40af;
}

.iox-stage-search-ai-result {
    line-height: 1.7;
    font-size: 15px;
    color: #334155;
}

.iox-stage-search-ai-result p {
    margin: 0 0 12px 0;
}

.iox-stage-search-ai-result p:last-child {
    margin-bottom: 0;
}

/* AI skeleton */
.ai-skeleton .line { height: 12px; background: #e9eef4; margin: 10px 0; border-radius: 6px; }
.ai-skeleton .line.w80 { width: 80%; }
.ai-skeleton .line.w95 { width: 95%; }
.ai-skeleton .line.w90 { width: 90%; }
.ai-skeleton .line.w70 { width: 70%; }

.iox-stage-search-result-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid #e7e7e7;
}

.iox-stage-search-result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.iox-stage-search-result-thumbnail { width: 140px; }

.iox-stage-search-result-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.iox-stage-search-result-content {
    flex: 1;
}

.iox-stage-search-result-content h4 { margin: 0 0 8px; font-size: 20px; }

.iox-stage-search-result-content h4 a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.iox-stage-search-result-content h4 a:hover {
    color: #005f8b;
    text-decoration: underline;
}

.iox-stage-search-result-content p { margin: 0; color: #4b5563; line-height: 1.6; }

/* Clamp helpers */
.iox-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.iox-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Meta row under titles */
.iox-stage-search-result-meta {
    margin: 6px 0 6px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Badge styling */
.iox-stage-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.4;
}

.iox-stage-badge-upcoming {
    background-color: #e6f4ff;
    color: #0b69a3;
    border: 1px solid #b3e0ff;
}

/* Past badge styling */
.iox-stage-badge-past {
    background-color: #f5f5f5;
    color: #7a7a7a;
    border: 1px solid #e0e0e0;
}

/* Date label styling */
.iox-stage-date {
    color: #555;
    font-size: 11px;
}

.iox-stage-search-no-results {
    text-align: center;
    padding: 30px 0;
    color: #666;
}

/* Chips */
.iox-chip { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    padding: 5px 14px; 
    border-radius: 6px; 
    font-size: 11px; 
    font-weight: 600; 
    background: var(--iox-secondary); 
    color: var(--iox-text); 
    border: 1px solid var(--iox-border); 
    transition: all 0.2s ease;
}

.iox-chip:hover {
    background: #e2e8f0;
}

.iox-chip + .iox-chip { 
    margin-left: 6px; 
}

.iox-chip-author { 
    background: #eef2ff; 
    color: #3730a3; 
    border-color: #c7d2fe; 
}

.iox-chip-date { 
    background: #ecfeff; 
    color: #155e75; 
    border-color: #a5f3fc; 
}

.iox-chip-category { 
    background: #f0fdf4; 
    color: #166534; 
    border-color: #bbf7d0; 
}

.iox-chip-match { 
    background: #fffbeb; 
    color: #92400e; 
    border-color: #fde68a; 
}

.iox-chip-title { 
    background: #f5f3ff; 
    color: #5b21b6; 
    border-color: #ddd6fe; 
}

.iox-chip-role {
    background: #fdf2f8;
    color: #9f1239;
    border-color: #fbcfe8;
}

.iox-meta-chips { 
    margin: 8px 0; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
}

.iox-breadcrumbs { 
    font-size: 11px; 
    color: var(--iox-text-muted); 
    margin-bottom: 8px; 
    font-weight: 500;
}

.iox-breadcrumbs::before {
    content: '';
    margin-right: 6px;
    opacity: 0.6;
}

/* Profile-specific styling */
.iox-stage-search-profile {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
}

/* Profile chips row */
.iox-stage-profile-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.iox-stage-profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f4f4f4;
    text-decoration: none;
    color: #222;
    border: 1px solid #e6e6e6;
}

.iox-stage-profile-chip:hover {
    background: #eee;
}

.iox-stage-profile-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.iox-stage-profile-chip-name {
    font-size: 14px;
    font-weight: 600;
}

/* Event-specific styling */
.iox-stage-search-event {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
}

/* Card grid and cards (for profiles) - single column for row-based cards */
.iox-stage-search-card-grid { 
    display: flex;
    flex-direction: column;
    gap: 12px; 
}

/* Profile cards - compact row-based layout with circle image */
.iox-card { 
    display: flex; 
    flex-direction: row; 
    align-items: center;
    text-decoration: none; 
    background: #fff; 
    border: 1px solid var(--iox-border); 
    border-radius: var(--iox-radius); 
    overflow: hidden; 
    box-shadow: var(--iox-shadow-sm); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    color: inherit; 
    position: relative;
    padding: 16px;
    gap: 16px;
}

.iox-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--iox-primary), #6366f1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iox-card:hover { 
    transform: translateX(4px); 
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.06); 
    border-color: var(--iox-primary);
    background: #fafbfc;
}

.iox-card:hover::before {
    opacity: 1;
}

.iox-card-img { 
    position: relative; 
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0); 
    overflow: hidden;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

.iox-card-img img { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s ease;
}

.iox-card:hover .iox-card-img img {
    transform: scale(1.05);
}

.iox-card-body { 
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Allow text truncation */
}

.iox-card-title { 
    margin: 0; 
    font-size: 18px; 
    font-weight: 700;
    color: var(--iox-text); 
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.iox-card-text { 
    margin: 0; 
    color: var(--iox-text-muted); 
    font-size: 14px; 
    line-height: 1.5; 
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.iox-avatar-placeholder { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.iox-avatar-placeholder .iox-placeholder { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 700; 
    font-size: 48px; 
    color: #fff; 
    background: linear-gradient(135deg, #6366f1, #8b5cf6); 
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Article grid/cards for Pages and Posts */
.iox-article-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 28px; 
}

.iox-article-card { 
    display: flex; 
    flex-direction: column; 
    text-decoration: none; 
    background: #fff; 
    border: 1px solid var(--iox-border); 
    border-radius: var(--iox-radius); 
    overflow: hidden; 
    color: inherit; 
    box-shadow: var(--iox-shadow-sm); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    position: relative;
}

.iox-article-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--iox-primary), #10b981);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.iox-article-card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 8px 16px -8px rgba(0, 0, 0, 0.06); 
    border-color: var(--iox-primary);
}

.iox-article-card:hover::after {
    opacity: 1;
}

.iox-article-card-img { 
    position: relative; 
    width: 100%; 
    padding-top: 56.25%; 
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1); 
    overflow: hidden;
}

.iox-article-card-img img { 
    position: absolute; 
    inset: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.3s ease;
}

.iox-article-card:hover .iox-article-card-img img {
    transform: scale(1.08);
}

.iox-chip-overlay { 
    position: absolute; 
    top: 12px; 
    left: 12px; 
    z-index: 2; 
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.iox-article-card-body { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    flex: 1;
}

.iox-article-card-title { 
    margin: 0; 
    font-size: 20px; 
    font-weight: 700;
    color: var(--iox-text); 
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.iox-article-card-excerpt { 
    margin: 0; 
    color: var(--iox-text-muted); 
    font-size: 15px; 
    line-height: 1.6; 
    flex: 1;
}

.iox-article-card-meta { 
    margin-top: auto;
    padding-top: 12px;
    font-size: 13px; 
    color: var(--iox-text-muted);
    border-top: 1px solid var(--iox-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.iox-article-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.iox-img-placeholder { 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe); 
    position: absolute; 
    inset: 0; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.iox-img-placeholder::before {
    content: '';
    font-size: 48px;
    opacity: 0.5;
}

/* Event/Instance Carousel Styling */
.iox-stage-search-carousel {
    position: relative;
    margin-bottom: 48px;
}

/* Hide the h3 so carousel's own header shows through */
.iox-stage-search-carousel h3 {
    display: none;
}

/* Make carousel container compact and horizontally scrollable */
.iox-stage-search-carousel-content {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 115, 170, 0.3) transparent;
}

/* Custom scrollbar styling */
.iox-stage-search-carousel-content::-webkit-scrollbar {
    height: 8px;
}

.iox-stage-search-carousel-content::-webkit-scrollbar-track {
    background: transparent;
}

.iox-stage-search-carousel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 115, 170, 0.3);
    border-radius: 4px;
}

.iox-stage-search-carousel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 115, 170, 0.5);
}

/* Ensure carousel sections display properly */
.iox-stage-search-carousel-content .bslide-section {
    margin-bottom: 0;
}

/* Make carousel items display in a horizontal row */
.iox-stage-search-carousel-content .bslide-section-content {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    min-width: min-content;
}

/* Compact the carousel cards to a reasonable size */
.iox-stage-search-carousel-content .bslide-card-wrapper {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

/* Style the carousel header to match search theme */
.iox-stage-search-carousel-content .bslide-section-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    padding: 16px 20px;
    border-radius: var(--iox-radius-sm);
    border-left: 4px solid var(--iox-primary);
    margin-bottom: 0;
}

.iox-stage-search-carousel-content .bslide-section-header-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--iox-text);
    display: flex;
    align-items: center;
}

.iox-stage-search-carousel-content .bslide-section-header-text::before {
    content: '';
    margin-right: 10px;
    font-size: 24px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .iox-stage-search-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .iox-stage-search-sidebar {
        order: 2;
    }
    
    .iox-stage-search-main {
        order: 1;
    }
    
    .iox-stage-search-result-item {
        flex-direction: column;
    }
    
    .iox-stage-search-result-thumbnail {
        flex: 0 0 auto;
        margin-right: 0;
        margin-bottom: 15px;
        max-width: 100%;
    }
    
    .iox-stage-search-input {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .iox-stage-search-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .iox-stage-search-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .iox-article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .iox-stage-search-ai-results h3,
    .iox-stage-search-profiles-results h3,
    .iox-stage-search-events-results h3,
    .iox-stage-search-pages-results h3,
    .iox-stage-search-posts-results h3,
    .iox-stage-search-carousel h3 {
        font-size: 20px;
    }
    
    /* Mobile adjustments for carousel */
    .iox-stage-search-carousel-content .bslide-card-wrapper {
        min-width: 240px;
        max-width: 240px;
    }
}

@media (max-width: 480px) {
    .iox-stage-search-input-wrapper {
        flex-direction: column;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .iox-stage-search-input {
        border-right: 1px solid #e0e0e0;
        border-bottom: none;
        border-radius: 8px 8px 0 0;
    }
    
    .iox-stage-search-button {
        border-radius: 0 0 8px 8px;
        padding: 10px 15px;
    }
}

/* Carousel skeleton while loading */
.iox-stage-search-carousel .loading-skeleton {
    min-height: 160px;
    position: relative;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border-radius: var(--iox-radius);
}

.iox-stage-search-carousel .loading-skeleton:after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Smooth fade-in animation for search results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.iox-stage-search-profiles-results,
.iox-stage-search-pages-results,
.iox-stage-search-posts-results,
.iox-stage-search-carousel,
.iox-stage-search-ai-results {
    animation: fadeInUp 0.4s ease-out;
}

/* Stagger animation delays for sequential reveal */
.iox-stage-search-carousel {
    animation-delay: 0s;
}

.iox-stage-search-pages-results {
    animation-delay: 0.1s;
}

.iox-stage-search-profiles-results {
    animation-delay: 0.2s;
}

.iox-stage-search-posts-results {
    animation-delay: 0.1s;
}

.iox-stage-search-ai-results {
    animation-delay: 0s;
}

/* Highlight matched terms in excerpts */
.iox-article-card-excerpt strong,
.iox-card-text strong {
    background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
    color: #92400e;
}

/* Loading state improvements */
.iox-stage-search-loading .iox-stage-search-layout {
    opacity: 0.6;
    pointer-events: none;
}

/* Empty state styling */
.iox-stage-search-no-results {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    border-radius: var(--iox-radius);
    border: 2px dashed var(--iox-border);
}

.iox-stage-search-no-results p {
    font-size: 18px;
    color: var(--iox-text-muted);
    margin: 0;
}

.iox-stage-search-no-results::before {
    content: '';
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}
