/**
 * Universal Search Component Styles - Combined Quick & Full Modes
 */

/* =================================================================
   QUICK MODE STYLES
   ================================================================= */

/* Search Container */
.universal-search-quick-component {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 20px;
}

.search-container {
    position: relative;
}

/* Search Input */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.universal-search-quick-component .universal-search-input {
    width: 100%;
    padding: 14px 50px 14px 50px;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.universal-search-quick-component .universal-search-input:focus {
    border-color: #552988 !important;
    outline: 2px solid #552988;
    outline-offset: -1px;
    box-shadow: 0 0 0 4px rgba(85, 41, 136, 0.2), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.universal-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-icon,
.search-spinner {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
    pointer-events: none;
}

.search-spinner {
    color: #552988;
}

/* Quick Results - Inline Design */
.quick-search-results {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: none;
    max-height: 420px;
    overflow-y: auto;
    margin-top: 16px;
}

/* When results are shown, they appear inline */
.search-container.has-results .quick-search-results {
    display: block;
}

/* Also show if there's content regardless of class (fallback) */
.quick-search-results:not(:empty) {
    display: block;
}

.quick-results-dropdown {
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    min-height: 50px;
}

/* Quick Result Items */
.quick-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    gap: 14px;
    border-bottom: 1px solid #f0f0f0;
}

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

.quick-result-item:hover,
.quick-result-item.selected {
    background-color: #f8f9fa;
}

.quick-result-item:focus {
    outline: none;
    background-color: #f0f4f8;
}

.quick-result-item .result-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: #f5f6f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #552988;
}

.quick-result-item:hover .result-icon {
    background-color: #f0ebf7;
}

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

.quick-result-item .result-title {
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 2px;
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quick-result-item .result-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.quick-result-item .result-type {
    flex-shrink: 0;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    padding: 4px 8px;
    background-color: #f5f6f7;
    border-radius: 4px;
}

/* View All Link */
.view-all-results {
    border-top: 1px solid #e5e5e5;
    background-color: #fafbfc;
    border-radius: 0 0 8px 8px;
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #552988;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 16px;
    transition: all 0.15s ease;
    gap: 8px;
    cursor: pointer;
}

.view-all-link:hover {
    background-color: #f5f6f7;
    color: #3d1e5f;
}

.view-all-link i {
    font-size: 12px;
}

/* No Results */
.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    background-color: #fafbfc;
    border-radius: 8px;
}

.no-results i {
    font-size: 36px;
    color: #ddd;
    margin-bottom: 12px;
}

.no-results p {
    margin: 0;
    font-size: 15px;
    color: #666;
}

/* Loading State */
.quick-results-loading {
    padding: 25px 20px;
    text-align: center;
    color: #666;
    background-color: #fafbfc;
    border-radius: 8px;
}

.quick-results-loading i {
    font-size: 20px;
    color: #552988;
    margin-bottom: 10px;
}

/* Custom Scrollbar for Results */
.quick-search-results::-webkit-scrollbar {
    width: 6px;
}

.quick-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.quick-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.quick-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* =================================================================
   FULL MODE STYLES - Traditional Google-like Search Results
   ================================================================= */

/* Main Container */
.universal-search-component {
    width: 100%;
}

/* Search Bar Section */
.search-bar-section {
    padding: 30px 0;
    margin-bottom: 20px;
}

.search-form {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
}

@media (max-width: 640px) {
    .search-bar-section {
        padding: 20px 0;
    }
    
    .search-form {
        padding: 0;
    }
}

.search-form .search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-form .universal-search-input {
    width: 100%;
    padding: 14px 50px;
    font-size: 16px;
    font-weight: 400;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-form .universal-search-input:focus {
    border-color: #552988 !important;
    outline: 2px solid #552988;
    outline-offset: -1px;
    box-shadow: 0 0 0 4px rgba(85, 41, 136, 0.2), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.search-form .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
    pointer-events: none;
}

.search-form .search-spinner {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #552988;
    font-size: 18px;
    display: none;
}

/* Hide search button in full mode - we'll use automatic search */
.search-button {
    display: none;
}

/* Search Results Page - Full Width Style */
.search-results-page {
    width: 100%;
    max-width: 100%;
    padding: 0 20px 40px;
}

@media (max-width: 640px) {
    .search-results-page {
        padding: 0 0 40px;
    }
}

.universal-search-box-wrapper .results-header {
    margin-bottom: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #ebebeb;
}

.results-header h1 {
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 8px;
    color: #70757a;
}

.search-query {
    font-size: 14px;
    color: #70757a;
}

.search-query strong {
    color: #202124;
    font-weight: normal;
}

/* Results Sections - Contained Width */
.results-section {
    max-width: 800px;
    margin: 0 auto 40px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #552988;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.section-title i {
    font-size: 1.125rem;
}

.section-title .result-count {
    font-size: 1rem;
    font-weight: normal;
    color: #6b7280;
    margin-left: auto;
}

/* Result Items - Matching Quick Mode Style */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

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

.result-item:hover {
    background-color: #f8f9fa;
    transform: none;
    box-shadow: none;
}

/* Result Icon */
.result-item .result-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background-color: #f5f6f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #552988;
}

