.search-bar {
    display: flex;
    align-items: center;
    height: 32px;
    border-radius: var(--radius-md);
    background-color: var(--background-tertiary);
    overflow: hidden;
    transition: background-color var(--transition-fast);
    width: 240px; /* Always expanded width */
}

.search-bar.expanded {
    width: 240px; /* Expanded width */
}

.search-bar.focused {
    background-color: var(--surface-hover);
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    flex-shrink: 0;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
}

.search-form {
    display: flex;
    align-items: center;
    flex-grow: 1;
    height: 100%;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.search-bar.expanded .search-form {
    opacity: 1;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.clear-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-circle);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.clear-button:hover {
    background-color: var(--surface-hover);
    color: var(--text-secondary);
}

/* Icon placeholders */
.icon-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
}

.icon-x {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-bar.expanded {
        width: 180px;
    }
}