/* Search Modal Styling */
#searchModal .modal-dialog {
    margin-top: 10vh;
}

#searchModal .list-group-item {
    border-left: none;
    border-right: none;
    border-radius: 0;
    transition: background-color 0.15s ease;
}

#searchModal .list-group-item:hover {
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}

#searchModal .list-group-item:first-child {
    border-top: none;
}

#searchModal .list-group-item:last-child {
    border-bottom: none;
}

/* Search input focus styling */
#searchInput:focus {
    border: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Item icon styling in search results */
#searchResults .list-group-item img {
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 2px;
}

/* Clear search button */
#clearSearchBtn {
    background: none !important;
    border: none !important;
    padding: 0.25rem !important;
    line-height: 1;
    color: var(--bs-secondary) !important;
    text-decoration: none !important;
}

#clearSearchBtn:hover {
    color: var(--bs-danger) !important;
    transform: scale(1.1);
    transition: all 0.15s ease;
}

#clearSearchBtn:focus {
    box-shadow: 0 0 0 0.125rem rgba(220, 53, 69, 0.25) !important;
}

/* Responsive close button - hide on desktop (768px+), show on mobile */
@media (min-width: 768px) {
    .modal-close-mobile-only {
        display: none !important;
    }
}

/* Make sure it's visible and accessible on mobile */
@media (max-width: 767px) {
    .modal-close-mobile-only {
        display: block !important;
    }
}

/* Screen reader only text */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators for keyboard navigation */
#searchModal .list-group-item:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    z-index: 1;
}

/* High contrast focus for clear button */
#clearSearchBtn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Loading skeleton styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-item {
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
}

.skeleton-icon {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    margin-right: 8px;
    flex-shrink: 0;
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.skeleton-text.wide {
    width: 60%;
}

.skeleton-text.narrow {
    width: 40%;
    height: 12px;
}

.skeleton-category {
    height: 14px;
    width: 80px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Dark mode skeleton (optional - adapts to Bootstrap themes) */
[data-bs-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2d3748 25%, #4a5568 50%, #2d3748 75%);
    background-size: 200% 100%;
}

/* Search history styles */
.search-history-item {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-history-item:hover {
    background-color: var(--bs-light);
}

.search-history-item .history-text {
    flex-grow: 1;
    color: var(--bs-secondary);
}

.search-history-item .history-icon {
    color: var(--bs-secondary);
    font-size: 0.875rem;
    margin-right: 8px;
}

.search-history-item .remove-history {
    opacity: 0;
    transition: opacity 0.15s ease;
    color: var(--bs-danger);
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 2px;
}

.search-history-item:hover .remove-history {
    opacity: 1;
}

.search-history-item .remove-history:hover {
    background-color: var(--bs-danger-bg-subtle);
}

.search-history-header {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0 12px;
}

.search-history-clear {
    font-size: 0.75rem;
    color: var(--bs-primary);
    cursor: pointer;
    text-decoration: underline;
}

.search-history-clear:hover {
    color: var(--bs-primary-dark);
}

/* Placeholder suggestion animation */
#searchInput::placeholder {
    transition: opacity 0.3s ease;
}

.placeholder-fade-out {
    opacity: 0 !important;
}

.placeholder-fade-in {
    opacity: 1 !important;
}

/* No results styling */
.popular-search-tag {
    cursor: pointer;
    transition: all 0.15s ease;
}

.popular-search-tag:hover {
    background-color: var(--bs-primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cursor-pointer {
    cursor: pointer;
}

/* Enhanced alert styling */
.alert-info.bg-primary.bg-opacity-10 {
    border-left: 3px solid var(--bs-primary);
}