/* FCA Global Search - Search Results Page Styles */

/* Search Page Container */
.fca-search-page {
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
    height: calc(100vh - var(--fcom-header-height, 65px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Search Header - Matching Fluent Community Style */
.fca-search-header.fhr_content_layout_header {
    background: var(--fcom-primary-bg, #FFFFFF);
    border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
    padding: 16px 24px;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.fca-search-header h1.fcom_page_title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fca-search-header .fcom_shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--fcom-highlight-bg, #E7F3FF);
    border-radius: 50%;
}

.fca-search-header .fcom_shape .el-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    color: var(--fcom-text-link, #216FDB);
}

.fca-search-header .fcom_shape svg {
    width: 100%;
    height: 100%;
}

/* Search Input in Header */
.fca-search-input-wrapper {
    flex: 1;
    max-width: 500px;
    margin: 0;
    position: relative;
}

.fca-search-form-large {
    position: relative;
    width: 100%;
}

.fca-search-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--fcom-secondary-text, #65676B);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fca-search-input-large {
    width: 100%;
    padding: 10px 44px 10px 42px;
    border: 1px solid var(--fcom-secondary-border, #CED0D4);
    border-radius: 8px;
    background: var(--fcom-secondary-bg, #F0F2F5);
    color: var(--fcom-primary-text, #19283a);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.fca-search-input-large:focus {
    border-color: var(--fcom-text-link, #216FDB);
    background: var(--fcom-primary-bg, #FFFFFF);
}

.fca-search-input-large::placeholder {
    color: var(--fcom-text-off, #8A8D91);
}

.fca-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--fcom-secondary-text, #65676B);
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.fca-clear-search:hover,
.fca-clear-search:focus {
    background-color: var(--fcom-highlight-bg, #E7F3FF);
    color: var(--fcom-text-link, #216FDB);
}

.fca-clear-search svg {
    width: 16px;
    height: 16px;
}

/* Results Badge */
.fca-search-results-badge {
    flex-shrink: 0;
    background: var(--fcom-primary-button, #1877F2);
    color: var(--fcom-primary-button-text, #FFFFFF);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.9em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fca-results-count {
    font-weight: 600;
}

.fca-search-results-badge.fca-badge-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Hide results badge on mobile to reduce cramming */
    .fca-search-results-badge {
        display: none;
    }
    
    /* Stack sidebar and results vertically on mobile */
    .fca-search-container {
        flex-direction: column;
    }
    
    .fca-search-sidebar {
        width: 100%;
        max-width: none;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
    }
    
    .fca-search-results {
        padding: 16px;
        gap: 20px;
    }
    
    .fca-search-header {
        padding: 20px 16px 16px;
    }
    
    .fca-search-input-wrapper {
        max-width: 100%;
        margin: 0 0 20px 0;
    }
    
    /* Mobile search form adjustments */
    .fca-search-form-large {
        width: 100%;
    }
    
    .fca-search-input-large {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Hide duplicate magnifying glass icon on mobile */
    .fca-search-icon-left {
        display: none;
    }
    
    .fca-search-input-large {
        padding-left: 12px; /* Adjust padding since icon is hidden */
    }
}

/* Main Container - Two Column Layout */
.fca-search-container {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

/* Left Sidebar - 30% */
.fca-search-sidebar {
    width: 30%;
    max-width: 280px;
    min-width: 220px;
    background: var(--fcom-primary-bg, #FFFFFF);
    border-right: 1px solid var(--fcom-primary-border, #E4E7EB);
    overflow-y: auto;
    flex-shrink: 0;
}

.fca-search-filters {
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fca-filter-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-left: 3px solid transparent;
    text-align: left;
    font-size: 14px;
    color: var(--fcom-menu-text, #65676B);
    font-weight: 500;
}

.fca-filter-icon {
    width: 25px;
    height: 25px;
    color: var(--fcom-primary-bg, #FFFFFF);
    flex-shrink: 0;
    border-radius: 50%;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fca-filter-icon svg {
    width: 15px;
    height: 15px;
    max-width: 15px;
    max-height: 15px;
}

/* Override inline stroke-width attributes to make all icons thin like All Results */
.fca-filter-icon svg path,
.fca-filter-icon svg line,
.fca-filter-icon svg rect,
.fca-filter-icon svg circle {
    stroke-width: 2 !important;
}

.fca-filter-button:hover {
    background: var(--fcom-secondary-bg, #F0F2F5);
    color: var(--fcom-primary-text, #19283a);
}

.fca-filter-button.active {
    background: var(--fcom-highlight-bg, #E7F3FF);
    border-left-color: var(--fcom-text-link, #216FDB);
    color: var(--fcom-text-link, #216FDB);
    font-weight: 600;
}

/* All Results button background */
.fca-filter-icon-all {
    background-color: var(--fcom-text-link, #216FDB);
}

/* Custom Color Palette Variables */
:root {
    --fca-color-primary: #455bff;
    --fca-color-secondary: #9da1ff;
    --fca-color-warning: #f9bf38;
    --fca-color-success: #f97316;
    --fca-color-danger: #f16e7c;
    --fca-color-info: #00d1d8;
    --fca-color-accent: #ef56a0;
    --fca-color-posts: #ad45ff;
    --fca-color-blogs: #10b981;
}

/* Filter Icon Badge Colors - Background Style */
.fca-filter-icon-spaces {
    background-color: var(--fca-color-warning, #f9bf38);
}

.fca-filter-icon-courses {
    background-color: var(--fca-color-success, #87f677);
}

.fca-filter-icon-members {
    background-color: var(--fca-color-info, #00d1d8);
}

.fca-filter-icon-comments {
    background-color: var(--fca-color-secondary, #9da1ff);
}

.fca-filter-icon-lessons {
    background-color: var(--fca-color-accent, #ef56a0);
}

.fca-filter-icon-posts {
    background-color: var(--fca-color-posts, #ad45ff);
}

.fca-filter-icon-events {
    background-color: var(--fca-color-danger, #f16e7c);
}

.fca-filter-icon-blogs {
    background-color: var(--fca-color-blogs, #10b981);
}

.fca-filter-label {
    flex: 1;
}

.fca-filter-count {
    background: var(--fcom-secondary-bg, #F0F2F5);
    color: var(--fcom-secondary-text, #65676B);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.85em;
    min-width: 24px;
    text-align: center;
}

.fca-filter-button.active .fca-filter-count {
    background: var(--fcom-text-link, #216FDB);
    color: var(--fcom-primary-button-text, #FFFFFF);
}

/* Right Main Area - 70% */
.fca-search-main {
    flex: 1;
    overflow-y: auto;
    background: var(--fcom-secondary-bg, #F0F2F5);
}

/* Search Results */
.fca-search-results {
    padding: 24px;
    display: grid;
    gap: 32px; /* More breathing room between sections */
    background: var(--fcom-secondary-bg, #F0F2F5);
}

/* Results Section */
.fca-search-section {
    background: var(--fcom-primary-bg, #FFFFFF);
    border: 1px solid var(--fcom-primary-border, #E4E7EB);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

/* Section Header */
.fca-search-section-header {
    background: var(--fcom-secondary-bg, #F0F2F5);
    padding: 14px 18px;
    border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fca-search-section-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fca-search-section-icon {
    width: 18px;
    height: 18px;
    color: var(--fcom-secondary-text, #65676B);
}

.fca-search-section-count {
    background: var(--fcom-primary-button, #1877F2);
    color: var(--fcom-primary-button-text, #FFFFFF);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Section Content */
.fca-search-section-content {
    padding: 0;
    background: var(--fcom-primary-bg, #FFFFFF);
}

/* Individual Result Item */
.fca-search-result-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
    cursor: pointer;
    transition: background-color 0.15s ease;
    background: var(--fcom-primary-bg, #FFFFFF);
}

.fca-search-result-item:last-child {
    border-bottom: none;
}

.fca-search-result-item:hover {
    background-color: var(--fcom-highlight-bg, #E7F3FF);
}

.fca-search-result-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.fca-search-result-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.fca-search-result-text {
    flex: 1;
    min-width: 0;
}

.fca-search-result-title {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.fca-search-result-title:hover {
    color: var(--fcom-text-link, #216FDB);
}

.fca-search-result-excerpt {
    font-size: 0.85em;
    color: var(--fcom-secondary-text, #65676B);
    margin: 0 0 4px 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fca-search-result-meta {
    font-size: 0.8em;
    color: var(--fcom-text-off, #8A8D91);
    margin: 0;
}

/* No Results State */
.fca-no-results {
    padding: 60px 20px;
    text-align: center;
}

.fca-no-results-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--fcom-secondary-text, #65676B);
    opacity: 0.5;
}

.fca-no-results-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    margin: 0 0 8px 0;
}

.fca-no-results-text {
    color: var(--fcom-secondary-text, #65676B);
    margin: 0;
}

/* Loading State */
.fca-search-loading {
    padding: 60px 20px;
    text-align: center;
}

.fca-search-loading-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--fcom-text-link, #216FDB);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Welcome State */
.fca-search-welcome {
    padding: 80px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.fca-search-welcome-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    color: var(--fcom-text-link, #216FDB);
    opacity: 0.7;
}

.fca-search-welcome-title {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--fcom-primary-text, #19283a);
    margin: 0 0 12px 0;
}

.fca-search-welcome-text {
    font-size: 1em;
    color: var(--fcom-secondary-text, #65676B);
    margin: 0 0 8px 0;
    max-width: 400px;
}

.fca-search-welcome-hint {
    font-size: 0.9em;
    color: var(--fcom-text-off, #8A8D91);
    margin: 0;
}

/* Sidebar Empty State */
.fca-search-sidebar-empty {
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    background: var(--fcom-primary-bg, #FFFFFF);
}

.fca-sidebar-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--fcom-text-off, #8A8D91);
    opacity: 0.5;
}

.fca-sidebar-empty-text {
    font-size: 0.9em;
    color: var(--fcom-text-off, #8A8D91);
    margin: 0;
    text-align: center;
}

/* Content Type Icons */
.fca-result-icon-posts {
    color: var(--fca-color-posts, #ad45ff);
}

.fca-result-icon-comments {
    color: var(--fca-color-secondary, #9da1ff);
}

.fca-result-icon-spaces {
    color: var(--fca-color-warning, #f9bf38);
}

.fca-result-icon-courses {
    color: var(--fca-color-success, #87f677);
}

.fca-result-icon-lessons {
    color: var(--fca-color-accent, #ef56a0);
}

.fca-result-icon-members {
    color: var(--fca-color-info, #00d1d8);
}

.fca-result-icon-events {
    color: var(--fca-color-danger, #f16e7c);
}

.fca-result-icon-blogs {
    color: var(--fca-color-blogs, #10b981);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .fca-search-section {
        background: var(--fcom-deep-bg, #18191A);
        border-color: var(--fcom-primary-border, #3A3B3C);
    }

    .fca-search-section-header {
        background: var(--fcom-secondary-bg, #242526);
        border-color: var(--fcom-primary-border, #3A3B3C);
    }

    .fca-search-result-item {
        background: var(--fcom-primary-bg, #18191A);
        border-bottom-color: var(--fcom-primary-border, #3A3B3C);
    }

    .fca-search-result-item:hover {
        background-color: rgba(24, 119, 242, 0.1);
    }

    .fca-search-input-large {
        background: var(--fcom-secondary-bg, #242526);
        border-color: var(--fcom-primary-border, #3A3B3C);
        color: var(--fcom-primary-text, #E4E6EA);
    }
    
    .fca-search-input-large:focus {
        background-color: var(--fcom-primary-bg, #18191A);
        border-color: var(--fcom-text-link, #216FDB);
    }

    .fca-no-results-title,
    .fca-search-result-title {
        color: var(--fcom-primary-text, #E4E6EA);
    }

    .fca-search-result-excerpt,
    .fca-search-result-meta {
        color: var(--fcom-secondary-text, #B0B3B8);
    }

    .fca-search-sidebar {
        background: var(--fcom-deep-bg, #18191A);
        border-color: var(--fcom-primary-border, #3A3B3C);
    }

    .fca-search-main {
        background: var(--fcom-secondary-bg, #242526);
    }
    
    /* Search results container dark mode */
    .fca-search-results {
        background: var(--fcom-secondary-bg, #242526);
    }
    
    /* Search section content dark mode */
    .fca-search-section-content {
        background: var(--fcom-primary-bg, #18191A);
    }
    
    /* Mobile filter bar dark mode */
    .fca-search-filters {
        background: var(--fcom-primary-bg, #18191A);
        border-bottom-color: var(--fcom-primary-border, #3A3B3C);
    }
    
    /* Sidebar empty state dark mode */
    .fca-search-sidebar-empty {
        background: var(--fcom-primary-bg, #18191A);
    }
    
    .fca-sidebar-empty-icon {
        color: var(--fcom-text-off, #8A8D91);
    }
    
    .fca-sidebar-empty-text {
        color: var(--fcom-text-off, #8A8D91);
    }
    
    /* Welcome state dark mode */
    .fca-search-welcome {
        background: var(--fcom-secondary-bg, #242526);
    }
    
    .fca-search-welcome-title {
        color: var(--fcom-primary-text, #E4E6EA);
    }
    
    .fca-search-welcome-text {
        color: var(--fcom-secondary-text, #B0B3B8);
    }
    
    .fca-search-welcome-hint {
        color: var(--fcom-text-off, #8A8D91);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fca-search-container {
        flex-direction: column;
    }

    .fca-search-sidebar {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
        overflow-y: visible;
        max-height: none;
    }

    .fca-search-filters {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px 16px;
        gap: 8px;
        background: var(--fcom-primary-bg, #FFFFFF);
        border-bottom: 1px solid var(--fcom-primary-border, #E4E7EB);
    }

    .fca-filter-button {
        flex-shrink: 0;
        padding: 8px 14px;
        border-left: none;
        border-radius: 20px;
        white-space: nowrap;
    }

    .fca-filter-button.active {
        background: var(--fcom-text-link, #216FDB);
        color: var(--fcom-primary-button-text, #FFFFFF);
    }

    .fca-filter-button.active .fca-filter-count {
        background: rgba(255, 255, 255, 0.2);
        color: var(--fcom-primary-button-text, #FFFFFF);
    }

    .fca-search-header.fhr_content_layout_header {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 12px;
    }

    .fca-search-header h1.fcom_page_title {
        font-size: 1.2em;
    }

    .fca-search-input-wrapper {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }

    .fca-search-results {
        padding: 16px;
        gap: 16px;
    }

    .fca-search-result-item {
        padding: 12px 14px;
        margin-bottom: 0;
    }
    
    .fca-search-section {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .fca-search-header h1.fcom_page_title span:last-child {
        display: none;
    }

    .fca-search-result-title {
        font-size: 0.9em;
    }

    .fca-search-result-excerpt {
        font-size: 0.8em;
    }
}