.global-search-container {
    position: relative;
    width: 400px;
}

.global-search-input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 2.5rem;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.global-search-input:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
    outline: none;
}

.global-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #858796;
    pointer-events: none;
}

.global-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #858796;
    cursor: pointer;
    font-size: 0.875rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 5;
}

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

.global-search-clear:hover {
    background-color: #e74a3b;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.global-search-clear:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(231, 74, 59, 0.25);
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d1d3e2;
    border-radius: 0.35rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    margin-top: 0.25rem;
}

.global-search-results.show {
    display: block;
}

.search-category {
    border-bottom: 1px solid #e3e6f0;
}

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

.search-category-header {
    padding: 0.5rem 1rem;
    background: #f8f9fc;
    font-weight: 600;
    font-size: 0.75rem;
    color: #5a5c69;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-category-count {
    background: #4e73df;
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.15s ease-in-out;
    text-decoration: none;
    display: block;
    color: inherit;
}

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

.search-result-item:hover {
    background-color: #f8f9fc;
    text-decoration: none;
    color: inherit;
}

.search-result-title {
    font-weight: 600;
    color: #3a3b45;
    margin-bottom: 0.15rem;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: #858796;
}

.search-result-description {
    font-size: 0.75rem;
    color: #b7b9cc;
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: #858796;
}

.search-loading i {
    margin-right: 0.5rem;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #858796;
}

.search-error {
    padding: 1rem;
    text-align: center;
    color: #e74a3b;
}

.search-meta {
    padding: 0.5rem 1rem;
    background: #f8f9fc;
    font-size: 0.75rem;
    color: #858796;
    border-top: 1px solid #e3e6f0;
    display: flex;
    justify-content: space-between;
}

.search-result-icon {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
    color: #858796;
}

@media (max-width: 768px) {
    .global-search-container {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .global-search-container {
        display: none;
    }
}

/* Recent Searches */
.recent-searches {
    padding: 0;
}

.recent-searches-header {
    padding: 0.6rem 1rem;
    background: #f8f9fc;
    font-weight: 600;
    font-size: 0.75rem;
    color: #5a5c69;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e3e6f0;
}

.recent-search-clear-all {
    background: none;
    border: none;
    color: #858796;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.7rem;
    transition: color 0.15s ease;
}

.recent-search-clear-all:hover {
    color: #e74a3b;
}

.recent-search-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.15s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.recent-search-item:hover {
    background-color: #f8f9fc;
}

.recent-search-content {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.recent-search-icon {
    color: #858796;
    margin-right: 0.75rem;
    font-size: 0.8rem;
}

.recent-search-query {
    font-weight: 500;
    color: #3a3b45;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-search-time {
    font-size: 0.7rem;
    color: #b7b9cc;
    margin-left: 0.75rem;
    white-space: nowrap;
}

.recent-search-remove {
    background: none;
    border: none;
    color: #d1d3e2;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    transition: color 0.15s ease;
    margin-left: 0.5rem;
}

.recent-search-remove:hover {
    color: #e74a3b;
}
