/**
 * Guides Search & Snippet Highlighting Styles
 */

/* Top Navigation Search Trigger */
.nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.nav-search-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.nav-search-icon {
    flex-shrink: 0;
    color: #64748b;
}

.nav-search-text {
    font-weight: 500;
}

.nav-search-kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Global Search Modal Backdrop */
.guide-search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.guide-search-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Card */
.guide-search-modal-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: modalSlideDown 0.22s ease-out;
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header & Input */
.search-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.search-modal-icon {
    color: #6366f1;
    flex-shrink: 0;
}

.modal-search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #1e1b4b;
    font-family: inherit;
    background: transparent;
}

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

.search-clear-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 9999px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s;
}

.search-clear-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.search-close-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.search-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Suggestion / Quick Topic Chips */
.search-topic-chips {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}

.topic-chip-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}

.topic-chip {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.topic-chip:hover {
    background: #e0e7ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

/* Status Bar */
.search-modal-status {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    color: #64748b;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 500;
}

/* AI Summary Box */
.search-ai-summary {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin: 0.75rem 1.25rem 0;
}

.ai-summary-badge {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.ai-summary-text {
    font-size: 0.875rem;
    color: #0f172a;
    line-height: 1.5;
}

/* Results List */
.search-results-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* Result Card */
.search-result-card {
    display: flex;
    flex-direction: column;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.search-result-card:hover,
.search-result-card.selected {
    border-color: #6366f1;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.search-result-card.selected {
    outline: 2px solid #6366f1;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    flex-wrap: wrap;
}

.result-guide-title {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}

.badge-current-page {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
}

.result-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.result-section-icon {
    color: #6366f1;
    font-weight: 800;
}

.result-snippet {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

mark.search-highlight {
    background: #fef08a;
    color: #713f12;
    font-weight: 600;
    padding: 1px 3px;
    border-radius: 3px;
}

.result-action {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4f46e5;
}

.result-arrow {
    transition: transform 0.15s;
}

.search-result-card:hover .result-arrow {
    transform: translateX(3px);
}

/* Empty State */
.search-empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.35rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: #64748b;
    max-width: 440px;
    margin: 0 auto;
}

/* Modal Footer */
.search-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-modal-footer kbd {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-weight: 600;
    color: #334155;
    font-family: inherit;
}

/* In-Page Snippet Highlighting */
mark.guide-snippet-highlight {
    background: #fef08a;
    color: #713f12;
    padding: 2px 4px;
    border-radius: 4px;
    border-bottom: 2px solid #eab308;
    display: inline;
    animation: guideSnippetPulse 2s ease-in-out;
}

@keyframes guideSnippetPulse {
    0% {
        background: #fde047;
        box-shadow: 0 0 12px rgba(234, 179, 8, 0.7);
    }
    50% {
        background: #fef08a;
        box-shadow: 0 0 18px rgba(234, 179, 8, 0.5);
    }
    100% {
        background: #fef08a;
        box-shadow: none;
    }
}

/* Dismissible Floating Highlight Banner */
.guide-highlight-bar {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e1b4b;
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: 9999px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: highlightBarSlideUp 0.3s ease-out;
}

@keyframes highlightBarSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.highlight-bar-icon {
    font-size: 1rem;
}

.highlight-bar-text {
    color: #e0e7ff;
}

.highlight-bar-text strong {
    color: #ffffff;
}

.highlight-bar-clear {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #ffffff;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.highlight-bar-clear:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* Hub Page Section Snippets Grid */
.hub-search-snippets {
    margin: 1.5rem 0 2.5rem 0;
    background: #ffffff;
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.hub-snippets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 1rem;
}

.hub-snippets-toggle {
    background: #f1f5f9;
    border: none;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
}

.hub-snippets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.hub-snippet-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
}

.hub-snippet-card:hover {
    background: #ffffff;
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.hub-snippet-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.hub-snippet-guide {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.hub-snippet-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 0.35rem;
}

.hub-snippet-text {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.45;
    flex-grow: 1;
    margin-bottom: 0.75rem;
}

.hub-snippet-action {
    font-size: 0.8rem;
    font-weight: 600;
    color: #4f46e5;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-search-kbd {
        display: none;
    }
    .nav-search-btn {
        padding: 0.35rem 0.65rem;
    }
    .guide-search-modal-backdrop {
        padding: 1rem;
    }
    .guide-search-modal-card {
        max-height: 90vh;
    }
    .search-topic-chips {
        padding: 0.5rem 1rem;
    }
    .guide-highlight-bar {
        width: 90%;
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}
