/*
Happy Dog Trading - Search Styles
*/

/* Quick Search Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.search-dropdown.show {
    display: block;
}

.search-dropdown-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.search-dropdown-item:hover,
.search-dropdown-item.active {
    background-color: #f8f9fa;
}

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

.search-dropdown-title {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    display: block;
}

.search-dropdown-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.search-dropdown-meta {
    font-size: 0.75rem;
    color: #adb5bd;
}

.search-dropdown-footer {
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.search-dropdown-footer a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.875rem;
}

.search-dropdown-footer a:hover {
    text-decoration: underline;
}

/* Navbar Search */
.navbar-search {
    position: relative;
    width: 300px;
    max-width: 100%;
}

.navbar-search .form-control {
    border-radius: 20px;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.navbar-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    z-index: 5;
}

.navbar-search .search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    display: none;
    z-index: 5;
}

.navbar-search .search-clear:hover {
    color: #6c757d;
}

.navbar-search .search-clear.show {
    display: block;
}

/* Search Results */
.search-result-item {
    transition: transform 0.15s ease-in-out;
}

.search-result-item:hover {
    transform: translateY(-2px);
}

.search-result-item .card {
    border: 1px solid #e9ecef;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-result-item:hover .card {
    border-color: #0d6efd;
    box-shadow: 0 0.125rem 0.5rem rgba(13, 110, 253, 0.15);
}

.search-result-item .card-title a {
    color: #0d6efd;
    transition: color 0.15s ease-in-out;
}

.search-result-item .card-title a:hover {
    color: #0a58ca;
}

/* Content Type Badges */
.badge.bg-label-secondary {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6;
}

/* Advanced Search Form */
.advanced-search-form {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Search Loading State */
.search-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.search-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar-search {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .search-dropdown {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        max-height: 300px;
    }
    
    .search-result-item:hover {
        transform: none;
    }
}

/* Dark Mode Support */
.dark-style .search-dropdown {
    background: #2b2c40;
    border-color: #444564;
}

.dark-style .search-dropdown-item {
    border-color: #444564;
}

.dark-style .search-dropdown-item:hover,
.dark-style .search-dropdown-item.active {
    background-color: #32334a;
}

.dark-style .search-dropdown-title {
    color: #a7a9c2;
}

.dark-style .search-dropdown-description {
    color: #8688a3;
}

.dark-style .search-dropdown-meta {
    color: #686a82;
}

.dark-style .search-dropdown-footer {
    background-color: #32334a;
    border-color: #444564;
}

.dark-style .navbar-search .form-control {
    background-color: #2b2c40;
    border-color: #444564;
    color: #a7a9c2;
}

.dark-style .navbar-search .form-control:focus {
    background-color: #2b2c40;
    border-color: #696cff;
    color: #a7a9c2;
    box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.25);
}

/* Search Suggestions */
.search-suggestions {
    margin-top: 1rem;
}

.search-suggestions .suggestion-item {
    display: inline-block;
    margin: 0.25rem 0.5rem 0.25rem 0;
    padding: 0.375rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
}

.search-suggestions .suggestion-item:hover {
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
}

/* Search Highlighting */
.search-dropdown-description mark,
.search-result-item mark {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
    font-weight: 500;
}

.dark-style .search-dropdown-description mark,
.dark-style .search-result-item mark {
    background-color: #664d03;
    color: #ffecb5;
}