.result-item:hover .result-icon {
    background-color: #f0ebf7;
}

/* Result Content */
.result-item .result-content {
    flex: 1;
    min-width: 0;
}

.result-item .result-title {
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 2px;
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-item .result-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-item .result-title a:hover {
    color: #552988;
}

.result-item .result-description {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.result-item .result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #999;
}

.result-url {
    color: #006621;
    font-size: 14px;
    font-family: Verdana, sans-serif;
}

.result-item .result-type {
    flex-shrink: 0;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    padding: 4px 8px;
    background-color: #f5f6f7;
    border-radius: 4px;
}

.result-date {
    margin-left: 0;
}

/* Only show separator if there are multiple elements in meta */
.result-meta > *:not(:first-child)::before {
    content: "·";
    margin: 0 8px;
}

/* Remove the old blanket rule */
.result-date::before {
    display: none;
}

/* Pagination - Google Style */
.pagination-wrapper {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: block;
    padding: 0;
    margin: 0 3px;
    text-decoration: none;
    color: #552988;
    border: none;
    border-radius: 0;
    transition: none;
    font-size: 14px;
    font-family: Verdana, sans-serif;
    line-height: 40px;
    width: 40px;
    height: 40px;
    text-align: center;
}

.pagination a:hover {
    background-color: transparent;
    border-color: transparent;
    text-decoration: underline;
}

.pagination .active span {
    background-color: transparent;
    color: #202124;
    border: none;
    font-weight: bold;
    text-decoration: none;
}

.pagination .disabled span {
    color: #70757a;
    cursor: not-allowed;
}

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

.no-results-message i {
    font-size: 48px;
    color: #d0d0d0;
    margin-bottom: 20px;
    display: block;
}

.no-results-message h3 {
    font-size: 24px;
    color: #202124;
    margin-bottom: 12px;
    font-weight: 500;
}

.no-results-message p {
    font-size: 16px;
    color: #70757a;
    margin-bottom: 0;
}

.browse-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.browse-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #552988;
    transition: all 0.2s ease;
}

.browse-link:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Empty Search State */
.empty-search {
    text-align: center;
    padding: 60px 20px;
}

.empty-search i {
    font-size: 48px;
    color: #d0d0d0;
    margin-bottom: 20px;
    display: block;
}

.empty-search h3 {
    font-size: 24px;
    color: #202124;
    margin-bottom: 12px;
    font-weight: 500;
}

.empty-search p {
    font-size: 16px;
    color: #70757a;
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Quick Mode Responsive */
    .universal-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .quick-search-results {
        margin-top: 12px;
        max-height: 300px;
    }

    .quick-result-item {
        padding: 10px 12px;
    }

    .quick-result-item .result-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .quick-result-item .result-title {
        font-size: 14px;
    }

    .quick-result-item .result-description {
        font-size: 12px;
    }

    .quick-result-item .result-type {
        font-size: 10px;
        padding: 3px 6px;
    }

    /* Full Mode Responsive */
    .search-bar-section {
        padding: 20px 0;
        margin-bottom: 30px;
    }

    .search-form .universal-search-input {
        font-size: 16px;
        padding: 14px 50px 14px 45px;
    }

    .search-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .results-header h1 {
        font-size: 14px;
    }

    .search-query {
        font-size: 13px;
    }

    .result-item .result-title {
        font-size: 18px;
    }

    .result-item .result-description {
        font-size: 13px;
    }

    .result-item .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 12px;
    }

    .result-date {
        margin-left: 0;
    }

    .browse-links {
        flex-direction: column;
        align-items: center;
    }

    .browse-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}
