/* ================================================
   SITE SEARCH - Search Bar & Results
   Modern search with live results and keyboard navigation
   ================================================ */

/* ==========================================
   BREADCRUMBS SEARCH BAR
   ========================================== */

.breadcrumbs-search {
    width: 280px;
    max-width: 100%;
    position: relative;
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: #64748b;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    color: #1e293b;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    outline: none;
    border-color: #f97316;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* ==========================================
   SEARCH OVERLAY
   ========================================== */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   SEARCH RESULTS CONTAINER
   ========================================== */

.breadcrumbs-search {
    position: relative;
}

.search-results-container {
    position: fixed;
    width: 450px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.search-results-container.show {
    pointer-events: auto;
}

.search-results-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Custom Scrollbar */
.search-results-container::-webkit-scrollbar {
    width: 8px;
}

.search-results-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0 1rem 1rem 0;
}

.search-results-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.search-results-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================
   SEARCH RESULT ITEMS
   ========================================== */

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.search-result-item:first-child {
    border-radius: 1rem 1rem 0 0;
}

.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 1rem 1rem;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(249, 115, 22, 0.05);
}

.search-result-item.selected {
    border-left: 3px solid #f97316;
}

.search-result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 0.5rem;
    color: #f97316;
}

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

.search-result-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-title mark {
    background: rgba(249, 115, 22, 0.2);
    color: #ea580c;
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.search-result-category {
    font-weight: 500;
    color: #f97316;
}

.search-result-category::after {
    content: "•";
    margin-left: 0.5rem;
    color: #cbd5e1;
}

.search-result-description {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-arrow {
    flex-shrink: 0;
    color: #cbd5e1;
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
}

.search-result-item:hover .search-result-arrow,
.search-result-item.selected .search-result-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #f97316;
}

/* ==========================================
   NO RESULTS STATE
   ========================================== */

.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: #64748b;
}

.search-no-results i {
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.search-no-results p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.search-no-results strong {
    color: #1e293b;
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
    .breadcrumbs-search {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .breadcrumbs-search {
        margin-bottom: 0.5rem;
    }

    .search-input {
        font-size: 0.875rem;
        padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    }

    .search-icon {
        left: 0.875rem;
        width: 16px;
        height: 16px;
    }

    .search-results-container {
        position: static;
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        margin-bottom: 1rem;
        transform: none;
    }

    .search-results-container.show {
        transform: none;
    }

    .search-result-item {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }

    .search-result-icon {
        width: 36px;
        height: 36px;
    }

    .search-result-title {
        font-size: 0.875rem;
    }

    .search-result-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .search-input {
        padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    }

    .search-icon {
        left: 0.75rem;
    }

    .search-results-container {
        width: 100%;
        border-radius: 0.75rem;
    }

    .search-result-item {
        padding: 0.75rem 0.875rem;
    }

    .search-result-icon {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================
   KEYBOARD NAVIGATION HINTS
   ========================================== */

.search-result-item:focus {
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-container.show {
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   DARK MODE SUPPORT (optional)
   ========================================== */

@media (prefers-color-scheme: dark) {
    .search-input {
        background: rgba(30, 41, 59, 0.9);
        color: #e2e8f0;
        border-color: rgba(100, 116, 139, 0.3);
    }

    .search-input::placeholder {
        color: #64748b;
    }

    .search-results-container {
        background: #1e293b;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    }

    .search-result-item {
        border-bottom-color: #334155;
    }

    .search-result-item:hover,
    .search-result-item.selected {
        background: rgba(249, 115, 22, 0.1);
    }

    .search-result-title {
        color: #f1f5f9;
    }

    .search-result-meta {
        color: #94a3b8;
    }

    .search-no-results {
        color: #94a3b8;
    }

    .search-no-results strong {
        color: #f1f5f9;
    }
}
